gollum-lib 5.0.a.3 → 5.0.a.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/HISTORY.md +7 -0
- data/gemspec.rb +10 -4
- data/lib/gollum-lib.rb +3 -6
- data/lib/gollum-lib/file.rb +7 -0
- data/lib/gollum-lib/filter.rb +2 -2
- data/lib/gollum-lib/filter/bibtex.rb +55 -0
- data/lib/gollum-lib/filter/code.rb +0 -2
- data/lib/gollum-lib/filter/emoji.rb +10 -3
- data/lib/gollum-lib/filter/pandoc_bib.rb +52 -0
- data/lib/gollum-lib/filter/plain_text.rb +4 -0
- data/lib/gollum-lib/filter/plantuml.rb +3 -4
- data/lib/gollum-lib/filter/remote_code.rb +0 -1
- data/lib/gollum-lib/filter/sanitize.rb +1 -1
- data/lib/gollum-lib/filter/tags.rb +196 -173
- data/lib/gollum-lib/macro/video.rb +9 -0
- data/lib/gollum-lib/markup.rb +25 -41
- data/lib/gollum-lib/markups.rb +36 -3
- data/lib/gollum-lib/sanitization.rb +215 -14
- data/lib/gollum-lib/version.rb +1 -1
- data/lib/gollum-lib/wiki.rb +8 -1
- metadata +53 -15
- data/lib/gollum-lib/filter/wsd.rb +0 -54
data/lib/gollum-lib/version.rb
CHANGED
data/lib/gollum-lib/wiki.rb
CHANGED
@@ -120,6 +120,12 @@ module Gollum
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
+
# Whether or not the wiki's repository is bare (doesn't have a working directory)
|
124
|
+
attr_reader :repo_is_bare
|
125
|
+
|
126
|
+
# The String path to the repository
|
127
|
+
attr_reader :path
|
128
|
+
|
123
129
|
# The String base path to prefix to internal links. For example, when set
|
124
130
|
# to "/wiki", the page "Hobbit" will be linked as "/wiki/Hobbit". Defaults
|
125
131
|
# to "/".
|
@@ -244,8 +250,9 @@ module Gollum
|
|
244
250
|
@allow_uploads = options.fetch :allow_uploads, false
|
245
251
|
@per_page_uploads = options.fetch :per_page_uploads, false
|
246
252
|
@filter_chain = options.fetch :filter_chain,
|
247
|
-
[:YAML, :PlainText, :TOC, :RemoteCode, :Code, :Macro, :Emoji, :Sanitize, :
|
253
|
+
[:YAML, :BibTeX, :PlainText, :TOC, :RemoteCode, :Code, :Macro, :Emoji, :Sanitize, :PlantUML, :Tags, :PandocBib, :Render]
|
248
254
|
@filter_chain.delete(:Emoji) unless options.fetch :emoji, false
|
255
|
+
@filter_chain.delete(:PandocBib) unless ::Gollum::MarkupRegisterUtils.using_pandoc?
|
249
256
|
end
|
250
257
|
|
251
258
|
# Public: check whether the wiki's git repo exists on the filesystem.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gollum-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.a.
|
4
|
+
version: 5.0.a.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
@@ -31,34 +31,28 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '3.1'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '3.1'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: nokogiri
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '1.
|
49
|
-
- - ">="
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version: 1.7.1
|
48
|
+
version: '1.8'
|
52
49
|
type: :runtime
|
53
50
|
prerelease: false
|
54
51
|
version_requirements: !ruby/object:Gem::Requirement
|
55
52
|
requirements:
|
56
53
|
- - "~>"
|
57
54
|
- !ruby/object:Gem::Version
|
58
|
-
version: '1.
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 1.7.1
|
55
|
+
version: '1.8'
|
62
56
|
- !ruby/object:Gem::Dependency
|
63
57
|
name: stringex
|
64
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,6 +109,20 @@ dependencies:
|
|
115
109
|
- - "~>"
|
116
110
|
- !ruby/object:Gem::Version
|
117
111
|
version: '3.2'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: twitter-text
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 1.14.7
|
119
|
+
type: :runtime
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.14.7
|
118
126
|
- !ruby/object:Gem::Dependency
|
119
127
|
name: org-ruby
|
120
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,14 +171,14 @@ dependencies:
|
|
163
171
|
requirements:
|
164
172
|
- - "~>"
|
165
173
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
174
|
+
version: 1.2.0
|
167
175
|
type: :development
|
168
176
|
prerelease: false
|
169
177
|
version_requirements: !ruby/object:Gem::Requirement
|
170
178
|
requirements:
|
171
179
|
- - "~>"
|
172
180
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
181
|
+
version: 1.2.0
|
174
182
|
- !ruby/object:Gem::Dependency
|
175
183
|
name: shoulda
|
176
184
|
requirement: !ruby/object:Gem::Requirement
|
@@ -199,6 +207,34 @@ dependencies:
|
|
199
207
|
- - "~>"
|
200
208
|
- !ruby/object:Gem::Version
|
201
209
|
version: 0.8.3
|
210
|
+
- !ruby/object:Gem::Dependency
|
211
|
+
name: bibtex-ruby
|
212
|
+
requirement: !ruby/object:Gem::Requirement
|
213
|
+
requirements:
|
214
|
+
- - "~>"
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
version: '4.3'
|
217
|
+
type: :development
|
218
|
+
prerelease: false
|
219
|
+
version_requirements: !ruby/object:Gem::Requirement
|
220
|
+
requirements:
|
221
|
+
- - "~>"
|
222
|
+
- !ruby/object:Gem::Version
|
223
|
+
version: '4.3'
|
224
|
+
- !ruby/object:Gem::Dependency
|
225
|
+
name: citeproc-ruby
|
226
|
+
requirement: !ruby/object:Gem::Requirement
|
227
|
+
requirements:
|
228
|
+
- - "~>"
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '1.1'
|
231
|
+
type: :development
|
232
|
+
prerelease: false
|
233
|
+
version_requirements: !ruby/object:Gem::Requirement
|
234
|
+
requirements:
|
235
|
+
- - "~>"
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '1.1'
|
202
238
|
- !ruby/object:Gem::Dependency
|
203
239
|
name: rake
|
204
240
|
requirement: !ruby/object:Gem::Requirement
|
@@ -391,9 +427,11 @@ files:
|
|
391
427
|
- lib/gollum-lib/file.rb
|
392
428
|
- lib/gollum-lib/file_view.rb
|
393
429
|
- lib/gollum-lib/filter.rb
|
430
|
+
- lib/gollum-lib/filter/bibtex.rb
|
394
431
|
- lib/gollum-lib/filter/code.rb
|
395
432
|
- lib/gollum-lib/filter/emoji.rb
|
396
433
|
- lib/gollum-lib/filter/macro.rb
|
434
|
+
- lib/gollum-lib/filter/pandoc_bib.rb
|
397
435
|
- lib/gollum-lib/filter/plain_text.rb
|
398
436
|
- lib/gollum-lib/filter/plantuml.rb
|
399
437
|
- lib/gollum-lib/filter/remote_code.rb
|
@@ -401,7 +439,6 @@ files:
|
|
401
439
|
- lib/gollum-lib/filter/sanitize.rb
|
402
440
|
- lib/gollum-lib/filter/tags.rb
|
403
441
|
- lib/gollum-lib/filter/toc.rb
|
404
|
-
- lib/gollum-lib/filter/wsd.rb
|
405
442
|
- lib/gollum-lib/filter/yaml.rb
|
406
443
|
- lib/gollum-lib/git_access.rb
|
407
444
|
- lib/gollum-lib/helpers.rb
|
@@ -411,6 +448,7 @@ files:
|
|
411
448
|
- lib/gollum-lib/macro/global_toc.rb
|
412
449
|
- lib/gollum-lib/macro/navigation.rb
|
413
450
|
- lib/gollum-lib/macro/series.rb
|
451
|
+
- lib/gollum-lib/macro/video.rb
|
414
452
|
- lib/gollum-lib/markup.rb
|
415
453
|
- lib/gollum-lib/markups.rb
|
416
454
|
- lib/gollum-lib/page.rb
|
@@ -440,7 +478,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
440
478
|
version: 1.3.1
|
441
479
|
requirements: []
|
442
480
|
rubyforge_project: gollum-lib
|
443
|
-
rubygems_version: 2.
|
481
|
+
rubygems_version: 2.7.7
|
444
482
|
signing_key:
|
445
483
|
specification_version: 2
|
446
484
|
summary: A simple, Git-powered wiki.
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# ~*~ encoding: utf-8 ~*~
|
2
|
-
require 'net/http'
|
3
|
-
require 'uri'
|
4
|
-
require 'open-uri'
|
5
|
-
|
6
|
-
# Web Sequence Diagrams
|
7
|
-
#
|
8
|
-
# Render an inline web sequence diagram by sending the WSD code through the
|
9
|
-
# online renderer available from www.websequencediagrams.com.
|
10
|
-
#
|
11
|
-
class Gollum::Filter::WSD < Gollum::Filter
|
12
|
-
WSD_URL = "http://www.websequencediagrams.com/index.php"
|
13
|
-
|
14
|
-
# Extract all sequence diagram blocks into the map and replace with
|
15
|
-
# placeholders.
|
16
|
-
def extract(data)
|
17
|
-
return data if @markup.format == :txt
|
18
|
-
data.gsub(/^\{\{\{\{\{\{ ?(.+?)\r?\n(.+?)\r?\n\}\}\}\}\}\}\r?$/m) do
|
19
|
-
id = Digest::SHA1.hexdigest(Regexp.last_match[2])
|
20
|
-
@map[id] = { :style => Regexp.last_match[1], :code => Regexp.last_match[2] }
|
21
|
-
id
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# Process all diagrams from the map and replace the placeholders with
|
26
|
-
# the final HTML.
|
27
|
-
#
|
28
|
-
# data - The String data (with placeholders).
|
29
|
-
#
|
30
|
-
# Returns the marked up String data.
|
31
|
-
def process(data)
|
32
|
-
@map.each do |id, spec|
|
33
|
-
data.gsub!(id) do
|
34
|
-
render_wsd(spec[:code], spec[:style])
|
35
|
-
end
|
36
|
-
end
|
37
|
-
data
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
# Render the sequence diagram on the remote server.
|
42
|
-
#
|
43
|
-
# Returns an <img> tag to the rendered image, or an HTML error.
|
44
|
-
def render_wsd(code, style)
|
45
|
-
response = Net::HTTP.post_form(URI.parse(WSD_URL), 'style' => style, 'message' => code)
|
46
|
-
if response.body =~ /img: "(.+)"/
|
47
|
-
url = "//www.websequencediagrams.com/#{Regexp.last_match[1]}"
|
48
|
-
"<img src=\"#{url}\" />"
|
49
|
-
else
|
50
|
-
puts response.body
|
51
|
-
html_error("Sorry, unable to render sequence diagram at this time.")
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|