docgenerator 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/examples/creole_example.rb +0 -1
- data/examples/creole_example_new_plugin.rb +51 -0
- data/examples/creole_example_tabular.rb +3 -1
- data/examples/wiki2docgenerator_example.rb +2 -2
- data/lib/creole/creole2doc.rb +697 -680
- data/lib/creole/creole_characters.rb +90 -26
- data/lib/creole/creole_inclusion_and_plugins.rb +25 -43
- data/lib/creole/creole_inclusions.rb +87 -75
- data/lib/creole/creole_placeholder.rb +87 -89
- data/lib/creole/creole_plugins.rb +149 -117
- data/lib/creole/creole_tabular.rb +247 -141
- data/lib/creole/plugins/todonotes.rb +48 -48
- data/lib/docgenerator/characters.rb +106 -8
- data/lib/docgenerator/compatibility_v1.rb +7 -1
- data/lib/docgenerator/document.rb +34 -19
- data/lib/docgenerator/element.rb +1 -0
- data/lib/docgenerator/element_meta.rb +1 -1
- data/lib/docgenerator/elements.rb +594 -535
- data/lib/docgenerator/environments.rb +131 -99
- data/lib/docgenerator/index.rb +110 -0
- data/lib/docgenerator/lists.rb +2 -1
- data/lib/docgenerator/packages/caption.rb +32 -34
- data/lib/docgenerator/packages/hyperref.rb +1 -0
- data/lib/docgenerator/packages/multicol.rb +3 -2
- data/lib/docgenerator/packages/pdfpages.rb +71 -20
- data/lib/docgenerator/packages/scrpage2.rb +99 -142
- data/lib/docgenerator/packages/url.rb +75 -81
- data/lib/docgenerator/sections.rb +98 -98
- data/lib/docgenerator/standard.rb +8 -1
- data/lib/docgenerator/tabular.rb +44 -25
- data/lib/docgenerator/templates/docgenerator_template.yaml +28 -0
- data/lib/docgenerator/version.rb +146 -0
- data/lib/docgenerator.rb +20 -15
- data/meta_test_and_doc/build_doc.rb +39 -10
- data/meta_test_and_doc/build_test.rb +34 -12
- data/meta_test_and_doc/manpages/characters.rb +452 -20
- data/meta_test_and_doc/manpages/elementlist.rb +304 -0
- data/meta_test_and_doc/manpages/elements.rb +305 -42
- data/meta_test_and_doc/manpages/others.rb +403 -0
- data/meta_test_and_doc/manpages/pdfpages.rb +117 -18
- data/meta_test_and_doc/manpages/readme.rdoc +3 -1
- data/meta_test_and_doc/manpages/scrpage2.rb +0 -80
- data/meta_test_and_doc/manpages/tables.rb +6 -6
- data/readme.rdoc +11 -120
- data/unittest/expected/test_comment.html +1 -0
- data/unittest/expected/test_comment.latex +5 -0
- data/unittest/expected/test_comment_complex.html +3 -0
- data/unittest/expected/test_comment_complex.latex +15 -0
- data/unittest/expected_creole/test_creole_characters_all.html +6 -5
- data/unittest/expected_creole/test_creole_characters_all.latex +10 -8
- data/unittest/expected_creole/test_creole_creole1.0test.latex +5 -5
- data/unittest/expected_creole/test_creole_input.normsource +11 -9
- data/unittest/expected_creole/test_creole_list_ul.normsource +57 -51
- data/unittest/expected_creole/test_creole_list_ulul_without_ul.html +6 -0
- data/unittest/expected_creole/test_creole_list_ulul_without_ul.latex +12 -0
- data/unittest/expected_creole/test_creole_paragraphs.normsource +12 -10
- data/unittest/expected_creole/test_creole_pictures.latex +2 -2
- data/unittest/expected_creole/test_creole_pictures_css.latex +2 -2
- data/unittest/expected_creole/test_creole_pictures_imgclass.latex +2 -2
- data/unittest/expected_creole/test_creole_pictures_width.latex +1 -1
- data/unittest/expected_creole/test_creole_tabular.latex +3 -3
- data/unittest/expected_creole/test_creole_tabular_creole.latex +2 -2
- data/unittest/expected_creole/test_creole_tabular_css.latex +3 -3
- data/unittest/expected_creole/test_creole_tabular_row_parameters.latex +22 -0
- data/unittest/expected_templates/test_standalone.tex +34 -0
- data/unittest/expected_wikimedia/test_wiki_picture.latex +12 -12
- data/unittest/unittest_creole.rb +22 -3
- data/unittest/unittest_creole_tabular.rb +34 -1
- data/unittest/unittest_docgenerator.rb +46 -3
- data/unittest/unittest_docgenerator_characters.rb +527 -82
- data/unittest/unittest_templates.rb +1 -1
- metadata +149 -108
@@ -15,7 +15,7 @@ You can extend Wikis with additional Plugin:
|
|
15
15
|
#
|
16
16
|
|
17
17
|
module Docgenerator
|
18
|
-
module Creole
|
18
|
+
module Creole
|
19
19
|
|
20
20
|
=begin rdoc
|
21
21
|
Creole plugins
|
@@ -30,21 +30,21 @@ You can extend Wikis with additional Plugin:
|
|
30
30
|
wiki = Creole.new()
|
31
31
|
wiki.plugin['xxx'] = Creole_plugin_xxx
|
32
32
|
=end
|
33
|
-
module Plugins
|
33
|
+
module Plugins
|
34
34
|
|
35
35
|
=begin rdoc
|
36
36
|
Default Plugin for Creole.
|
37
37
|
<<xx>>
|
38
38
|
=end
|
39
|
-
class Creole_default_plugin < Creole_inclusion_and_plugin
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
39
|
+
class Creole_default_plugin < Creole_inclusion_and_plugin
|
40
|
+
def initialize( pluginname, description, options, wiki )
|
41
|
+
super
|
42
|
+
@wiki.log.warn("Use Default plugin instead requested #{pluginname}- nothing special done.") if @wiki.log.warn?
|
43
|
+
end
|
44
|
+
end
|
45
45
|
|
46
|
-
#Collection of Plugins
|
47
|
-
Collection = Hash.new(Creole_default_plugin)
|
46
|
+
#Collection of Plugins
|
47
|
+
Collection = Hash.new(Creole_default_plugin)
|
48
48
|
|
49
49
|
|
50
50
|
=begin rdoc
|
@@ -54,28 +54,28 @@ Makes sense for HTML-output.
|
|
54
54
|
|
55
55
|
For LaTeX the support of bigfoot/manyfoot... may be an idea.
|
56
56
|
=end
|
57
|
-
class Creole_footnote_group < Creole_inclusion_and_plugin
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
class Creole_footnote_group < Creole_inclusion_and_plugin
|
58
|
+
#
|
59
|
+
|
60
|
+
Collection['footnotes'] = self
|
61
|
+
|
62
|
+
def initialize( inclusionname, description, options, wiki )
|
63
|
+
super
|
64
|
+
description = Footnotegroup::DEFAULTGROUPID unless description
|
65
|
+
@footnotesgroup = wiki.footnotegroups[description]
|
66
|
+
wiki.log.error("Footnotesgroup #{description.inspect} not found") if ! @footnotesgroup and wiki.log.error?
|
67
|
+
end
|
68
68
|
=begin rdoc
|
69
69
|
Call Docgenerator::Footnotegroup#to_doc
|
70
70
|
=end
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end #Creole_inclusion_footnote_group
|
71
|
+
def to_doc(target, options = {})
|
72
|
+
#remove options for Docgenerator::Footnotegroup
|
73
|
+
l_options = options.dup
|
74
|
+
l_options.delete(:plugins)
|
75
|
+
l_options.delete(:inclusions)
|
76
|
+
@footnotesgroup.to_doc(target, l_options)
|
77
|
+
end
|
78
|
+
end #Creole_inclusion_footnote_group
|
79
79
|
|
80
80
|
=begin rdoc
|
81
81
|
One footnote
|
@@ -91,43 +91,77 @@ Solution:
|
|
91
91
|
* LaTeX: no problem, LaTeX has it's own output mechanism.
|
92
92
|
* HTML: Use grouping.
|
93
93
|
=end
|
94
|
-
class Creole_footnote < Creole_inclusion_and_plugin
|
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
|
-
end #Creole_inclusion_footnote
|
94
|
+
class Creole_footnote < Creole_inclusion_and_plugin
|
95
|
+
Collection['footnote'] = self
|
96
|
+
|
97
|
+
def initialize( inclusionname, description, options, wiki )
|
98
|
+
super
|
99
|
+
|
100
|
+
@groupid = Footnotegroup::DEFAULTGROUPID
|
101
|
+
label = nil
|
102
|
+
|
103
|
+
options.each{|option|
|
104
|
+
case option
|
105
|
+
when /label\s*=\s*(.*)/
|
106
|
+
label = $1
|
107
|
+
when /groupid\s*=\s*(.*)/
|
108
|
+
@groupid = $1
|
109
|
+
else
|
110
|
+
@wiki.log.warn("Footnote with unknown option #{option.inspect} not found") if @wiki.log.warn?
|
111
|
+
end
|
112
|
+
}
|
113
|
+
|
114
|
+
if ! wiki.footnotegroups[@groupid]
|
115
|
+
wiki.footnotegroups[@groupid] = Footnotegroup.new(@groupid)
|
116
|
+
end
|
117
|
+
|
118
|
+
group = wiki.footnotegroups[@groupid]
|
119
|
+
|
120
|
+
@footnote = element(:footnote,{
|
121
|
+
:group => group,
|
122
|
+
:label => label,
|
123
|
+
}, description )
|
124
|
+
|
125
|
+
|
126
|
+
end
|
127
|
+
def to_doc(target, options ={})
|
128
|
+
@footnote.to_doc(target, options)
|
129
|
+
end
|
130
|
+
end #Creole_inclusion_footnote
|
131
|
+
|
132
|
+
=begin rdoc
|
133
|
+
Some short latex
|
134
|
+
|
135
|
+
Usage:
|
136
|
+
<<latex|code>>
|
137
|
+
|
138
|
+
Note:
|
139
|
+
There is also a placeholder for larger latex:
|
140
|
+
<<<latex
|
141
|
+
content
|
142
|
+
>>>
|
143
|
+
=end
|
144
|
+
class Creole_short_latex < Creole_inclusion_and_plugin
|
145
|
+
#We don't use it as inclusion. Closing } from latex may be confusing as in:
|
146
|
+
# {{latex|\texttt{kursuiv}}}
|
147
|
+
set_plugin_key 'latex'
|
148
|
+
|
149
|
+
def initialize( inclusionname, description, options, wiki )
|
150
|
+
super
|
151
|
+
options.each{|option|
|
152
|
+
#~ case option
|
153
|
+
#~ else
|
154
|
+
@wiki.log.warn("latex with unknown option #{option.inspect} not found") if @wiki.log.warn?
|
155
|
+
#~ end
|
156
|
+
}
|
157
|
+
@source = description
|
158
|
+
|
159
|
+
end
|
160
|
+
#Return content only for latex
|
161
|
+
def to_doc( target, options = {})
|
162
|
+
target == :latex ? @source.to_doc( target, options ) : ''
|
163
|
+
end
|
164
|
+
end #Creole_short_latex
|
131
165
|
|
132
166
|
|
133
167
|
=begin rdoc
|
@@ -136,28 +170,28 @@ Eval the given ruby-code and put it as "raw text".
|
|
136
170
|
|
137
171
|
This is defined as a plugin.
|
138
172
|
=end
|
139
|
-
class Creole_plugin_ruby_raw < Creole_inclusion_and_plugin
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
end #Creole_plugin_ruby
|
173
|
+
class Creole_plugin_ruby_raw < Creole_inclusion_and_plugin
|
174
|
+
set_plugin_key 'ruby_raw'
|
175
|
+
|
176
|
+
def initialize( inclusionname, description, options, wiki )
|
177
|
+
#The ruby-code may contain | - so we have to ad it again
|
178
|
+
description << "|#{options.join('|')}" unless options.empty?
|
179
|
+
options = nil
|
180
|
+
super
|
181
|
+
@code = description
|
182
|
+
begin
|
183
|
+
@result = eval(@code)
|
184
|
+
rescue => bang
|
185
|
+
wiki.log.error("Plugin ruby_raw: <#{@code}> results in #{bang.class}/#{bang}") if wiki.log.error?
|
186
|
+
end
|
187
|
+
end #initialize
|
188
|
+
def to_doc(target, options ={})
|
189
|
+
@result.to_s
|
190
|
+
end
|
191
|
+
def inspect()
|
192
|
+
"#<Creole_plugin_ruby_raw:#{@code}>"
|
193
|
+
end
|
194
|
+
end #Creole_plugin_ruby
|
161
195
|
|
162
196
|
=begin rdoc
|
163
197
|
Eval the given ruby-code and add it as a interpreted code.
|
@@ -166,33 +200,31 @@ This is defined as a plugin.
|
|
166
200
|
|
167
201
|
Ideas for further development: eval later, at doc generation.
|
168
202
|
=end
|
169
|
-
class Creole_plugin_ruby < Creole_inclusion_and_plugin
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
end #Creole_plugin_ruby
|
194
|
-
|
195
|
-
|
196
|
-
end #module Plugins
|
197
|
-
end #module Creole
|
203
|
+
class Creole_plugin_ruby < Creole_inclusion_and_plugin
|
204
|
+
set_plugin_key 'ruby'
|
205
|
+
|
206
|
+
def initialize( inclusionname, description, options, wiki )
|
207
|
+
#The ruby-code may contain | - so we have to ad it again
|
208
|
+
description << "|#{options.join('|')}" unless options.empty?
|
209
|
+
options = nil
|
210
|
+
super
|
211
|
+
|
212
|
+
@code = description
|
213
|
+
begin
|
214
|
+
@result = eval(@code)
|
215
|
+
rescue => bang
|
216
|
+
wiki.log.error("Plugin ruby: <#{@code}> results in #{bang.class}/#{bang}") if wiki.log.error?
|
217
|
+
end
|
218
|
+
end #initialize
|
219
|
+
def to_doc(target, options = {})
|
220
|
+
@wiki.normsource2elements(
|
221
|
+
@wiki.parse(@result.to_s ), options
|
222
|
+
).to_doc(target, options )
|
223
|
+
end
|
224
|
+
def inspect()
|
225
|
+
"#<Creole_plugin_ruby:#{@code}>"
|
226
|
+
end
|
227
|
+
end #Creole_plugin_ruby
|
228
|
+
end #module Plugins
|
229
|
+
end #module Creole
|
198
230
|
end #module Docgenerator
|