Pimki 1.0.092
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +158 -0
- data/README-PIMKI +87 -0
- data/app/controllers/wiki.rb +563 -0
- data/app/models/author.rb +4 -0
- data/app/models/chunks/category.rb +31 -0
- data/app/models/chunks/category_test.rb +21 -0
- data/app/models/chunks/chunk.rb +20 -0
- data/app/models/chunks/engines.rb +34 -0
- data/app/models/chunks/include.rb +29 -0
- data/app/models/chunks/literal.rb +19 -0
- data/app/models/chunks/match.rb +19 -0
- data/app/models/chunks/nowiki.rb +31 -0
- data/app/models/chunks/nowiki_test.rb +14 -0
- data/app/models/chunks/test.rb +18 -0
- data/app/models/chunks/todo.rb +22 -0
- data/app/models/chunks/uri.rb +97 -0
- data/app/models/chunks/uri_test.rb +92 -0
- data/app/models/chunks/wiki.rb +82 -0
- data/app/models/chunks/wiki_test.rb +36 -0
- data/app/models/page.rb +91 -0
- data/app/models/page_lock.rb +24 -0
- data/app/models/page_set.rb +73 -0
- data/app/models/page_test.rb +76 -0
- data/app/models/revision.rb +91 -0
- data/app/models/revision_test.rb +252 -0
- data/app/models/web.rb +277 -0
- data/app/models/web_test.rb +53 -0
- data/app/models/wiki_content.rb +113 -0
- data/app/models/wiki_service.rb +137 -0
- data/app/models/wiki_service_test.rb +15 -0
- data/app/models/wiki_words.rb +26 -0
- data/app/models/wiki_words_test.rb +12 -0
- data/app/views/bottom.rhtml +4 -0
- data/app/views/markdown_help.rhtml +16 -0
- data/app/views/menu.rhtml +20 -0
- data/app/views/navigation.rhtml +26 -0
- data/app/views/rdoc_help.rhtml +16 -0
- data/app/views/static_style_sheet.rhtml +231 -0
- data/app/views/style.rhtml +179 -0
- data/app/views/textile_help.rhtml +28 -0
- data/app/views/top.rhtml +52 -0
- data/app/views/wiki/authors.rhtml +15 -0
- data/app/views/wiki/bliki.rhtml +101 -0
- data/app/views/wiki/bliki_edit.rhtml +33 -0
- data/app/views/wiki/bliki_new.rhtml +61 -0
- data/app/views/wiki/bliki_revision.rhtml +51 -0
- data/app/views/wiki/edit.rhtml +34 -0
- data/app/views/wiki/edit_menu.rhtml +27 -0
- data/app/views/wiki/edit_web.rhtml +139 -0
- data/app/views/wiki/export.rhtml +14 -0
- data/app/views/wiki/feeds.rhtml +10 -0
- data/app/views/wiki/list.rhtml +164 -0
- data/app/views/wiki/locked.rhtml +14 -0
- data/app/views/wiki/login.rhtml +11 -0
- data/app/views/wiki/mind.rhtml +39 -0
- data/app/views/wiki/new.rhtml +27 -0
- data/app/views/wiki/new_system.rhtml +78 -0
- data/app/views/wiki/new_web.rhtml +64 -0
- data/app/views/wiki/page.rhtml +84 -0
- data/app/views/wiki/print.rhtml +16 -0
- data/app/views/wiki/published.rhtml +10 -0
- data/app/views/wiki/recently_revised.rhtml +31 -0
- data/app/views/wiki/revision.rhtml +87 -0
- data/app/views/wiki/rss_feed.rhtml +22 -0
- data/app/views/wiki/search.rhtml +26 -0
- data/app/views/wiki/tex.rhtml +23 -0
- data/app/views/wiki/tex_web.rhtml +35 -0
- data/app/views/wiki/todo.rhtml +39 -0
- data/app/views/wiki/web_list.rhtml +13 -0
- data/app/views/wiki_words_help.rhtml +8 -0
- data/libraries/action_controller_servlet.rb +177 -0
- data/libraries/bluecloth.rb +1127 -0
- data/libraries/diff/diff.rb +475 -0
- data/libraries/diff/diff_test.rb +80 -0
- data/libraries/erb.rb +490 -0
- data/libraries/madeleine/automatic.rb +357 -0
- data/libraries/madeleine/clock.rb +94 -0
- data/libraries/madeleine_service.rb +69 -0
- data/libraries/rdocsupport.rb +156 -0
- data/libraries/redcloth_for_tex.rb +869 -0
- data/libraries/redcloth_for_tex_test.rb +41 -0
- data/libraries/view_helper.rb +33 -0
- data/libraries/web_controller_server.rb +95 -0
- data/pimki.rb +97 -0
- metadata +169 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
require "test/unit"
|
2
|
+
require "wiki_service"
|
3
|
+
|
4
|
+
class WebTest < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@web = Web.new "Instiki", "instiki"
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_wiki_word_linking
|
10
|
+
@web.add_page(Page.new(@web, "SecondPage", "Yo, yo. Have you EverBeenHated", Time.now, "DavidHeinemeierHansson"))
|
11
|
+
assert_equal(
|
12
|
+
"<p>Yo, yo. Have you <span class=\"newWikiWord\">Ever Been Hated<a href=\"../show/EverBeenHated\">?</a></span></p>",
|
13
|
+
@web.pages["SecondPage"].display_content
|
14
|
+
)
|
15
|
+
|
16
|
+
@web.add_page(Page.new(@web, "EverBeenHated", "Yo, yo. Have you EverBeenHated", Time.now, "DavidHeinemeierHansson"))
|
17
|
+
assert_equal(
|
18
|
+
"<p>Yo, yo. Have you <a class=\"existingWikiWord\" href=\"../show/EverBeenHated\">Ever Been Hated</a></p>",
|
19
|
+
@web.pages["SecondPage"].display_content
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_pages_by_revision
|
24
|
+
add_sample_pages
|
25
|
+
assert_equal "EverBeenHated", @web.select.by_revision.first.name
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_pages_by_match
|
29
|
+
add_sample_pages
|
30
|
+
assert_equal 2, @web.select { |page| page.content =~ /me/i }.length
|
31
|
+
assert_equal 1, @web.select { |page| page.content =~ /Who/i }.length
|
32
|
+
assert_equal 0, @web.select { |page| page.content =~ /none/i }.length
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_references
|
36
|
+
add_sample_pages
|
37
|
+
assert_equal 1, @web.select.pages_that_reference("EverBeenHated").length
|
38
|
+
assert_equal 0, @web.select.pages_that_reference("EverBeenInLove").length
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_delete
|
42
|
+
add_sample_pages
|
43
|
+
assert_equal 2, @web.pages.length
|
44
|
+
@web.remove_pages([ @web.pages["EverBeenInLove"] ])
|
45
|
+
assert_equal 1, @web.pages.length
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
def add_sample_pages
|
50
|
+
@web.add_page(Page.new(@web, "EverBeenInLove", "Who am I me", Time.local(2004, 4, 4, 16, 50), "DavidHeinemeierHansson"))
|
51
|
+
@web.add_page(Page.new(@web, "EverBeenHated", "I am me EverBeenHated", Time.local(2004, 4, 4, 16, 51), "DavidHeinemeierHansson"))
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
require 'chunks/engines'
|
3
|
+
require 'chunks/category'
|
4
|
+
require 'chunks/include'
|
5
|
+
require 'chunks/todo'
|
6
|
+
require 'chunks/wiki'
|
7
|
+
require 'chunks/literal'
|
8
|
+
require 'chunks/uri'
|
9
|
+
require 'chunks/nowiki'
|
10
|
+
|
11
|
+
# Wiki content is just a string that can process itself with a chain of
|
12
|
+
# actions. The actions can modify wiki content so that certain parts of
|
13
|
+
# it are protected from being rendered by later actions.
|
14
|
+
#
|
15
|
+
# When wiki content is rendered, it can be interrogated to find out
|
16
|
+
# which chunks were rendered. This means things like categories, wiki
|
17
|
+
# links, can be determined.
|
18
|
+
#
|
19
|
+
# Exactly how wiki content is rendered is determined by a number of
|
20
|
+
# settings that are optionally passed in to a constructor. The current
|
21
|
+
# options are:
|
22
|
+
# * :engine
|
23
|
+
# => The structural markup engine to use (Textile, Markdown, RDoc)
|
24
|
+
# * :engine_opts
|
25
|
+
# => A list of options to pass to the markup engines (safe modes, etc)
|
26
|
+
# * :pre_engine_actions
|
27
|
+
# => A list of render actions or chunks to be processed before the
|
28
|
+
# markup engine is applied. By default this is:
|
29
|
+
# Category, Include, URIChunk, WikiChunk::Link, WikiChunk::Word
|
30
|
+
# * :post_engine_actions
|
31
|
+
# => A list of render actions or chunks to apply after the markup
|
32
|
+
# engine. By default these are:
|
33
|
+
# Literal::Pre, Literal::Tags
|
34
|
+
# ToDo items
|
35
|
+
# * :mode
|
36
|
+
# => How should the content be rendered? For normal display (:display),
|
37
|
+
# publishing (:publish) or export (:export)?
|
38
|
+
#
|
39
|
+
# AUTHOR: Mark Reid <mark @ threewordslong . com>
|
40
|
+
# CREATED: 15th May 2004
|
41
|
+
# UPDATED: 22nd May 2004
|
42
|
+
class WikiContent < String
|
43
|
+
|
44
|
+
# Moved URIChunk from pre-engine to post-engine, as it clashed with the textile
|
45
|
+
# markup of "link":URL.
|
46
|
+
PRE_ENGINE_ACTIONS = [ NoWiki, Category, Include, WikiChunk::Link, WikiChunk::Word ]
|
47
|
+
POST_ENGINE_ACTIONS = [ Literal::Pre, Literal::Tags, URIChunk, Todo ]
|
48
|
+
|
49
|
+
|
50
|
+
DEFAULT_OPTS = {
|
51
|
+
:pre_engine_actions => PRE_ENGINE_ACTIONS,
|
52
|
+
:post_engine_actions => POST_ENGINE_ACTIONS,
|
53
|
+
:engine => Engines::Textile,
|
54
|
+
:engine_opts => [],
|
55
|
+
:mode => [:display]
|
56
|
+
}
|
57
|
+
|
58
|
+
attr_reader :web, :options, :rendered
|
59
|
+
|
60
|
+
# Create a new wiki content string from the given one.
|
61
|
+
# The options are explained at the top of this file.
|
62
|
+
def initialize(revision, options = {})
|
63
|
+
@revision = revision
|
64
|
+
@web = @revision.page.web
|
65
|
+
|
66
|
+
# Deep copy of DEFAULT_OPTS to ensure that changes to PRE/POST_ENGINE_ACTIONS stay local
|
67
|
+
@options = Marshal.load(Marshal.dump(DEFAULT_OPTS)).update(options)
|
68
|
+
@options[:engine] = Engines::MAP[@web.markup] || Engines::Textile
|
69
|
+
@options[:engine_opts] = (@web.safe_mode ? [:filter_html, :filter_styles] : [])
|
70
|
+
|
71
|
+
@options[:pre_engine_actions].delete(WikiChunk::Word) if @web.brackets_only
|
72
|
+
|
73
|
+
super(@revision.content)
|
74
|
+
|
75
|
+
begin
|
76
|
+
render!(@options[:pre_engine_actions] + [@options[:engine]] + @options[:post_engine_actions])
|
77
|
+
rescue => e
|
78
|
+
@rendered = "<strong>#{e.message}</strong><br/><br/>#{e.backtrace.join('<br/>')}"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Call @web.page_link using current options.
|
83
|
+
def page_link(name, text)
|
84
|
+
@web.make_link(name, text, @options)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Find all the chunks of the given types
|
88
|
+
def find_chunks(chunk_type)
|
89
|
+
rendered.select { |chunk| chunk.kind_of?(chunk_type) }
|
90
|
+
end
|
91
|
+
|
92
|
+
# Render this content using the specified actions.
|
93
|
+
def render!(chunk_types)
|
94
|
+
@chunks = []
|
95
|
+
chunk_types.each { |chunk_type| self.apply_type!(chunk_type) }
|
96
|
+
|
97
|
+
# unmasking order is reversed to allow chuncks that encapsulate other chunks,
|
98
|
+
# e.g. a ToDo item with a WikiWork link.
|
99
|
+
@rendered = @chunks.reverse.map { |chunk| chunk.unmask(self) }.compact
|
100
|
+
(@chunks - @rendered).each { |chunk| chunk.revert(self) }
|
101
|
+
end
|
102
|
+
|
103
|
+
# Find all the chunks of the given type in this content
|
104
|
+
# Each time the type's pattern is matched, create a new
|
105
|
+
# chunk for it, and replace the occurance of the chunk
|
106
|
+
# in this content with its mask.
|
107
|
+
def apply_type!(chunk_type)
|
108
|
+
self.gsub!( chunk_type.pattern ) do |match|
|
109
|
+
@chunks << chunk_type.new($~)
|
110
|
+
@chunks.last.mask(self)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
|
2
|
+
require "madeleine_service"
|
3
|
+
require "web"
|
4
|
+
require "page"
|
5
|
+
require "author"
|
6
|
+
|
7
|
+
class WikiService < MadeleineService
|
8
|
+
attr_reader :webs, :system
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@webs, @system = {}, {}
|
12
|
+
end
|
13
|
+
|
14
|
+
def setup?
|
15
|
+
!@system.empty?
|
16
|
+
end
|
17
|
+
|
18
|
+
def authenticate(password)
|
19
|
+
password == (@system["password"] || "instiki")
|
20
|
+
end
|
21
|
+
|
22
|
+
def setup(password, web_name, web_address)
|
23
|
+
@system["password"] = password
|
24
|
+
create_web(web_name, web_address)
|
25
|
+
end
|
26
|
+
|
27
|
+
def create_web(name, address, password = nil)
|
28
|
+
@webs[address] = Web.new(name, address, password) unless @webs[address]
|
29
|
+
end
|
30
|
+
|
31
|
+
def update_web(old_address, new_address, name, markup, color, additional_style, safe_mode = false,
|
32
|
+
password = nil, published = false, brackets_only = false, count_pages = false)
|
33
|
+
if old_address != new_address
|
34
|
+
@webs[new_address] = @webs[old_address]
|
35
|
+
@webs.delete(old_address)
|
36
|
+
@webs[new_address].address = new_address
|
37
|
+
end
|
38
|
+
|
39
|
+
web = @webs[new_address]
|
40
|
+
web.refresh_revisions if settings_changed?(web, markup, safe_mode, brackets_only)
|
41
|
+
|
42
|
+
web.name, web.markup, web.color, web.additional_style, web.safe_mode =
|
43
|
+
name, markup, color, additional_style, safe_mode
|
44
|
+
|
45
|
+
web.password, web.published, web.brackets_only, web.count_pages =
|
46
|
+
password, published, brackets_only, count_pages
|
47
|
+
end
|
48
|
+
|
49
|
+
def read_page(web_address, page_name)
|
50
|
+
@webs[web_address].pages[page_name]
|
51
|
+
end
|
52
|
+
|
53
|
+
def write_page(web_address, page_name, content, written_on, author)
|
54
|
+
page = Page.new(@webs[web_address], page_name, content, written_on, author)
|
55
|
+
@webs[web_address].add_page(page)
|
56
|
+
page
|
57
|
+
end
|
58
|
+
|
59
|
+
def revise_page(web_address, page_name, content, revised_on, author)
|
60
|
+
page = read_page(web_address, page_name)
|
61
|
+
page.revise(content, revised_on, author)
|
62
|
+
page
|
63
|
+
end
|
64
|
+
|
65
|
+
def rollback_page(web_address, page_name, revision_number, created_at, author_id = nil)
|
66
|
+
page = read_page(web_address, page_name)
|
67
|
+
page.rollback(revision_number, created_at, author_id)
|
68
|
+
page
|
69
|
+
end
|
70
|
+
|
71
|
+
def remove_orphaned_pages(web_address)
|
72
|
+
@webs[web_address].remove_pages(@webs[web_address].select.orphaned_pages)
|
73
|
+
end
|
74
|
+
|
75
|
+
# deletes a page from the web.
|
76
|
+
def delete_page(web_address, page_name) #{{{
|
77
|
+
@webs[web_address].pages.delete(page_name)
|
78
|
+
end #}}}
|
79
|
+
|
80
|
+
# renames a page in the web.
|
81
|
+
def rename_page(web_address, old_page_name, new_page_name) #{{{
|
82
|
+
web = @webs[web_address]
|
83
|
+
page = web.pages.delete(old_page_name)
|
84
|
+
page or raise "unknown page: #{old_page_name.to_s};; #{pages.keys.join(',')}"
|
85
|
+
page.name = new_page_name
|
86
|
+
web.pages[new_page_name] = page
|
87
|
+
end #}}}
|
88
|
+
|
89
|
+
def save_menu_pref(web, type, limit, content) #{{{
|
90
|
+
web.menu_type = type
|
91
|
+
web.menu_limit = limit
|
92
|
+
web.menu_content = content
|
93
|
+
if web.menu_type == 'user'
|
94
|
+
# only calculate the rendered content once:
|
95
|
+
web.rendered_menu = Page.new(
|
96
|
+
web, 'menu', @params["content"], Time.now, ''
|
97
|
+
).revisions.last.display_content
|
98
|
+
end
|
99
|
+
end #}}}
|
100
|
+
|
101
|
+
# Bliki commands -------------------------------------------------------------
|
102
|
+
|
103
|
+
def read_bliki_entry(web_address, page_name)
|
104
|
+
@webs[web_address].bliki[page_name]
|
105
|
+
end
|
106
|
+
|
107
|
+
def write_bliki_entry(web_address, page_name, content, written_on, author)
|
108
|
+
page = Page.new(@webs[web_address], page_name, content, written_on, author)
|
109
|
+
@webs[web_address].add_bliki_entry(page)
|
110
|
+
page
|
111
|
+
end
|
112
|
+
|
113
|
+
def revise_bliki_entry(web_address, page_name, content, revised_on, author)
|
114
|
+
page = read_bliki_entry(web_address, page_name)
|
115
|
+
page.revise(content, revised_on, author)
|
116
|
+
page
|
117
|
+
end
|
118
|
+
|
119
|
+
def rollback_bliki_entry(web_address, page_name, revision_number, created_at)
|
120
|
+
page = read_bliki_entry(web_address, page_name)
|
121
|
+
page.rollback(revision_number, created_at)
|
122
|
+
page
|
123
|
+
end
|
124
|
+
|
125
|
+
def delete_bliki_entry(web_address, page_name) #{{{
|
126
|
+
@webs[web_address].bliki.delete(page_name)
|
127
|
+
end #}}}
|
128
|
+
|
129
|
+
private
|
130
|
+
def settings_changed?(web, markup, safe_mode, brackets_only)
|
131
|
+
web.markup != markup ||
|
132
|
+
web.safe_mode != safe_mode ||
|
133
|
+
web.brackets_only != brackets_only
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# jEdit :folding=indent:collapseFolds=1:
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "test/unit"
|
2
|
+
require "wiki_service"
|
3
|
+
|
4
|
+
class WikiServiceTest < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
WikiService.restart
|
7
|
+
@s = WikiService.instance
|
8
|
+
@s.create_web "Instiki", "instiki"
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_read_write_page
|
12
|
+
@s.write_page "instiki", "FirstPage", "Electric shocks, I love 'em", Time.now, "DavidHeinemeierHansson"
|
13
|
+
assert_equal "Electric shocks, I love 'em", @s.read_page("instiki", "FirstPage").content
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
# Contains all the methods for finding and replacing wiki words
|
3
|
+
module WikiWords
|
4
|
+
# In order of appearance: Latin, greek, cyrillian, armenian
|
5
|
+
I18N_HIGHER_CASE_LETTERS =
|
6
|
+
"ÀÁÂÃÄÅĀĄĂÆÇĆČĈĊĎĐÈÉÊËĒĘĚĔĖĜĞĠĢĤĦÌÍÎÏĪĨĬĮİIJĴĶŁĽĹĻĿÑŃŇŅŊÒÓÔÕÖØŌŐŎŒŔŘŖŚŠŞŜȘŤŢŦȚÙÚÛÜŪŮŰŬŨŲŴÝŶŸŹŽŻ" +
|
7
|
+
"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" +
|
8
|
+
"ΆΈΉΊΌΎΏѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸЖ" +
|
9
|
+
"ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՏՐՑՒՓՔՕՖ"
|
10
|
+
|
11
|
+
I18N_LOWER_CASE_LETTERS =
|
12
|
+
"àáâãäåāąăæçćčĉċďđèéêëēęěĕėƒĝğġģĥħìíîïīĩĭįıijĵķĸłľĺļŀñńňņʼnŋòóôõöøōőŏœŕřŗśšşŝșťţŧțùúûüūůűŭũųŵýÿŷžżźÞþßſÐð" +
|
13
|
+
"άέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώΐ" +
|
14
|
+
"абвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӀӂӄӆӈӊӌӎӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӹ" +
|
15
|
+
"աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆև"
|
16
|
+
|
17
|
+
WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + '][a-z' + I18N_LOWER_CASE_LETTERS + ']+[A-Z' + I18N_HIGHER_CASE_LETTERS + ']\w+'
|
18
|
+
|
19
|
+
def self.separate(wiki_word, ignore_separation = false)
|
20
|
+
if ignore_separation
|
21
|
+
wiki_word
|
22
|
+
else
|
23
|
+
wiki_word.gsub(/([a-z#{I18N_LOWER_CASE_LETTERS}])([A-Z#{I18N_HIGHER_CASE_LETTERS}])/u, '\1 \2').gsub(/(\d+)/u, ' \1 ')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "test/unit"
|
2
|
+
require "wiki_words"
|
3
|
+
|
4
|
+
class WikiWordsTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def test_utf8_characters_in_wiki_word
|
7
|
+
assert_equal "Æåle Øen", WikiWords.separate("ÆåleØen")
|
8
|
+
assert_equal "ÆÅØle Øen", WikiWords.separate("ÆÅØleØen")
|
9
|
+
assert_equal "Æe ÅØle Øen", WikiWords.separate("ÆeÅØleØen")
|
10
|
+
assert_equal "Legetøj", WikiWords.separate("Legetøj")
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
|
2
|
+
<h3>Markdown formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">advanced</a>)</h3>
|
3
|
+
<table cellspacing="0" cellpadding="0">
|
4
|
+
<tr><td>_your text_</td><td class="arrow">→</td><td><em>your text</em></td></tr>
|
5
|
+
<tr><td>**your text**</td><td class="arrow">→</td><td><strong>your text</strong></td></tr>
|
6
|
+
<tr><td>`my code`</td><td class="arrow">→</td><td><code>my code</code></td></tr>
|
7
|
+
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">→</td><td>• Bulleted list<br />• Second item</td></tr>
|
8
|
+
<tr><td>1. Numbered list<br />1. Second item</td><td class="arrow">→</td><td>1. Numbered list<br />2. Second item</td></tr>
|
9
|
+
<tr><td>[link name](URL)</td><td class="arrow">→</td><td><a href="URL">link name</a></td></tr>
|
10
|
+
<tr><td>***</td><td class="arrow">→</td><td>Horizontal ruler</td></tr>
|
11
|
+
<tr><td><http://url><br /><email@add.com></td><td class="arrow">→</td><td>Auto-linked</td></tr>
|
12
|
+
<tr><td></td><td class="arrow">→</td><td>Image</td></tr>
|
13
|
+
</table>
|
14
|
+
|
15
|
+
<%= sub_template "wiki_words_help" %>
|
16
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div id="Menu">
|
2
|
+
<p>
|
3
|
+
<table>
|
4
|
+
<% begin %>
|
5
|
+
<tr><th><%= @web.name %> Quick Links</th></tr>
|
6
|
+
<tr><td><a href='../edit_menu/' style="font-size: 9px;">Edit Menu Contents</a></td></tr>
|
7
|
+
<tr><td> </td></tr>
|
8
|
+
<% if @menu_pages.nil? %>
|
9
|
+
<tr><td><%= @menu_content %></td></tr>
|
10
|
+
<% else %>
|
11
|
+
<% for page in @menu_pages %>
|
12
|
+
<tr><td><a href="../show/<%= page.name %>"><%= truncate(page.plain_name, 35) %></a></td></tr>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
<% rescue Exception
|
16
|
+
end
|
17
|
+
%>
|
18
|
+
</table>
|
19
|
+
</div>
|
20
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%
|
2
|
+
def list_item(title, url, description, accesskey = nil)
|
3
|
+
if @title == title
|
4
|
+
"<b class=\"navOn\" title=\"#{description}\" accesskey=\"#{accesskey}\">#{title}</b>"
|
5
|
+
else
|
6
|
+
"<a href=\"#{url}\" title=\"#{description}\" accesskey=\"#{accesskey}\">#{title}</a>"
|
7
|
+
end
|
8
|
+
end
|
9
|
+
%>
|
10
|
+
|
11
|
+
<form id="navigationForm" class="navigation" action="../search/" action="get" style="font-size: 10px">
|
12
|
+
<%= list_item "Home Page", "../show/HomePage", "Home, Sweet Home", "H" %> |
|
13
|
+
<%= list_item "All Pages", "../list/", "Alphabetically sorted list of pages", "A" %> |
|
14
|
+
<% if `dot -V 2>&1` =~ /dot version/ %>
|
15
|
+
<%= list_item "Mind Map", "../mind/", "A 'Mind Map' graph of wiki pages", "M" %> |
|
16
|
+
<% end %>
|
17
|
+
<%= list_item "Bliki", "../bliki/", "Bliki", "B" %> |
|
18
|
+
<%= list_item "ToDo", "../todo/", "Todo items from all pages", "T" %> |
|
19
|
+
<%= list_item "Recently Revised", "../recently_revised/", "Pages sorted by when they were last changed", "U" %> |
|
20
|
+
<!-- Moved to bottom of HomePage:
|
21
|
+
<%= list_item "Authors", "../authors/", "Who wrote what" %> |
|
22
|
+
<%= list_item "Feeds", "../feeds/", "Subscribe to changes by RSS" %> |
|
23
|
+
<%= list_item "Export", "../export/", "Download a zip with all the pages in this wiki", "X" %> |
|
24
|
+
-->
|
25
|
+
<input type="text" id="searchField" name="query" style="font-size: 10px" value="Search" onClick="this.value == 'Search' ? this.value = '' : true">
|
26
|
+
</form>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
|
2
|
+
<h3>RDoc formatting tips (<a target="_new" href="http://rdoc.sourceforge.net/doc/files/markup/simple_markup_rb.html">advanced</a>)</h3>
|
3
|
+
<table cellspacing="0" cellpadding="0">
|
4
|
+
<tr><td>_your text_</td><td class="arrow">→</td><td><em>your text</em></td></tr>
|
5
|
+
<tr><td>*your text*</td><td class="arrow">→</td><td><strong>your text</strong></td></tr>
|
6
|
+
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">→</td><td>• Bulleted list<br />• Second item</td></tr>
|
7
|
+
<tr><td>1. Numbered list<br />2. Second item</td><td class="arrow">→</td><td>1. Numbered list<br />2. Second item</td></tr>
|
8
|
+
<tr><td>+my_code+</td><td class="arrow">→</td><td><code>my_code</code></td></tr>
|
9
|
+
<tr><td>---</td><td class="arrow">→</td><td>Horizontal ruler</td></tr>
|
10
|
+
<tr><td>[[URL linkname]]</td><td class="arrow">→</td><td><a href="URL">linkname</a></td></tr>
|
11
|
+
<tr><td>http://url<br />mailto:e@add.com</td><td class="arrow">→</td><td>Auto-linked</td></tr>
|
12
|
+
<tr><td>imageURL</td><td class="arrow">→</td><td>Image</td></tr>
|
13
|
+
</table>
|
14
|
+
|
15
|
+
<%= sub_template "wiki_words_help" %>
|
16
|
+
</div>
|