gollum 1.4.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gollum might be problematic. Click here for more details.
- data/README.md +13 -0
- data/gollum.gemspec +3 -3
- data/lib/gollum.rb +1 -1
- data/lib/gollum/frontend/app.rb +1 -0
- data/lib/gollum/frontend/public/gollum/css/editor.css +14 -21
- data/lib/gollum/frontend/public/gollum/css/gollum.css +39 -21
- data/lib/gollum/frontend/public/gollum/css/template.css +16 -15
- data/lib/gollum/frontend/templates/compare.mustache +13 -3
- data/lib/gollum/frontend/templates/editor.mustache +0 -0
- data/lib/gollum/frontend/templates/history.mustache +4 -2
- data/lib/gollum/frontend/templates/layout.mustache +0 -0
- data/lib/gollum/frontend/templates/page.mustache +3 -1
- data/lib/gollum/frontend/templates/pages.mustache +3 -1
- data/lib/gollum/frontend/templates/search.mustache +3 -1
- data/lib/gollum/markup.rb +5 -1
- data/lib/gollum/page.rb +2 -24
- data/lib/gollum/sanitization.rb +6 -6
- data/test/test_committer.rb +2 -2
- data/test/test_markup.rb +20 -0
- data/test/test_page.rb +4 -4
- metadata +10 -10
data/README.md
CHANGED
@@ -311,6 +311,7 @@ backticks.
|
|
311
311
|
|
312
312
|
## MATHEMATICAL EQUATIONS
|
313
313
|
|
314
|
+
|
314
315
|
Page files may contain mathematic equations in TeX syntax that will be nicely
|
315
316
|
typeset into the expected output. A block-style equation is delimited by `\[`
|
316
317
|
and `\]`. For example:
|
@@ -322,6 +323,13 @@ inline with regular text. For example:
|
|
322
323
|
|
323
324
|
The Pythagorean theorem is \( a^2 + b^2 = c^2 \).
|
324
325
|
|
326
|
+
### INSTALLATION REQUIREMENTS
|
327
|
+
|
328
|
+
In order to get the mathematical equations rendering to work, you need the following binaries:
|
329
|
+
|
330
|
+
* LaText, TeTex or MacTex/BasicTeX (latex, dvips)
|
331
|
+
* ImageMagick (convert)
|
332
|
+
* Ghostscript (gs)
|
325
333
|
|
326
334
|
## SEQUENCE DIAGRAMS
|
327
335
|
|
@@ -454,9 +462,14 @@ like Rack::Auth, OmniAuth, etc.
|
|
454
462
|
require 'gollum/frontend/app'
|
455
463
|
|
456
464
|
gollum_path = File.expand_path(File.dirname(__FILE__)) # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO
|
465
|
+
Precious::App.set(:gollum_path, gollum_path)
|
457
466
|
Precious::App.set(:default_markup, :markdown) # set your favorite markup language
|
458
467
|
run Precious::App
|
459
468
|
|
469
|
+
## Testing
|
470
|
+
|
471
|
+
[![Build Status](https://secure.travis-ci.org/github/gollum.png?branch=master)](http://travis-ci.org/github/gollum)
|
472
|
+
|
460
473
|
## CONTRIBUTE
|
461
474
|
|
462
475
|
If you'd like to hack on Gollum, start by forking my repo on GitHub:
|
data/gollum.gemspec
CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.rubygems_version = '1.3.5'
|
5
5
|
|
6
6
|
s.name = 'gollum'
|
7
|
-
s.version = '
|
8
|
-
s.date = '2012-
|
7
|
+
s.version = '2.0.0'
|
8
|
+
s.date = '2012-05-06'
|
9
9
|
s.rubyforge_project = 'gollum'
|
10
10
|
|
11
11
|
s.summary = "A simple, Git-powered wiki."
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_development_dependency('org-ruby', '~>0.6.2')
|
38
38
|
s.add_development_dependency('shoulda')
|
39
39
|
s.add_development_dependency('rack-test')
|
40
|
-
s.add_development_dependency('wikicloth', '~>
|
40
|
+
s.add_development_dependency('wikicloth', '~>0.8.0')
|
41
41
|
s.add_development_dependency('rake', '~> 0.9.2')
|
42
42
|
|
43
43
|
# = MANIFEST =
|
data/lib/gollum.rb
CHANGED
@@ -21,7 +21,7 @@ require File.expand_path('../gollum/tex', __FILE__)
|
|
21
21
|
require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
22
22
|
|
23
23
|
module Gollum
|
24
|
-
VERSION = '
|
24
|
+
VERSION = '2.0.0'
|
25
25
|
|
26
26
|
def self.assets_path
|
27
27
|
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
data/lib/gollum/frontend/app.rb
CHANGED
@@ -30,6 +30,7 @@ a {
|
|
30
30
|
-webkit-border-radius: 1em;
|
31
31
|
}
|
32
32
|
|
33
|
+
.ff #gollum-editor,
|
33
34
|
.ie #gollum-editor {
|
34
35
|
padding-bottom: 1em;
|
35
36
|
}
|
@@ -51,9 +52,9 @@ a {
|
|
51
52
|
background: #fff;
|
52
53
|
border: 1px solid #ddd;
|
53
54
|
color: #000;
|
54
|
-
font-size: 1.
|
55
|
+
font-size: 1.1em;
|
55
56
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
56
|
-
line-height: 1.
|
57
|
+
line-height: 1.5em;
|
57
58
|
margin: 1em 0 0.4em;
|
58
59
|
padding: 0.5em;
|
59
60
|
width: 98%;
|
@@ -192,44 +193,36 @@ a#function-help:hover span { background-position: -405px -28px; }
|
|
192
193
|
|
193
194
|
#gollum-editor #gollum-editor-function-bar #gollum-editor-format-selector {
|
194
195
|
overflow: hidden;
|
195
|
-
padding:
|
196
|
+
padding: .2em 0 .5em 0;
|
196
197
|
}
|
197
198
|
|
198
199
|
#gollum-editor #gollum-editor-function-bar
|
199
200
|
#gollum-editor-format-selector select {
|
200
201
|
background-color: #f9f9f9;
|
201
|
-
border: 1px solid
|
202
|
+
border: 1px solid #ddd;
|
203
|
+
color: #333;
|
202
204
|
|
203
205
|
float: right;
|
204
|
-
font-size:
|
206
|
+
font-size: 1em;
|
205
207
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
206
208
|
font-weight: bold;
|
207
209
|
line-height: 1.6em;
|
208
|
-
padding: 0.
|
209
|
-
margin-bottom: 0;
|
210
|
+
padding: 0.3em 0.4em;
|
210
211
|
|
211
212
|
|
212
213
|
border-radius: 0.5em;
|
213
214
|
-moz-border-radius: 0.5em;
|
214
215
|
-webkit-border-radius: 0.5em;
|
215
|
-
-moz-outline: none;
|
216
|
-
}
|
217
|
-
|
218
|
-
#gollum-editor #gollum-editor-function-bar
|
219
|
-
#gollum-editor-format-selector select:hover {
|
220
|
-
background-color: #fff;
|
221
|
-
border: 1px solid #ddd;
|
222
|
-
-moz-outline: none;
|
223
216
|
}
|
224
217
|
|
225
218
|
#gollum-editor #gollum-editor-function-bar
|
226
219
|
#gollum-editor-format-selector label {
|
227
220
|
color: #999;
|
228
221
|
float: right;
|
229
|
-
font-size:
|
222
|
+
font-size: 1em;
|
230
223
|
font-weight: bold;
|
231
224
|
line-height: 1.6em;
|
232
|
-
padding:
|
225
|
+
padding: .3em 0.5em 0 0;
|
233
226
|
}
|
234
227
|
|
235
228
|
#gollum-editor #gollum-editor-function-bar
|
@@ -243,9 +236,9 @@ a#function-help:hover span { background-position: -405px -28px; }
|
|
243
236
|
#gollum-editor textarea#gollum-editor-body {
|
244
237
|
background: #fff;
|
245
238
|
border: 1px solid #ddd;
|
246
|
-
font-size:
|
239
|
+
font-size: 1em;
|
247
240
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
248
|
-
line-height: 1.
|
241
|
+
line-height: 1.4em;
|
249
242
|
margin: 1em 0 0.4em;
|
250
243
|
padding: 0.5em; /* I don't really like mixing pct & em here… */
|
251
244
|
width: 98%;
|
@@ -259,7 +252,7 @@ a#function-help:hover span { background-position: -405px -28px; }
|
|
259
252
|
cursor: pointer;
|
260
253
|
display: block;
|
261
254
|
float: left;
|
262
|
-
font-size:
|
255
|
+
font-size: 1em;
|
263
256
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
264
257
|
font-weight: bold;
|
265
258
|
margin: 0;
|
@@ -403,7 +396,7 @@ a#function-help:hover span { background-position: -405px -28px; }
|
|
403
396
|
color: #333;
|
404
397
|
cursor: pointer;
|
405
398
|
display: block;
|
406
|
-
font-size:
|
399
|
+
font-size: 1em;
|
407
400
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
408
401
|
font-weight: bold;
|
409
402
|
line-height: 1.2em;
|
@@ -37,13 +37,13 @@ a:hover, a:visited {
|
|
37
37
|
|
38
38
|
/* @section head */
|
39
39
|
#head {
|
40
|
+
border-bottom: 1px solid #ddd;
|
40
41
|
margin: 4.5em 0 0.5em;
|
41
|
-
padding: 0.5em 0;
|
42
42
|
overflow: hidden;
|
43
43
|
}
|
44
44
|
|
45
45
|
#head h1 {
|
46
|
-
|
46
|
+
display: none;
|
47
47
|
}
|
48
48
|
|
49
49
|
#head ul.actions {
|
@@ -142,6 +142,7 @@ a:hover, a:visited {
|
|
142
142
|
}
|
143
143
|
|
144
144
|
/* @section footer */
|
145
|
+
|
145
146
|
#wiki-footer {
|
146
147
|
clear: both;
|
147
148
|
margin: 2em 0 5em;
|
@@ -208,6 +209,7 @@ a:hover, a:visited {
|
|
208
209
|
|
209
210
|
/* @section page-footer */
|
210
211
|
.page #footer {
|
212
|
+
border-top: 1px solid #ddd;
|
211
213
|
margin: 1em 0 7em;
|
212
214
|
}
|
213
215
|
|
@@ -235,12 +237,12 @@ a:hover, a:visited {
|
|
235
237
|
}
|
236
238
|
|
237
239
|
#wiki-history {
|
238
|
-
margin-top:
|
240
|
+
margin-top: 2em;
|
239
241
|
}
|
240
242
|
|
241
243
|
#wiki-history fieldset {
|
242
244
|
border: 0;
|
243
|
-
margin:
|
245
|
+
margin: 1em 0;
|
244
246
|
padding: 0;
|
245
247
|
}
|
246
248
|
|
@@ -262,14 +264,14 @@ a:hover, a:visited {
|
|
262
264
|
|
263
265
|
#wiki-history table tr td {
|
264
266
|
border: 1px solid #c0dce9;
|
265
|
-
font-size:
|
267
|
+
font-size: 1em;
|
266
268
|
line-height: 1.6em;
|
267
269
|
margin: 0;
|
268
270
|
padding: 0.3em 0.7em;
|
269
271
|
}
|
270
272
|
|
271
273
|
#wiki-history table tr td.checkbox {
|
272
|
-
|
274
|
+
width: 4em;
|
273
275
|
padding: 0.3em;
|
274
276
|
}
|
275
277
|
|
@@ -278,7 +280,9 @@ a:hover, a:visited {
|
|
278
280
|
display: block;
|
279
281
|
padding-right: 0;
|
280
282
|
padding-top: 0.4em;
|
281
|
-
margin
|
283
|
+
margin: 0 auto;
|
284
|
+
width: 1.2em;
|
285
|
+
height: 1.2em;
|
282
286
|
}
|
283
287
|
|
284
288
|
#wiki-history table tr:nth-child(2n),
|
@@ -331,6 +335,10 @@ a:hover, a:visited {
|
|
331
335
|
padding: 0 0.2em;
|
332
336
|
}
|
333
337
|
|
338
|
+
.history #footer {
|
339
|
+
margin-bottom: 7em;
|
340
|
+
}
|
341
|
+
|
334
342
|
.history #wiki-history ul.actions li,
|
335
343
|
.history #footer ul.actions li {
|
336
344
|
margin: 0 0.6em 0 0;
|
@@ -410,10 +418,14 @@ a:hover, a:visited {
|
|
410
418
|
|
411
419
|
.compare .data {
|
412
420
|
border: 1px solid #ddd;
|
413
|
-
margin
|
421
|
+
margin: 1em 0 2em;
|
414
422
|
overflow: auto;
|
415
423
|
}
|
416
424
|
|
425
|
+
.compare .data table {
|
426
|
+
width: 100%;
|
427
|
+
}
|
428
|
+
|
417
429
|
.compare .data pre {
|
418
430
|
margin: 0;
|
419
431
|
padding: 0;
|
@@ -426,11 +438,15 @@ a:hover, a:visited {
|
|
426
438
|
.compare .data tr td {
|
427
439
|
font-family: "Consolas", "Monaco", "Andale Mono", "Courier New", monospace;
|
428
440
|
font-size: 1.2em;
|
429
|
-
line-height: 1.
|
441
|
+
line-height: 1.2em;
|
430
442
|
margin: 0;
|
431
443
|
padding: 0;
|
432
444
|
}
|
433
445
|
|
446
|
+
.compare .data tr td + td + td {
|
447
|
+
width: 100%;
|
448
|
+
}
|
449
|
+
|
434
450
|
.compare .data td.line_numbers {
|
435
451
|
background: #f7f7f7;
|
436
452
|
border-right: 1px solid #999;
|
@@ -444,6 +460,10 @@ a:hover, a:visited {
|
|
444
460
|
margin-right: 0.6em;
|
445
461
|
}
|
446
462
|
|
463
|
+
.compare #footer {
|
464
|
+
margin-bottom: 7em;
|
465
|
+
}
|
466
|
+
|
447
467
|
|
448
468
|
|
449
469
|
/* @control syntax */
|
@@ -481,8 +501,9 @@ ul.actions {
|
|
481
501
|
|
482
502
|
ul.actions li {
|
483
503
|
float: left;
|
484
|
-
font-size:
|
504
|
+
font-size: 0.9em;
|
485
505
|
margin-left: 0.6em;
|
506
|
+
margin-bottom: 0.6em;
|
486
507
|
}
|
487
508
|
|
488
509
|
.minibutton a {
|
@@ -586,7 +607,6 @@ ul.actions {
|
|
586
607
|
/* @control searchbar */
|
587
608
|
#head #searchbar {
|
588
609
|
float: right;
|
589
|
-
margin: 1em 0 0 0;
|
590
610
|
padding: 0;
|
591
611
|
overflow: hidden;
|
592
612
|
}
|
@@ -595,6 +615,7 @@ ul.actions {
|
|
595
615
|
background: #fff;
|
596
616
|
border: 1px solid #d4d4d4;
|
597
617
|
overflow: hidden;
|
618
|
+
height: 2.2em;
|
598
619
|
|
599
620
|
border-radius: 0.3em;
|
600
621
|
-moz-border-radius: 0.3em;
|
@@ -606,18 +627,15 @@ ul.actions {
|
|
606
627
|
color: #000;
|
607
628
|
float: left;
|
608
629
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
609
|
-
font-size:
|
610
|
-
height:
|
630
|
+
font-size: 1em;
|
631
|
+
height: inherit;
|
632
|
+
padding: 0 .5em;
|
611
633
|
|
612
634
|
-webkit-focus-ring: none;
|
613
635
|
}
|
614
636
|
|
615
|
-
.
|
616
|
-
padding: 0.
|
617
|
-
}
|
618
|
-
|
619
|
-
.ie #head #searchbar #searchbar-fauxtext input#search-query {
|
620
|
-
padding: 0.4em 0 0 0.5em;
|
637
|
+
.ie8 #head #searchbar #searchbar-fauxtext input#search-query {
|
638
|
+
padding: 0.5em 0 0 0.5em;
|
621
639
|
}
|
622
640
|
|
623
641
|
#head #searchbar #searchbar-fauxtext input#search-query.ph {
|
@@ -631,7 +649,7 @@ ul.actions {
|
|
631
649
|
margin: 0 !important;
|
632
650
|
padding: 0;
|
633
651
|
float: right;
|
634
|
-
|
652
|
+
height: inherit;
|
635
653
|
|
636
654
|
border-radius: 0 3px 3px 0;
|
637
655
|
-moz-border-radius: 0 3px 3px 0;
|
@@ -643,7 +661,7 @@ ul.actions {
|
|
643
661
|
background-position: -431px -1px;
|
644
662
|
background-repeat: no-repeat;
|
645
663
|
display: block;
|
646
|
-
height:
|
664
|
+
height: inherit;
|
647
665
|
overflow: hidden;
|
648
666
|
text-indent: -5000px;
|
649
667
|
width: 28px;
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
html, body {
|
13
|
-
color:
|
13
|
+
color: #333;
|
14
14
|
}
|
15
15
|
|
16
16
|
body {
|
@@ -24,7 +24,7 @@ img {
|
|
24
24
|
|
25
25
|
#template {
|
26
26
|
font-size: 14px;
|
27
|
-
line-height: 1.
|
27
|
+
line-height: 1.6;
|
28
28
|
margin-bottom: 40px;
|
29
29
|
}
|
30
30
|
|
@@ -35,7 +35,7 @@ a.absent {
|
|
35
35
|
|
36
36
|
/* Primary Body Copy */
|
37
37
|
#template p {
|
38
|
-
margin:
|
38
|
+
margin: 1.4em 0;
|
39
39
|
padding: 0;
|
40
40
|
}
|
41
41
|
|
@@ -52,17 +52,17 @@ a.absent {
|
|
52
52
|
}
|
53
53
|
|
54
54
|
#template h1 {
|
55
|
-
|
56
|
-
font-size: 33px; /* was 32, GH is 33px */
|
55
|
+
font-size: 28px;
|
57
56
|
line-height: normal;
|
58
|
-
padding:
|
59
|
-
margin: 0;
|
57
|
+
padding: 10px 0 0 0;
|
58
|
+
margin: 30px 0 10px;
|
60
59
|
}
|
61
60
|
|
62
61
|
#template h2 {
|
62
|
+
border-bottom: 1px solid #ddd;
|
63
63
|
font-size: 22px;
|
64
|
-
line-height:
|
65
|
-
margin: 22px 0
|
64
|
+
line-height: 1.6;
|
65
|
+
margin: 22px 0 10px;
|
66
66
|
padding: 7px 0 0;
|
67
67
|
}
|
68
68
|
|
@@ -110,16 +110,16 @@ a.absent {
|
|
110
110
|
/* Border Reset for headers with horizontal rules */
|
111
111
|
#template > h2:first-child,
|
112
112
|
#template > h1:first-child {
|
113
|
-
margin: 12px 0
|
114
|
-
padding: 10px 0
|
113
|
+
margin: 12px 0 10px;
|
114
|
+
padding: 10px 0 10px;
|
115
115
|
}
|
116
116
|
|
117
117
|
|
118
118
|
/* Lists, Blockquotes & Such */
|
119
119
|
#template ul,
|
120
120
|
#template ol {
|
121
|
-
margin
|
122
|
-
|
121
|
+
margin: 15px 0;
|
122
|
+
padding-left: 30px;
|
123
123
|
}
|
124
124
|
|
125
125
|
/* Nested Lists */
|
@@ -132,7 +132,7 @@ a.absent {
|
|
132
132
|
#template ul ul,
|
133
133
|
#template ol ol {
|
134
134
|
padding: 0;
|
135
|
-
margin:
|
135
|
+
margin: 15px 0;
|
136
136
|
}
|
137
137
|
|
138
138
|
#template dl {
|
@@ -286,7 +286,7 @@ a.absent {
|
|
286
286
|
background-color: #f8f8f8;
|
287
287
|
border: 1px solid #dedede;
|
288
288
|
font-size: 13px;
|
289
|
-
padding:
|
289
|
+
padding: 1px 5px;
|
290
290
|
|
291
291
|
-moz-border-radius: 3px;
|
292
292
|
-webkit-border-radius: 3px;
|
@@ -313,6 +313,7 @@ pre, code {
|
|
313
313
|
#template pre code, #template pre tt {
|
314
314
|
background-color: transparent;
|
315
315
|
border: none;
|
316
|
+
padding: 0;
|
316
317
|
}
|
317
318
|
|
318
319
|
/*
|
@@ -3,10 +3,16 @@
|
|
3
3
|
<h1>History for <strong>{{path}}</strong></h1>
|
4
4
|
|
5
5
|
<ul class="actions">
|
6
|
+
<li class="minibutton">
|
7
|
+
{{>searchbar}}
|
8
|
+
</li>
|
9
|
+
<li class="minibutton"><a href="/{{escaped_name}}"
|
10
|
+
class="action-view-page">View Page</a></li>
|
11
|
+
<li class="minibutton"><a href="/edit/{{escaped_name}}"
|
12
|
+
class="action-edit-page">Edit Page</a></li>
|
6
13
|
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
7
|
-
class="action-page-history">
|
14
|
+
class="action-page-history">Page History</a></li>
|
8
15
|
</ul>
|
9
|
-
{{>searchbar}}
|
10
16
|
</div>
|
11
17
|
|
12
18
|
{{#message}}
|
@@ -17,6 +23,8 @@
|
|
17
23
|
|
18
24
|
{{#show_revert}}
|
19
25
|
<ul class="actions">
|
26
|
+
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
27
|
+
class="action-page-history">Back to Page History</a></li>
|
20
28
|
<li class="minibutton">
|
21
29
|
<form name="gollum-revert" action="/revert/{{escaped_name}}/{{before}}/{{after}}" method="post" id="gollum-revert-form">
|
22
30
|
<a href="#" class="gollum-revert-button">Revert Changes</a>
|
@@ -41,6 +49,8 @@
|
|
41
49
|
</div>
|
42
50
|
<div id="footer">
|
43
51
|
<ul class="actions">
|
52
|
+
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
53
|
+
class="action-page-history">Back to Page History</a></li>
|
44
54
|
{{#show_revert}}
|
45
55
|
<li class="minibutton">
|
46
56
|
<a href="#" class="gollum-revert-button">Revert Changes</a>
|
@@ -50,4 +60,4 @@
|
|
50
60
|
</ul>
|
51
61
|
</div>
|
52
62
|
</div>
|
53
|
-
</div>
|
63
|
+
</div>
|
File without changes
|
@@ -2,12 +2,14 @@
|
|
2
2
|
<div id="head">
|
3
3
|
<h1>History for <strong>{{title}}</strong></h1>
|
4
4
|
<ul class="actions">
|
5
|
+
<li class="minibutton">
|
6
|
+
{{>searchbar}}
|
7
|
+
</li>
|
5
8
|
<li class="minibutton"><a href="/{{escaped_name}}"
|
6
9
|
class="action-view-page">View Page</a></li>
|
7
10
|
<li class="minibutton"><a href="/edit/{{escaped_name}}"
|
8
11
|
class="action-edit-page">Edit Page</a></li>
|
9
12
|
</ul>
|
10
|
-
{{>searchbar}}
|
11
13
|
</div>
|
12
14
|
<div id="wiki-history">
|
13
15
|
|
@@ -57,4 +59,4 @@
|
|
57
59
|
class="action-back-to-top">Back to Top</a></li>
|
58
60
|
</ul>
|
59
61
|
</div>
|
60
|
-
</div>
|
62
|
+
</div>
|
File without changes
|
@@ -2,6 +2,9 @@
|
|
2
2
|
<div id="head">
|
3
3
|
<h1>{{title}}</h1>
|
4
4
|
<ul class="actions">
|
5
|
+
<li class="minibutton">
|
6
|
+
{{>searchbar}}
|
7
|
+
</li>
|
5
8
|
<li class="minibutton"><a href="/pages"
|
6
9
|
class="action-all-pages">All Pages</a></li>
|
7
10
|
<li class="minibutton" class="jaws">
|
@@ -13,7 +16,6 @@
|
|
13
16
|
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
14
17
|
class="action-page-history">Page History</a></li>
|
15
18
|
</ul>
|
16
|
-
{{>searchbar}}
|
17
19
|
</div>
|
18
20
|
<div id="wiki-content">
|
19
21
|
<div class="wrap {{#has_footer}} has-footer {{/has_footer}} {{#has_sidebar}} has-rightbar{{/has_sidebar}}">
|
@@ -2,10 +2,12 @@
|
|
2
2
|
<div id="head">
|
3
3
|
<h1>Search Results for <strong>{{query}}</strong></h1>
|
4
4
|
<ul class="actions">
|
5
|
+
<li class="minibutton">
|
6
|
+
{{>searchbar}}
|
7
|
+
</li>
|
5
8
|
<li class="minibutton"><a href="/"
|
6
9
|
class="action-edit-page">Home</a></li>
|
7
10
|
</ul>
|
8
|
-
{{>searchbar}}
|
9
11
|
</div>
|
10
12
|
<div id="results">
|
11
13
|
|
data/lib/gollum/markup.rb
CHANGED
@@ -38,8 +38,9 @@ module Gollum
|
|
38
38
|
@wiki.history_sanitizer :
|
39
39
|
@wiki.sanitizer
|
40
40
|
|
41
|
-
data =
|
41
|
+
data = @data.dup
|
42
42
|
data = extract_code(data)
|
43
|
+
data = extract_tex(data)
|
43
44
|
data = extract_wsd(data)
|
44
45
|
data = extract_tags(data)
|
45
46
|
begin
|
@@ -116,6 +117,9 @@ module Gollum
|
|
116
117
|
#
|
117
118
|
# Returns the placeholder'd String data.
|
118
119
|
def extract_tags(data)
|
120
|
+
if @format == :asciidoc
|
121
|
+
return data
|
122
|
+
end
|
119
123
|
data.gsub!(/(.?)\[\[(.+?)\]\]([^\[]?)/m) do
|
120
124
|
if $1 == "'" && $3 != "'"
|
121
125
|
"[[#{$2}]]#{$3}"
|
data/lib/gollum/page.rb
CHANGED
@@ -124,35 +124,13 @@ module Gollum
|
|
124
124
|
self.class.canonicalize_filename(filename)
|
125
125
|
end
|
126
126
|
|
127
|
-
# Public:
|
128
|
-
# be considered the title of the page and used in the display. If the
|
129
|
-
# first element is NOT an <h1> tag, the title will be constructed from the
|
127
|
+
# Public: The title will be constructed from the
|
130
128
|
# filename by stripping the extension and replacing any dashes with
|
131
129
|
# spaces.
|
132
130
|
#
|
133
131
|
# Returns the fully sanitized String title.
|
134
132
|
def title
|
135
|
-
|
136
|
-
|
137
|
-
header =
|
138
|
-
case self.format
|
139
|
-
when :asciidoc
|
140
|
-
doc.css("div#gollum-root > div#header > h1:first-child")
|
141
|
-
when :org
|
142
|
-
doc.css("div#gollum-root > p.title:first-child")
|
143
|
-
when :pod
|
144
|
-
doc.css("div#gollum-root > a.dummyTopAnchor:first-child + h1")
|
145
|
-
when :rest
|
146
|
-
doc.css("div#gollum-root > div > div > h1:first-child")
|
147
|
-
else
|
148
|
-
doc.css("div#gollum-root > h1:first-child")
|
149
|
-
end
|
150
|
-
|
151
|
-
if !header.empty?
|
152
|
-
Sanitize.clean(header.to_html)
|
153
|
-
else
|
154
|
-
Sanitize.clean(name)
|
155
|
-
end.strip
|
133
|
+
header = Sanitize.clean(name).strip
|
156
134
|
end
|
157
135
|
|
158
136
|
# Public: The path of the page within the repo.
|
data/lib/gollum/sanitization.rb
CHANGED
@@ -43,7 +43,7 @@ module Gollum
|
|
43
43
|
|
44
44
|
# Default whitelisted protocols for URLs.
|
45
45
|
PROTOCOLS = {
|
46
|
-
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', :relative]},
|
46
|
+
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', 'apt', :relative]},
|
47
47
|
'img' => {'src' => ['http', 'https', :relative]}
|
48
48
|
}.freeze
|
49
49
|
|
@@ -120,12 +120,12 @@ module Gollum
|
|
120
120
|
attr_writer :allow_comments
|
121
121
|
|
122
122
|
def initialize
|
123
|
-
@elements = ELEMENTS
|
124
|
-
@attributes = ATTRIBUTES
|
125
|
-
@protocols = PROTOCOLS
|
126
|
-
@transformers = TRANSFORMERS
|
123
|
+
@elements = ELEMENTS.dup
|
124
|
+
@attributes = ATTRIBUTES.dup
|
125
|
+
@protocols = PROTOCOLS.dup
|
126
|
+
@transformers = TRANSFORMERS.dup
|
127
127
|
@add_attributes = {}
|
128
|
-
@remove_contents = REMOVE_CONTENTS
|
128
|
+
@remove_contents = REMOVE_CONTENTS.dup
|
129
129
|
@allow_comments = false
|
130
130
|
@id_prefix = 'wiki-'
|
131
131
|
yield self if block_given?
|
data/test/test_committer.rb
CHANGED
@@ -8,8 +8,8 @@ context "Wiki" do
|
|
8
8
|
|
9
9
|
test "normalizes commit hash" do
|
10
10
|
commit = {:message => 'abc'}
|
11
|
-
name = @wiki.repo.config['user.name']
|
12
|
-
email = @wiki.repo.config['user.email']
|
11
|
+
name = @wiki.repo.config['user.name'] || @wiki.default_committer_name
|
12
|
+
email = @wiki.repo.config['user.email'] || @wiki.default_committer_email
|
13
13
|
committer = Gollum::Committer.new(@wiki, commit)
|
14
14
|
assert_equal name, committer.actor.name
|
15
15
|
assert_equal email, committer.actor.email
|
data/test/test_markup.rb
CHANGED
@@ -495,6 +495,13 @@ np.array([[2,2],[1,3]],np.float)
|
|
495
495
|
compare(content, output)
|
496
496
|
end
|
497
497
|
|
498
|
+
test "allows apt uri schemes" do
|
499
|
+
content = "[Hack me](apt:gettext)"
|
500
|
+
output = "<p><a href=\"apt:gettext\">Hackme</a></p>"
|
501
|
+
compare(content, output)
|
502
|
+
end
|
503
|
+
|
504
|
+
|
498
505
|
test "removes style blocks completely" do
|
499
506
|
content = "<style>body { color: red }</style>foobar"
|
500
507
|
output = "<p>foobar</p>"
|
@@ -588,6 +595,19 @@ np.array([[2,2],[1,3]],np.float)
|
|
588
595
|
compare(content, output, 'md')
|
589
596
|
end
|
590
597
|
|
598
|
+
#########################################################################
|
599
|
+
# Asciidoc
|
600
|
+
#########################################################################
|
601
|
+
|
602
|
+
test "asciidoc header" do
|
603
|
+
compare("= Book Title\n\n== Heading", '<div class="sect1"><h2 id="wiki-_heading">Heading</h2><div class="sectionbody"></div></div>', 'asciidoc')
|
604
|
+
end
|
605
|
+
|
606
|
+
test "internal links with asciidoc" do
|
607
|
+
compare("= Book Title\n\n[[anid]]\n== Heading", '<div class="sect1"><h2 id="wiki-anid">Heading</h2><div class="sectionbody"></div></div>', 'asciidoc')
|
608
|
+
end
|
609
|
+
|
610
|
+
|
591
611
|
#########################################################################
|
592
612
|
#
|
593
613
|
# Helpers
|
data/test/test_page.rb
CHANGED
@@ -104,12 +104,12 @@ context "Page" do
|
|
104
104
|
assert_equal 'My Precious', page.title
|
105
105
|
end
|
106
106
|
|
107
|
-
test "title from
|
107
|
+
test "title from filename with normal contents" do
|
108
108
|
page = @wiki.page('Home')
|
109
|
-
assert_equal "
|
109
|
+
assert_equal "Home", page.title
|
110
110
|
end
|
111
111
|
|
112
|
-
test "title from
|
112
|
+
test "title from filename with html contents" do
|
113
113
|
page = @wiki.page('Eye Of Sauron')
|
114
114
|
assert_equal "Eye Of Sauron", page.title
|
115
115
|
end
|
@@ -163,4 +163,4 @@ context "Page" do
|
|
163
163
|
assert_equal "/foo", Gollum::BlobEntry.normalize_dir("foo")
|
164
164
|
assert_equal "/foo", Gollum::BlobEntry.normalize_dir("/foo")
|
165
165
|
end
|
166
|
-
end
|
166
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gollum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version:
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 2.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tom Preston-Werner
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
19
|
+
date: 2012-05-06 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -255,12 +255,12 @@ dependencies:
|
|
255
255
|
requirements:
|
256
256
|
- - ~>
|
257
257
|
- !ruby/object:Gem::Version
|
258
|
-
hash:
|
258
|
+
hash: 63
|
259
259
|
segments:
|
260
260
|
- 0
|
261
|
-
-
|
262
|
-
-
|
263
|
-
version: 0.
|
261
|
+
- 8
|
262
|
+
- 0
|
263
|
+
version: 0.8.0
|
264
264
|
type: :development
|
265
265
|
version_requirements: *id015
|
266
266
|
- !ruby/object:Gem::Dependency
|