juli 2.0.4 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/juli.gemspec +1 -0
- data/lib/juli/command.rb +4 -0
- data/lib/juli/util.rb +1 -0
- data/lib/juli/version.rb +1 -1
- data/lib/juli/visitor/html.rb +19 -11
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0332b51197f16c985e33f0b14f17de94e1e5c7c8
|
4
|
+
data.tar.gz: d44577a0524a445c3d8edea6d1319f2517222ff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04676c102da50e2181a0f9351c06c38a2d0c0e4fc1d1b266a1f8e86f176d58927e2dd07d5b252df5a5505567f8f3eb29b4bbb9ae515bd0642350f061c5e8acf3
|
7
|
+
data.tar.gz: ad4a0fa85b3a0d56eae90d6cb92e511fcf3c9efdff0b452a18a1f58c3146d7fa6a5faae11c11be4ebf6e713dbabc53e658426d58fabe9610571a0487026ab61c
|
data/Rakefile
CHANGED
data/juli.gemspec
CHANGED
data/lib/juli/command.rb
CHANGED
@@ -50,6 +50,10 @@ OUTPUT_TOP_COMMENT = <<EOM
|
|
50
50
|
#
|
51
51
|
#show_indent_toggle_button: true
|
52
52
|
|
53
|
+
# When set to '1st-only' (default), wikiname auto-link is applied at ONLY 1st
|
54
|
+
# occurence in a text, otherwise is applied at every occurence:
|
55
|
+
#
|
56
|
+
#link_wikiname_on: 1st-only
|
53
57
|
|
54
58
|
# Specify output top directory (default = ../html).
|
55
59
|
|
data/lib/juli/util.rb
CHANGED
data/lib/juli/version.rb
CHANGED
data/lib/juli/visitor/html.rb
CHANGED
@@ -59,8 +59,8 @@ module Juli::Visitor
|
|
59
59
|
include Juli::Util
|
60
60
|
include TagHelper
|
61
61
|
|
62
|
-
def initialize(
|
63
|
-
@
|
62
|
+
def initialize(html_visitor)
|
63
|
+
@_html_visitor = html_visitor
|
64
64
|
end
|
65
65
|
|
66
66
|
def visit_array(n)
|
@@ -74,8 +74,13 @@ module Juli::Visitor
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def visit_wikiname(n)
|
77
|
-
|
78
|
-
|
77
|
+
if conf['link_wikiname_on'] == '1st-only' && @_html_visitor.wikiname_visited[n.str]
|
78
|
+
n.str
|
79
|
+
else
|
80
|
+
@_html_visitor.wikiname_visited[n.str] = true
|
81
|
+
decoded = Juli::Wiki.decode(n.str)
|
82
|
+
content_tag(:a, decoded, :class=>'wiki', :href=>decoded + conf['ext'])
|
83
|
+
end
|
79
84
|
end
|
80
85
|
|
81
86
|
def visit_url(n)
|
@@ -83,7 +88,7 @@ module Juli::Visitor
|
|
83
88
|
end
|
84
89
|
|
85
90
|
def visit_macro(n)
|
86
|
-
if macro = @
|
91
|
+
if macro = @_html_visitor.macros[camelize(n.name).to_sym]
|
87
92
|
macro.run(*n.rest.split(' '))
|
88
93
|
else
|
89
94
|
s = "juli ERR: UNKNOWN macro name: '#{n.name}'"
|
@@ -93,6 +98,8 @@ module Juli::Visitor
|
|
93
98
|
end
|
94
99
|
end
|
95
100
|
|
101
|
+
attr_accessor :wikiname_visited, :macros
|
102
|
+
|
96
103
|
# Html sepecific initialization does:
|
97
104
|
#
|
98
105
|
# 1. create output_top.
|
@@ -112,7 +119,7 @@ module Juli::Visitor
|
|
112
119
|
|
113
120
|
register_helper
|
114
121
|
register_macro
|
115
|
-
@html_line_visitor = HtmlLine.new(
|
122
|
+
@html_line_visitor = HtmlLine.new(self)
|
116
123
|
|
117
124
|
if !File.directory?(conf['output_top'])
|
118
125
|
FileUtils.mkdir_p(conf['output_top'])
|
@@ -139,7 +146,7 @@ module Juli::Visitor
|
|
139
146
|
for key, helper in @_helpers do
|
140
147
|
helper.on_root(in_file, root, self)
|
141
148
|
end
|
142
|
-
for macro_symbol, macro in @
|
149
|
+
for macro_symbol, macro in @macros do
|
143
150
|
macro.on_root(in_file, root, self)
|
144
151
|
end
|
145
152
|
|
@@ -150,9 +157,10 @@ module Juli::Visitor
|
|
150
157
|
javascript = relative_from(in_file, 'juli.js')
|
151
158
|
stylesheet = relative_from(in_file, 'juli.css')
|
152
159
|
sitemap = relative_from(in_file, 'sitemap' + conf['ext'])
|
160
|
+
@wikiname_visited = {}
|
153
161
|
body = root.accept(self)
|
154
162
|
|
155
|
-
for macro_symbol, macro in @
|
163
|
+
for macro_symbol, macro in @macros do
|
156
164
|
macro.after_root(in_file, root)
|
157
165
|
end
|
158
166
|
|
@@ -277,17 +285,17 @@ module Juli::Visitor
|
|
277
285
|
end
|
278
286
|
|
279
287
|
|
280
|
-
# create Macro object and register it in @
|
288
|
+
# create Macro object and register it in @macros hash.
|
281
289
|
#
|
282
290
|
# call set_conf_default() to set conf[key] default value for each macro
|
283
291
|
def register_macro
|
284
|
-
@
|
292
|
+
@macros = {}
|
285
293
|
for macro_symbol in Juli::Macro.constants do
|
286
294
|
next if macro_symbol == :Base
|
287
295
|
macro_class = Juli::Macro.module_eval(macro_symbol.to_s)
|
288
296
|
macro = macro_class.new
|
289
297
|
macro.set_conf_default(conf)
|
290
|
-
@
|
298
|
+
@macros[macro_symbol] = macro
|
291
299
|
end
|
292
300
|
end
|
293
301
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ido
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '10.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rdoc
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Offline wiki, and outline processor
|
98
112
|
email:
|
99
113
|
- fuminori_ido@yahoo.co.jp
|
@@ -221,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
235
|
version: '0'
|
222
236
|
requirements: []
|
223
237
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.4.5
|
238
|
+
rubygems_version: 2.4.5.5
|
225
239
|
signing_key:
|
226
240
|
specification_version: 4
|
227
241
|
summary: Offline wiki, and outline processor
|