instiki 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +165 -0
- data/README +68 -172
- data/app/controllers/admin_controller.rb +94 -0
- data/app/controllers/application.rb +131 -0
- data/app/controllers/file_controller.rb +129 -0
- data/app/controllers/wiki_controller.rb +354 -0
- data/{libraries/view_helper.rb → app/helpers/application_helper.rb} +68 -33
- data/app/models/author.rb +3 -3
- data/app/models/chunks/category.rb +33 -31
- data/app/models/chunks/chunk.rb +86 -20
- data/app/models/chunks/engines.rb +54 -38
- data/app/models/chunks/include.rb +41 -29
- data/app/models/chunks/literal.rb +31 -19
- data/app/models/chunks/nowiki.rb +28 -31
- data/app/models/chunks/test.rb +18 -18
- data/app/models/chunks/uri.rb +182 -97
- data/app/models/chunks/wiki.rb +141 -82
- data/app/models/file_yard.rb +58 -0
- data/app/models/page.rb +112 -86
- data/app/models/page_lock.rb +22 -23
- data/app/models/page_set.rb +89 -64
- data/app/models/revision.rb +123 -90
- data/app/models/web.rb +176 -89
- data/app/models/wiki_content.rb +207 -105
- data/app/models/wiki_service.rb +233 -83
- data/app/models/wiki_words.rb +23 -25
- data/app/views/{wiki/new_system.rhtml → admin/create_system.rhtml} +83 -78
- data/app/views/{wiki/new_web.rhtml → admin/create_web.rhtml} +69 -64
- data/app/views/admin/edit_web.rhtml +136 -0
- data/app/views/file/file.rhtml +19 -0
- data/app/views/file/import.rhtml +23 -0
- data/app/views/layouts/default.rhtml +85 -0
- data/app/views/markdown_help.rhtml +12 -16
- data/app/views/mixed_help.rhtml +7 -0
- data/app/views/navigation.rhtml +30 -19
- data/app/views/rdoc_help.rhtml +12 -16
- data/app/views/textile_help.rhtml +24 -28
- data/app/views/wiki/authors.rhtml +11 -13
- data/app/views/wiki/edit.rhtml +39 -31
- data/app/views/wiki/export.rhtml +12 -14
- data/app/views/wiki/feeds.rhtml +14 -10
- data/app/views/wiki/list.rhtml +64 -57
- data/app/views/wiki/locked.rhtml +23 -14
- data/app/views/wiki/login.rhtml +14 -11
- data/app/views/wiki/new.rhtml +31 -27
- data/app/views/wiki/page.rhtml +115 -81
- data/app/views/wiki/print.rhtml +14 -16
- data/app/views/wiki/published.rhtml +9 -10
- data/app/views/wiki/recently_revised.rhtml +27 -30
- data/app/views/wiki/revision.rhtml +103 -81
- data/app/views/wiki/rollback.rhtml +14 -9
- data/app/views/wiki/rss_feed.rhtml +22 -22
- data/app/views/wiki/search.rhtml +38 -15
- data/app/views/wiki/tex.rhtml +22 -22
- data/app/views/wiki/tex_web.rhtml +34 -34
- data/app/views/wiki/web_list.rhtml +18 -13
- data/app/views/wiki_words_help.rhtml +9 -8
- data/config/environment.rb +82 -0
- data/config/environments/development.rb +5 -0
- data/config/environments/production.rb +4 -0
- data/config/environments/test.rb +17 -0
- data/config/routes.rb +18 -0
- data/instiki +6 -67
- data/instiki.rb +3 -0
- data/lib/active_record_stub.rb +31 -0
- data/{libraries/diff → lib}/diff.rb +444 -475
- data/lib/instiki_errors.rb +15 -0
- data/{libraries → lib}/rdocsupport.rb +151 -155
- data/lib/redcloth_for_tex.rb +736 -0
- data/natives/osx/desktop_launcher/AppDelegate.h +18 -0
- data/natives/osx/desktop_launcher/AppDelegate.mm +109 -0
- data/natives/osx/desktop_launcher/Credits.html +16 -0
- data/natives/osx/desktop_launcher/English.lproj/InfoPlist.strings +0 -0
- data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/classes.nib +13 -0
- data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/info.nib +24 -0
- data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/objects.nib +0 -0
- data/natives/osx/desktop_launcher/Info.plist +13 -0
- data/natives/osx/desktop_launcher/Instiki.xcode/project.pbxproj +592 -0
- data/natives/osx/desktop_launcher/Instiki_Prefix.pch +7 -0
- data/natives/osx/desktop_launcher/MakeDMG.sh +9 -0
- data/natives/osx/desktop_launcher/main.mm +14 -0
- data/natives/osx/desktop_launcher/version.plist +16 -0
- data/public/404.html +6 -0
- data/public/500.html +6 -0
- data/public/dispatch.rb +10 -0
- data/public/favicon.ico +0 -0
- data/public/javascripts/edit_web.js +52 -0
- data/public/javascripts/prototype.js +336 -0
- data/{app/views/static_style_sheet.rhtml → public/stylesheets/instiki.css} +221 -198
- data/script/breakpointer +4 -0
- data/script/server +93 -0
- metadata +59 -32
- data/app/controllers/wiki.rb +0 -389
- data/app/models/chunks/match.rb +0 -19
- data/app/views/bottom.rhtml +0 -4
- data/app/views/top.rhtml +0 -49
- data/app/views/wiki/edit_web.rhtml +0 -138
- data/libraries/action_controller_servlet.rb +0 -177
- data/libraries/erb.rb +0 -490
- data/libraries/madeleine_service.rb +0 -68
- data/libraries/redcloth_for_tex.rb +0 -869
- data/libraries/web_controller_server.rb +0 -81
@@ -1,199 +1,222 @@
|
|
1
|
-
#Container {
|
2
|
-
float: none;
|
3
|
-
margin: 0 auto;
|
4
|
-
text-align: center;
|
5
|
-
}
|
6
|
-
|
7
|
-
#Content {
|
8
|
-
margin: 0;
|
9
|
-
padding: 5px;
|
10
|
-
text-align: left;
|
11
|
-
border-top: none;
|
12
|
-
float: left;
|
13
|
-
}
|
14
|
-
|
15
|
-
body { background-color: #fff; color: #333; }
|
16
|
-
|
17
|
-
body, p, ol, ul, td {
|
18
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
19
|
-
font-size: 13px;
|
20
|
-
line-height: 18px;
|
21
|
-
}
|
22
|
-
|
23
|
-
a { color: #000; }
|
24
|
-
|
25
|
-
.newWikiWord { background-color: #eee; }
|
26
|
-
.newWikiWord a:hover { background-color: white; }
|
27
|
-
|
28
|
-
a:visited { color: #666; }
|
29
|
-
a:hover { color: #fff; background-color:#000; }
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
font-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
1
|
+
#Container {
|
2
|
+
float: none;
|
3
|
+
margin: 0 auto;
|
4
|
+
text-align: center;
|
5
|
+
}
|
6
|
+
|
7
|
+
#Content {
|
8
|
+
margin: 0;
|
9
|
+
padding: 5px;
|
10
|
+
text-align: left;
|
11
|
+
border-top: none;
|
12
|
+
float: left;
|
13
|
+
}
|
14
|
+
|
15
|
+
body { background-color: #fff; color: #333; }
|
16
|
+
|
17
|
+
body, p, ol, ul, td {
|
18
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
19
|
+
font-size: 13px;
|
20
|
+
line-height: 18px;
|
21
|
+
}
|
22
|
+
|
23
|
+
a { color: #000; }
|
24
|
+
|
25
|
+
.newWikiWord { background-color: #eee; }
|
26
|
+
.newWikiWord a:hover { background-color: white; }
|
27
|
+
|
28
|
+
a:visited { color: #666; }
|
29
|
+
a:hover { color: #fff; background-color:#000; }
|
30
|
+
|
31
|
+
h1, h2, h3 { color: #333; font-family: georgia, verdana; }
|
32
|
+
h1 { font-size: 28px }
|
33
|
+
h2 { font-size: 19px }
|
34
|
+
h3 { font-size: 16px }
|
35
|
+
|
36
|
+
h1#pageName {
|
37
|
+
margin: 5px 0px 0px 0px;
|
38
|
+
padding: 0px 0px 0px 0px;
|
39
|
+
line-height: 28px;
|
40
|
+
}
|
41
|
+
|
42
|
+
h1#pageName small {
|
43
|
+
color: grey;
|
44
|
+
line-height: 10px;
|
45
|
+
font-size: 10px;
|
46
|
+
padding: 0px;
|
47
|
+
}
|
48
|
+
|
49
|
+
a.nav, a.nav:link, a.nav:visited { color: #000; }
|
50
|
+
a.nav:hover { color: #fff; background-color:#000; }
|
51
|
+
|
52
|
+
li { margin-bottom: 7px }
|
53
|
+
|
54
|
+
.navigation {
|
55
|
+
margin-top: 5px;
|
56
|
+
font-size : 12px;
|
57
|
+
color: #999;
|
58
|
+
}
|
59
|
+
|
60
|
+
.navigation a:hover { color: #fff; background-color:#000; }
|
61
|
+
|
62
|
+
.navigation a {
|
63
|
+
font-size: 11px;
|
64
|
+
color: black;
|
65
|
+
font-weight: bold;
|
66
|
+
}
|
67
|
+
|
68
|
+
.navigation small a {
|
69
|
+
font-weight: normal;
|
70
|
+
font-size: 11px;
|
71
|
+
}
|
72
|
+
|
73
|
+
.navOn{
|
74
|
+
font-size: 11px;
|
75
|
+
color: grey;
|
76
|
+
font-weight: bold;
|
77
|
+
text-decoration: none;
|
78
|
+
}
|
79
|
+
|
80
|
+
.help {
|
81
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
82
|
+
font-size: 11px;
|
83
|
+
}
|
84
|
+
|
85
|
+
.inputBox {
|
86
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
87
|
+
font-size: 11px;
|
88
|
+
background-color: #eee;
|
89
|
+
padding: 5px;
|
90
|
+
margin-bottom: 20px;
|
91
|
+
}
|
92
|
+
|
93
|
+
blockquote {
|
94
|
+
display: block;
|
95
|
+
margin: 0px 0px 20px 0px;
|
96
|
+
padding: 0px 30px;
|
97
|
+
font-size:11px;
|
98
|
+
line-height:17px;
|
99
|
+
font-style: italic;
|
100
|
+
}
|
101
|
+
|
102
|
+
pre {
|
103
|
+
background-color: #eee;
|
104
|
+
padding: 10px;
|
105
|
+
font-size: 11px;
|
106
|
+
}
|
107
|
+
|
108
|
+
ol.setup {
|
109
|
+
font-size: 19px;
|
110
|
+
font-family: georgia, verdana;
|
111
|
+
padding-left: 25px;
|
112
|
+
}
|
113
|
+
|
114
|
+
ol.setup li {
|
115
|
+
margin-bottom: 20px
|
116
|
+
}
|
117
|
+
|
118
|
+
.byline {
|
119
|
+
font-size: 10px;
|
120
|
+
font-style: italic;
|
121
|
+
margin-bottom: 10px;
|
122
|
+
color: #999;
|
123
|
+
}
|
124
|
+
|
125
|
+
.references {
|
126
|
+
font-size: 10px;
|
127
|
+
}
|
128
|
+
|
129
|
+
.diffdel, del.diffmod {
|
130
|
+
background: pink;
|
131
|
+
}
|
132
|
+
|
133
|
+
.diffins, ins.diffmod {
|
134
|
+
background: lightgreen;
|
135
|
+
}
|
136
|
+
|
137
|
+
#footer {
|
138
|
+
height: 14px;
|
139
|
+
padding: .25em 0;
|
140
|
+
}
|
141
|
+
|
142
|
+
#footer p {
|
143
|
+
font-size: 10px;
|
144
|
+
color: gray;
|
145
|
+
font-style: italic;
|
146
|
+
margin: 0;
|
147
|
+
float: right;
|
148
|
+
text-align: right;
|
149
|
+
}
|
150
|
+
|
151
|
+
#error {
|
152
|
+
color: darkred;
|
153
|
+
font-style: italic;
|
154
|
+
width: 600px;
|
155
|
+
}
|
156
|
+
|
157
|
+
#info {
|
158
|
+
color: darkgreen;
|
159
|
+
font-style: italic;
|
160
|
+
width: 600px;
|
161
|
+
}
|
162
|
+
|
163
|
+
#TextileHelp table {
|
164
|
+
margin-bottom: 0;
|
165
|
+
}
|
166
|
+
|
167
|
+
#TextileHelp table+h3 {
|
168
|
+
margin-top: 11px;
|
169
|
+
}
|
170
|
+
|
171
|
+
#TextileHelp table td {
|
172
|
+
font-size: 11px;
|
173
|
+
padding: 3px;
|
174
|
+
vertical-align: top;
|
175
|
+
border-top: 1px dotted #ccc;
|
176
|
+
}
|
177
|
+
|
178
|
+
#TextileHelp table td.arrow {
|
179
|
+
padding-right: 5px;
|
180
|
+
padding-left: 10px;
|
181
|
+
color: #999;
|
182
|
+
}
|
183
|
+
|
184
|
+
#TextileHelp table td.label {
|
185
|
+
font-weight: bold;
|
186
|
+
white-space: nowrap;
|
187
|
+
font-size: 10px;
|
188
|
+
padding-right: 15px;
|
189
|
+
color: #000;
|
190
|
+
}
|
191
|
+
|
192
|
+
#TextileHelp h3 {
|
193
|
+
font-size: 11px;
|
194
|
+
font-weight: bold;
|
195
|
+
font-weight: normal;
|
196
|
+
margin: 0 0 5px 0;
|
197
|
+
padding: 5px 0 0 0;
|
198
|
+
}
|
199
|
+
|
200
|
+
#TextileHelp p {
|
201
|
+
font-size: 10px;
|
202
|
+
}
|
203
|
+
|
204
|
+
.rightHandSide {
|
205
|
+
float: right;
|
206
|
+
width: 147px;
|
207
|
+
margin-left: 10px;
|
208
|
+
padding-left: 20px;
|
209
|
+
border-left: 1px dotted #ccc;
|
210
|
+
}
|
211
|
+
|
212
|
+
.rightHandSide p {
|
213
|
+
font-size: 10px;
|
214
|
+
}
|
215
|
+
|
216
|
+
.newsList {
|
217
|
+
margin-top: 20px;
|
218
|
+
}
|
219
|
+
|
220
|
+
.newsList p {
|
221
|
+
margin-bottom:30px
|
199
222
|
}
|
data/script/breakpointer
ADDED
data/script/server
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require 'webrick'
|
4
|
+
require 'optparse'
|
5
|
+
require 'fileutils'
|
6
|
+
|
7
|
+
pwd = File.expand_path(File.dirname(__FILE__) + "/..")
|
8
|
+
|
9
|
+
OPTIONS = {
|
10
|
+
# Overridable options
|
11
|
+
:port => 2500,
|
12
|
+
:ip => '0.0.0.0',
|
13
|
+
:environment => 'production',
|
14
|
+
:server_root => File.expand_path(File.dirname(__FILE__) + '/../public/'),
|
15
|
+
:server_type => WEBrick::SimpleServer,
|
16
|
+
:storage => "#{File.expand_path(FileUtils.pwd)}/storage",
|
17
|
+
}
|
18
|
+
|
19
|
+
ARGV.options do |opts|
|
20
|
+
script_name = File.basename($0)
|
21
|
+
opts.banner = "Usage: ruby #{script_name} [options]"
|
22
|
+
|
23
|
+
opts.separator ''
|
24
|
+
|
25
|
+
opts.on('-p', '--port=port', Integer,
|
26
|
+
'Runs Instiki on the specified port.',
|
27
|
+
'Default: 2500') { |OPTIONS[:port]| }
|
28
|
+
opts.on('-b', '--binding=ip', String,
|
29
|
+
'Binds Rails to the specified ip.',
|
30
|
+
'Default: 0.0.0.0') { |OPTIONS[:ip]| }
|
31
|
+
opts.on('-e', '--environment=name', String,
|
32
|
+
'Specifies the environment to run this server under (test/development/production).',
|
33
|
+
'Default: production') { |OPTIONS[:environment]| }
|
34
|
+
opts.on('-d', '--daemon',
|
35
|
+
'Make Instiki run as a Daemon (only works if fork is available -- meaning on *nix).'
|
36
|
+
) { OPTIONS[:server_type] = WEBrick::Daemon }
|
37
|
+
opts.on('-s', '--simple', '--simple-server',
|
38
|
+
'[deprecated] Forces Instiki not to run as a Daemon if fork is available.',
|
39
|
+
'Since version 0.10.0 this option is ignored.'
|
40
|
+
) { puts "Warning: -s (--simple) option is deprecated. See instiki --help for details." }
|
41
|
+
opts.on('-t', '--storage=storage', String,
|
42
|
+
'Makes Instiki use the specified directory for storage.',
|
43
|
+
'Default: ./storage/[port]') { |OPTIONS[:storage]| }
|
44
|
+
opts.on('-x', '--notex',
|
45
|
+
'Blocks wiki exports to TeX and PDF, even when pdflatex is available.'
|
46
|
+
) { |OPTIONS[:notex]| }
|
47
|
+
opts.on('-v', '--verbose',
|
48
|
+
'Enables debug-level logging'
|
49
|
+
) { OPTIONS[:verbose] = true }
|
50
|
+
|
51
|
+
opts.separator ''
|
52
|
+
|
53
|
+
opts.on('-h', '--help',
|
54
|
+
'Show this help message.') { puts opts; exit }
|
55
|
+
|
56
|
+
opts.parse!
|
57
|
+
end
|
58
|
+
|
59
|
+
if OPTIONS[:environment] == 'production'
|
60
|
+
storage_path = "#{OPTIONS[:storage]}/#{OPTIONS[:port]}"
|
61
|
+
else
|
62
|
+
storage_path = "#{OPTIONS[:storage]}/#{OPTIONS[:environment]}/#{OPTIONS[:port]}"
|
63
|
+
end
|
64
|
+
FileUtils.mkdir_p(storage_path)
|
65
|
+
|
66
|
+
ENV['RAILS_ENV'] = OPTIONS[:environment]
|
67
|
+
INSTIKI_DEBUG_LOG = OPTIONS[:verbose]
|
68
|
+
require File.expand_path(File.dirname(__FILE__) + '/../config/environment')
|
69
|
+
WikiService.storage_path = storage_path
|
70
|
+
|
71
|
+
if OPTIONS[:notex]
|
72
|
+
OPTIONS[:pdflatex] = false
|
73
|
+
else
|
74
|
+
begin
|
75
|
+
OPTIONS[:pdflatex] = system "pdflatex -version"
|
76
|
+
rescue Errno::ENOENT
|
77
|
+
OPTIONS[:pdflatex] = false
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
if defined? INSTIKI_BATCH_JOB
|
82
|
+
require 'application'
|
83
|
+
else
|
84
|
+
puts "=> Starting Instiki on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
|
85
|
+
puts "=> Data files are stored in #{storage_path}"
|
86
|
+
|
87
|
+
require 'webrick_server'
|
88
|
+
require_dependency 'application'
|
89
|
+
|
90
|
+
OPTIONS[:index_controller] = 'wiki'
|
91
|
+
ApplicationController.wiki = WikiService.instance
|
92
|
+
DispatchServlet.dispatch(OPTIONS)
|
93
|
+
end
|