olelo 0.9.3 → 0.9.4
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/.travis.yml +4 -0
- data/Rakefile +6 -12
- data/bin/olelo +13 -8
- data/config.ru +21 -15
- data/config/aspects.rb +45 -32
- data/config/config.yml.default +1 -0
- data/config/initializers/00-mime_types.rb +22 -17
- data/config/initializers/01-slim.rb +2 -2
- data/lib/olelo.rb +1 -8
- data/lib/olelo/application.rb +33 -34
- data/lib/olelo/attributes.rb +4 -4
- data/lib/olelo/extensions.rb +0 -7
- data/lib/olelo/helper.rb +13 -25
- data/lib/olelo/html_safe.rb +0 -4
- data/lib/olelo/locale.yml +6 -3
- data/lib/olelo/menu.rb +1 -1
- data/lib/olelo/page.rb +21 -18
- data/lib/olelo/version.rb +1 -1
- data/olelo.gemspec +5 -3
- data/plugins/aspects/changelog.rb +5 -5
- data/plugins/aspects/documentbrowser.rb +5 -5
- data/plugins/{gallery → aspects/gallery}/gallery.css +0 -0
- data/plugins/{gallery → aspects/gallery}/gallery.scss +0 -0
- data/plugins/{gallery → aspects/gallery}/main.rb +3 -3
- data/plugins/aspects/highlight.rb +1 -1
- data/plugins/aspects/image.rb +1 -1
- data/plugins/aspects/imageinfo.rb +3 -3
- data/plugins/aspects/main.rb +21 -21
- data/plugins/aspects/pageinfo.rb +2 -2
- data/plugins/aspects/source.rb +1 -1
- data/plugins/aspects/subpages.rb +7 -7
- data/plugins/aspects/text.rb +1 -1
- data/plugins/authentication/portal.rb +2 -2
- data/plugins/authentication/yamlfile.rb +1 -1
- data/plugins/blog/main.rb +10 -10
- data/plugins/editor/preview.rb +3 -3
- data/plugins/filters/creole.rb +1 -1
- data/plugins/filters/editsection.rb +2 -2
- data/plugins/filters/html2xml.rb +6 -0
- data/plugins/filters/main.rb +1 -1
- data/plugins/filters/remind/main.rb +15 -0
- data/plugins/filters/remind/rem2html +562 -0
- data/plugins/filters/s5/main.rb +1 -1
- data/plugins/login/persistent.rb +1 -1
- data/plugins/misc/system.rb +4 -0
- data/plugins/misc/variables.rb +1 -1
- data/plugins/misc/webdav.rb +10 -10
- data/plugins/repositories/git_grep.rb +2 -2
- data/plugins/repositories/gitrb_repository.rb +10 -10
- data/plugins/repositories/rugged_repository.rb +7 -7
- data/plugins/tags/code.rb +1 -1
- data/plugins/tags/footnotes.rb +4 -3
- data/plugins/tags/gist.rb +2 -2
- data/plugins/tags/html.rb +11 -11
- data/plugins/tags/include.rb +6 -6
- data/plugins/tags/main.rb +10 -10
- data/plugins/tags/math.rb +2 -2
- data/plugins/tags/redirect.rb +3 -3
- data/plugins/tags/scripting.rb +12 -12
- data/plugins/tags/sort.rb +1 -1
- data/plugins/tags/tabs.rb +1 -1
- data/plugins/treeview/main.rb +3 -3
- data/plugins/treeview/script.js +5 -5
- data/plugins/treeview/script/00-jquery.treeview.js +6 -6
- data/plugins/treeview/script/init.js +1 -1
- data/plugins/utils/assets.rb +4 -4
- data/plugins/utils/cache.rb +10 -6
- data/plugins/utils/store.rb +4 -4
- data/static/script.js +124 -126
- data/static/script/{02-jquery.js → 01-jquery.js} +0 -0
- data/static/script/02-olelo.storage.js +54 -0
- data/static/script/10-olelo.historytable.js +2 -2
- data/static/script/13-olelo.tabwidget.js +2 -2
- data/test/helper.rb +5 -4
- data/test/page_test.rb +1 -1
- data/test/request_test.rb +42 -38
- data/test/string_extensions_test.rb +0 -6
- data/test/templates_test.rb +1 -1
- data/test/util_test.rb +1 -1
- data/views/changes.slim +2 -2
- data/views/compare.slim +4 -4
- data/views/delete.slim +2 -2
- data/views/deleted.slim +1 -1
- data/views/edit.slim +31 -26
- data/views/history.slim +5 -5
- data/views/layout.slim +1 -1
- data/views/login.slim +30 -32
- data/views/move.slim +3 -3
- data/views/profile.slim +2 -2
- data/views/show.slim +1 -1
- metadata +43 -104
- data/static/script/01-jstorage.js +0 -217
data/.travis.yml
ADDED
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
task :
|
1
|
+
task default: %w(test:spec)
|
2
2
|
|
3
3
|
def shrink_js(t)
|
4
4
|
#sh "cat #{t.prerequisites.sort.join(' ')} > #{t.name}"
|
@@ -36,10 +36,10 @@ file('plugins/editor/markup/script.js' => Dir.glob('plugins/editor/markup/script
|
|
36
36
|
|
37
37
|
namespace :gen do
|
38
38
|
desc('Shrink JS files')
|
39
|
-
task :
|
39
|
+
task js: %w(static/script.js plugins/treeview/script.js plugins/misc/fancybox/script.js plugins/editor/markup/script.js)
|
40
40
|
|
41
41
|
desc('Compile CSS files')
|
42
|
-
task :
|
42
|
+
task css: %w(static/themes/atlantis/style.css
|
43
43
|
plugins/treeview/treeview.css
|
44
44
|
plugins/utils/pygments.css
|
45
45
|
plugins/gallery/gallery.css
|
@@ -49,12 +49,12 @@ end
|
|
49
49
|
|
50
50
|
namespace :test do
|
51
51
|
desc 'Run tests with bacon'
|
52
|
-
task :
|
52
|
+
task spec: FileList['test/*_test.rb'] do |t|
|
53
53
|
sh "bacon -q -Ilib:test #{t.prerequisites.join(' ')}"
|
54
54
|
end
|
55
55
|
|
56
56
|
desc 'Generate test coverage report'
|
57
|
-
task :
|
57
|
+
task rcov: FileList['test/*_test.rb'] do |t|
|
58
58
|
sh "rcov -Ilib:test #{t.prerequisites.join(' ')}"
|
59
59
|
end
|
60
60
|
end
|
@@ -64,15 +64,9 @@ task :clean do |t|
|
|
64
64
|
FileUtils.rm_rf 'doc/api'
|
65
65
|
FileUtils.rm_rf 'coverage'
|
66
66
|
FileUtils.rm_rf '.wiki/cache'
|
67
|
-
FileUtils.rm_rf '.wiki/blahtex'
|
68
67
|
FileUtils.rm_rf '.wiki/log'
|
69
68
|
end
|
70
69
|
|
71
|
-
desc 'Remove wiki folder'
|
72
|
-
task 'clean:all' => :clean do |t|
|
73
|
-
FileUtils.rm_rf '.wiki'
|
74
|
-
end
|
75
|
-
|
76
70
|
desc 'Generate documentation'
|
77
71
|
namespace :doc do
|
78
72
|
task :gen do; system("yard doc -o doc/api 'lib/**/*.rb' 'plugins/**/*.rb'"); end
|
@@ -89,4 +83,4 @@ namespace :notes do
|
|
89
83
|
end
|
90
84
|
|
91
85
|
desc 'Show annotations'
|
92
|
-
task :
|
86
|
+
task notes: %w(notes:todo notes:fixme notes:hack notes:warning notes:important)
|
data/bin/olelo
CHANGED
@@ -11,8 +11,8 @@ Options:
|
|
11
11
|
}
|
12
12
|
|
13
13
|
options = {
|
14
|
-
:
|
15
|
-
:
|
14
|
+
port: 8080,
|
15
|
+
host: '0.0.0.0'
|
16
16
|
}
|
17
17
|
|
18
18
|
app_path = File.expand_path(File.join(__FILE__, '..', '..'))
|
@@ -20,15 +20,19 @@ app_path = File.expand_path(File.join(__FILE__, '..', '..'))
|
|
20
20
|
opts = OptionParser.new do |opts|
|
21
21
|
opts.banner = help
|
22
22
|
|
23
|
-
opts.on('-p', '--port
|
23
|
+
opts.on('-p', '--port PORT', 'Bind port (default 8080).') do |port|
|
24
24
|
options[:port] = port.to_i
|
25
25
|
end
|
26
26
|
|
27
|
-
opts.on('-o', '--host
|
27
|
+
opts.on('-o', '--host HOST', 'Hostname or IP address to listen on (default 0.0.0.0).') do |host|
|
28
28
|
options[:host] = host
|
29
29
|
end
|
30
30
|
|
31
|
-
opts.on('-
|
31
|
+
opts.on('-s', '--server SERVER', 'serve using SERVER (webrick/mongrel)') do |server|
|
32
|
+
options[:server] = server
|
33
|
+
end
|
34
|
+
|
35
|
+
opts.on('-c', '--config CONFIG', 'Path to the Olelo configuration, sets the $OLELO_CONFIG environment variable.') do |config|
|
32
36
|
ENV['OLELO_CONFIG'] = File.expand_path(config)
|
33
37
|
end
|
34
38
|
|
@@ -53,6 +57,7 @@ elsif ARGV.size > 1
|
|
53
57
|
exit
|
54
58
|
end
|
55
59
|
|
56
|
-
Rack::Server.start(:
|
57
|
-
:
|
58
|
-
:
|
60
|
+
Rack::Server.start(Port: options[:port],
|
61
|
+
Host: options[:host],
|
62
|
+
server: options[:server],
|
63
|
+
config: File.join(app_path, 'config.ru'))
|
data/config.ru
CHANGED
@@ -24,28 +24,34 @@ Olelo::Config.instance['themes_path'] = ::File.join(app_path, 'static', 'themes'
|
|
24
24
|
Olelo::Config.instance['rack.session_secret'] = SecureRandom.hex
|
25
25
|
Olelo::Config.instance.load!(::File.join(app_path, 'config', 'config.yml.default'))
|
26
26
|
|
27
|
+
config_file = ENV['OLELO_CONFIG'] || ENV['WIKI_CONFIG']
|
28
|
+
unless config_file
|
29
|
+
path = ::File.join(app_path, 'config', 'config.yml')
|
30
|
+
config_file = path if File.exists?(path)
|
31
|
+
end
|
32
|
+
|
27
33
|
if Dir.pwd == app_path
|
28
34
|
puts "Serving from Olelo application directory #{app_path}"
|
29
35
|
data_path = File.join(app_path, '.wiki')
|
30
|
-
Olelo::Config.instance['repository.git'] = { :
|
31
|
-
Olelo::Config.instance['cache_store'] = { :
|
36
|
+
Olelo::Config.instance['repository.git'] = { path: ::File.join(data_path, 'repository'), bare: false }
|
37
|
+
Olelo::Config.instance['cache_store'] = { type: 'file', 'file.root' => ::File.join(data_path, 'cache') }
|
32
38
|
Olelo::Config.instance['authentication.yamlfile.store'] = ::File.join(data_path, 'users.yml')
|
33
39
|
Olelo::Config.instance['log.file'] = ::File.join(data_path, 'log')
|
34
40
|
elsif File.directory?(::File.join(Dir.pwd, '.git'))
|
35
41
|
puts "Serving out of repository #{Dir.pwd}"
|
36
42
|
data_path = File.join(Dir.pwd, '.wiki')
|
37
|
-
Olelo::Config.instance['repository.git'] = { :
|
38
|
-
Olelo::Config.instance['cache_store'] = { :
|
43
|
+
Olelo::Config.instance['repository.git'] = { path: Dir.pwd, bare: false }
|
44
|
+
Olelo::Config.instance['cache_store'] = { type: 'file', 'file.root' => ::File.join(data_path, 'cache') }
|
39
45
|
Olelo::Config.instance['authentication.yamlfile.store'] = ::File.join(data_path, 'users.yml')
|
40
46
|
Olelo::Config.instance['log.file'] = ::File.join(data_path, 'log')
|
41
|
-
|
42
|
-
puts 'No
|
47
|
+
elsif !config_file
|
48
|
+
puts 'No git repository found, please create your own configuration file!'
|
49
|
+
exit 1
|
43
50
|
end
|
44
51
|
|
45
|
-
if
|
46
|
-
|
47
|
-
|
48
|
-
Olelo::Config.instance.load(::File.join(app_path, 'config', 'config.yml'))
|
52
|
+
if config_file
|
53
|
+
puts "Loading configuration from #{config_file}"
|
54
|
+
Olelo::Config.instance.load!(config_file)
|
49
55
|
end
|
50
56
|
|
51
57
|
Olelo::Config.instance.freeze
|
@@ -54,6 +60,8 @@ FileUtils.mkpath ::File.dirname(Olelo::Config['log.file'])
|
|
54
60
|
logger = ::Logger.new(Olelo::Config['log.file'], :monthly, 10240000)
|
55
61
|
logger.level = ::Logger.const_get(Olelo::Config['log.level'])
|
56
62
|
|
63
|
+
Olelo::Initializer.initialize(logger)
|
64
|
+
|
57
65
|
# Doesn't work currently, rack issue #241
|
58
66
|
# if !Olelo::Config['production']
|
59
67
|
# # Rack::Lint injector
|
@@ -77,8 +85,8 @@ if Olelo::Config['rack.deflater']
|
|
77
85
|
use Rack::Deflater
|
78
86
|
end
|
79
87
|
|
80
|
-
use Rack::StaticCache, :
|
81
|
-
use Rack::Session::Cookie, :
|
88
|
+
use Rack::StaticCache, urls: ['/static'], root: app_path
|
89
|
+
use Rack::Session::Cookie, key: 'olelo.session', secret: Olelo::Config['rack.session_secret']
|
82
90
|
use Olelo::Middleware::DegradeMimeType
|
83
91
|
|
84
92
|
class LoggerOutput
|
@@ -89,10 +97,8 @@ end
|
|
89
97
|
use Rack::MethodOverride
|
90
98
|
use Rack::CommonLogger, LoggerOutput.new(logger)
|
91
99
|
use Olelo::Middleware::ForceEncoding
|
92
|
-
use Olelo::Middleware::Flash, :
|
100
|
+
use Olelo::Middleware::Flash, set_accessors: %w(error warn info)
|
93
101
|
use Rack::RelativeRedirect
|
94
|
-
|
95
|
-
Olelo::Initializer.initialize(logger)
|
96
102
|
run Olelo::Application.new
|
97
103
|
|
98
104
|
logger.info "Olelo started in #{Olelo::Config['production'] ? 'production' : 'development'} mode"
|
data/config/aspects.rb
CHANGED
@@ -47,9 +47,9 @@ regexp :mediawiki_nowiki, /<nowiki>.*?<\/nowiki>/m, '<notags>\0</notags>'
|
|
47
47
|
# end
|
48
48
|
#
|
49
49
|
# tag filter options:
|
50
|
-
# tag(:
|
51
|
-
# tag(:
|
52
|
-
# tag(:
|
50
|
+
# tag(enable: 'html:*') Enable only html tags
|
51
|
+
# tag(disable: %w(html:* scripting:include)) Disable html tags and scripting:include
|
52
|
+
# tag(disable: 'html:*') Disable only html tags
|
53
53
|
#
|
54
54
|
################################################################################
|
55
55
|
|
@@ -67,7 +67,7 @@ aspect :page do
|
|
67
67
|
remove_comments.tag_shortcuts
|
68
68
|
creole_nowiki.tag { creole!.rubypants }
|
69
69
|
end
|
70
|
-
toc.interwiki(:
|
70
|
+
toc.interwiki(map: interwiki_map).link_classifier
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -78,7 +78,7 @@ aspect :s5 do
|
|
78
78
|
filter do
|
79
79
|
remove_comments.tag_shortcuts
|
80
80
|
creole_nowiki.tag { creole!.rubypants }
|
81
|
-
toc.interwiki(:
|
81
|
+
toc.interwiki(map: interwiki_map).link_classifier
|
82
82
|
html_wrapper!.s5!
|
83
83
|
end
|
84
84
|
end
|
@@ -89,9 +89,9 @@ aspect :latex do
|
|
89
89
|
mime 'text/plain; charset=utf-8'
|
90
90
|
filter do
|
91
91
|
remove_comments.tag_shortcuts.creole_nowiki
|
92
|
-
tag(:
|
93
|
-
toc.interwiki(:
|
94
|
-
html_wrapper!.xslt!(:
|
92
|
+
tag(static: true) { creole!.rubypants }
|
93
|
+
toc.interwiki(map: interwiki_map)
|
94
|
+
html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -107,7 +107,7 @@ aspect :page do
|
|
107
107
|
remove_comments.tag_shortcuts
|
108
108
|
mediawiki_nowiki.tag { mediawiki!.rubypants }
|
109
109
|
end
|
110
|
-
toc.interwiki(:
|
110
|
+
toc.interwiki(map: interwiki_map).link_classifier
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
@@ -118,7 +118,7 @@ aspect :s5 do
|
|
118
118
|
filter do
|
119
119
|
remove_comments.tag_shortcuts
|
120
120
|
mediawiki_nowiki.tag { mediawiki!.rubypants }
|
121
|
-
toc.interwiki(:
|
121
|
+
toc.interwiki(map: interwiki_map).link_classifier
|
122
122
|
html_wrapper!.s5!
|
123
123
|
end
|
124
124
|
end
|
@@ -129,9 +129,9 @@ aspect :latex do
|
|
129
129
|
mime 'text/plain; charset=utf-8'
|
130
130
|
filter do
|
131
131
|
remove_comments.tag_shortcuts.mediawiki_nowiki
|
132
|
-
tag(:
|
133
|
-
toc.interwiki(:
|
134
|
-
html_wrapper!.xslt!(:
|
132
|
+
tag(static: true) { mediawiki!.rubypants }
|
133
|
+
toc.interwiki(map: interwiki_map)
|
134
|
+
html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
@@ -144,9 +144,9 @@ aspect :page do
|
|
144
144
|
accepts 'text/x-textile'
|
145
145
|
filter do
|
146
146
|
remove_comments.tag_shortcuts.textile_nowiki
|
147
|
-
tag(:
|
147
|
+
tag(disable: 'html:*') { textile!.rubypants }
|
148
148
|
fix_img_tag.toc
|
149
|
-
interwiki(:
|
149
|
+
interwiki(map: interwiki_map).link_classifier
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
@@ -156,9 +156,9 @@ aspect :s5 do
|
|
156
156
|
mime 'application/xhtml+xml; charset=utf-8'
|
157
157
|
filter do
|
158
158
|
remove_comments.tag_shortcuts.textile_nowiki
|
159
|
-
tag(:
|
159
|
+
tag(disable: 'html:*') { textile!.rubypants }
|
160
160
|
fix_img_tag.toc
|
161
|
-
interwiki(:
|
161
|
+
interwiki(map: interwiki_map).link_classifier
|
162
162
|
html_wrapper!.s5!
|
163
163
|
end
|
164
164
|
end
|
@@ -169,9 +169,9 @@ aspect :latex do
|
|
169
169
|
mime 'text/plain; charset=utf-8'
|
170
170
|
filter do
|
171
171
|
remove_comments.tag_shortcuts.textile_nowiki
|
172
|
-
tag(:
|
173
|
-
toc.interwiki(:
|
174
|
-
html_wrapper!.xslt!(:
|
172
|
+
tag(static: true, disable: 'html:*') { textile!.rubypants }
|
173
|
+
toc.interwiki(map: interwiki_map)
|
174
|
+
html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
@@ -185,10 +185,10 @@ aspect :page do
|
|
185
185
|
filter do
|
186
186
|
editsection do
|
187
187
|
remove_comments.tag_shortcuts.markdown_nowiki
|
188
|
-
tag(:
|
188
|
+
tag(disable: 'html:*') { markdown! }
|
189
189
|
end
|
190
190
|
fix_img_tag.toc
|
191
|
-
interwiki(:
|
191
|
+
interwiki(map: interwiki_map).link_classifier
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
@@ -198,9 +198,9 @@ aspect :s5 do
|
|
198
198
|
mime 'application/xhtml+xml; charset=utf-8'
|
199
199
|
filter do
|
200
200
|
remove_comments.tag_shortcuts.markdown_nowiki
|
201
|
-
tag(:
|
201
|
+
tag(disable: 'html:*') { markdown! }
|
202
202
|
fix_img_tag.toc
|
203
|
-
interwiki(:
|
203
|
+
interwiki(map: interwiki_map).link_classifier
|
204
204
|
html_wrapper!.s5!
|
205
205
|
end
|
206
206
|
end
|
@@ -211,9 +211,9 @@ aspect :latex do
|
|
211
211
|
mime 'text/plain; charset=utf-8'
|
212
212
|
filter do
|
213
213
|
remove_comments.tag_shortcuts.markdown_nowiki
|
214
|
-
tag(:
|
215
|
-
toc.interwiki(:
|
216
|
-
html_wrapper!.xslt!(:
|
214
|
+
tag(static: true, disable: 'html:*') { markdown! }
|
215
|
+
toc.interwiki(map: interwiki_map)
|
216
|
+
html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
|
217
217
|
end
|
218
218
|
end
|
219
219
|
|
@@ -228,7 +228,7 @@ aspect :page do
|
|
228
228
|
remove_comments.tag_shortcuts
|
229
229
|
tag { orgmode!.rubypants }
|
230
230
|
fix_img_tag.toc
|
231
|
-
interwiki(:
|
231
|
+
interwiki(map: interwiki_map).link_classifier
|
232
232
|
end
|
233
233
|
end
|
234
234
|
|
@@ -240,7 +240,7 @@ aspect :s5 do
|
|
240
240
|
remove_comments.tag_shortcuts
|
241
241
|
tag { orgmode!.rubypants }
|
242
242
|
fix_img_tag.toc
|
243
|
-
interwiki(:
|
243
|
+
interwiki(map: interwiki_map).link_classifier
|
244
244
|
html_wrapper!.s5!
|
245
245
|
end
|
246
246
|
end
|
@@ -251,8 +251,21 @@ aspect :latex do
|
|
251
251
|
mime 'text/plain; charset=utf-8'
|
252
252
|
filter do
|
253
253
|
remove_comments.tag_shortcuts
|
254
|
-
tag(:
|
255
|
-
toc.interwiki(:
|
256
|
-
html_wrapper!.xslt!(:
|
254
|
+
tag(static: true) { orgmode!.rubypants }
|
255
|
+
toc.interwiki(map: interwiki_map)
|
256
|
+
html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
################################################################################
|
261
|
+
# Remind aspects configuration
|
262
|
+
################################################################################
|
263
|
+
|
264
|
+
aspect :calendar do
|
265
|
+
is_cacheable.needs_layout.has_priority(1)
|
266
|
+
accepts 'text/x-remind'
|
267
|
+
mime 'application/xhtml+xml; charset=utf-8'
|
268
|
+
filter do
|
269
|
+
remind!.html2xml!
|
257
270
|
end
|
258
271
|
end
|
data/config/config.yml.default
CHANGED
@@ -1,29 +1,34 @@
|
|
1
1
|
# Register some mime types
|
2
2
|
|
3
|
-
MimeMagic.add('application/x-empty', :
|
4
|
-
MimeMagic.add('inode/directory', :
|
3
|
+
MimeMagic.add('application/x-empty', comment: 'Empty file')
|
4
|
+
MimeMagic.add('inode/directory', comment: 'Directory')
|
5
5
|
|
6
6
|
MimeMagic.add('text/x-creole',
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
7
|
+
extensions: %w(creole text),
|
8
|
+
parents: 'text/plain',
|
9
|
+
comment: 'Creole Wiki Text File')
|
10
10
|
|
11
11
|
MimeMagic.add('text/x-mediawiki',
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
12
|
+
extensions: %w(mediawiki mw),
|
13
|
+
parents: 'text/plain',
|
14
|
+
comment: 'MediaWiki Text File')
|
15
15
|
|
16
16
|
MimeMagic.add('text/x-markdown',
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
17
|
+
extensions: %w(markdown md mdown mkdn mdown),
|
18
|
+
parents: 'text/plain',
|
19
|
+
comment: 'Markdown Text File')
|
20
20
|
|
21
21
|
MimeMagic.add('text/x-textile',
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
22
|
+
extensions: 'textile',
|
23
|
+
parents: 'text/plain',
|
24
|
+
comment: 'Textile Text File')
|
25
25
|
|
26
26
|
MimeMagic.add('text/x-orgmode',
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
27
|
+
extensions: 'org',
|
28
|
+
parents: 'text/plain',
|
29
|
+
comment: 'Emacs Orgmode File')
|
30
|
+
|
31
|
+
MimeMagic.add('text/x-remind',
|
32
|
+
extensions: 'rem',
|
33
|
+
parents: 'text/plain',
|
34
|
+
comment: 'Remind Calendar File')
|
@@ -1,2 +1,2 @@
|
|
1
|
-
Slim::Engine.set_default_options :
|
2
|
-
:
|
1
|
+
Slim::Engine.set_default_options format: :xhtml,
|
2
|
+
shortcut: {'&' => 'input type', '#' => 'id', '.' => 'class'}
|
data/lib/olelo.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
raise "Your Ruby version is too old (1.9.2 is required)" if RUBY_VERSION < '1.9.2'
|
2
|
-
|
3
1
|
require 'logger'
|
4
2
|
require 'cgi'
|
5
3
|
require 'digest/md5'
|
@@ -9,12 +7,7 @@ require 'set'
|
|
9
7
|
require 'yaml'
|
10
8
|
require 'mimemagic'
|
11
9
|
require 'socket'
|
12
|
-
|
13
|
-
begin
|
14
|
-
require 'yajl/json_gem'
|
15
|
-
rescue LoadError
|
16
|
-
require 'json'
|
17
|
-
end
|
10
|
+
require 'multi_json'
|
18
11
|
|
19
12
|
require 'olelo/html_safe'
|
20
13
|
require 'slim'
|