docgenerator 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/examples/creole_example_tabular.rb +95 -0
- data/examples/docgenerator_example.rb +5 -5
- data/lib/creole/creole2doc.rb +28 -18
- data/lib/creole/creole_inclusions.rb +4 -4
- data/lib/creole/creole_placeholder.rb +4 -1
- data/lib/creole/creole_tabular.rb +173 -155
- data/lib/creole/plugins/rail.rb +118 -119
- data/lib/creole/plugins/struktex.rb +35 -35
- data/lib/creole/plugins/todonotes.rb +8 -1
- data/lib/docgenerator/attribute.rb +160 -160
- data/lib/docgenerator/characters.rb +343 -311
- data/lib/docgenerator/css.rb +167 -167
- data/lib/docgenerator/document.rb +525 -511
- data/lib/docgenerator/element.rb +316 -316
- data/lib/docgenerator/element_meta.rb +114 -114
- data/lib/docgenerator/elements.rb +19 -9
- data/lib/docgenerator/environments.rb +3 -1
- data/lib/docgenerator/lists.rb +177 -174
- data/lib/docgenerator/packages/hyperref.rb +74 -70
- data/lib/docgenerator/packages/multicol.rb +33 -0
- data/lib/docgenerator/packages/scrlettr2.rb +152 -151
- data/lib/docgenerator/packages/todonotes.rb +1 -1
- data/lib/docgenerator/tabular.rb +463 -400
- data/lib/docgenerator/templates/docgenerator_template.rb +94 -84
- data/lib/docgenerator/templates/docgenerator_template.yaml +75 -15
- data/lib/docgenerator.rb +1 -1
- data/lib/wiki2doc/wiki2docgenerator.rb +1 -1
- data/meta_test_and_doc/build__meta.rb +125 -0
- data/meta_test_and_doc/build_doc.rb +333 -0
- data/meta_test_and_doc/build_test.rb +251 -0
- data/meta_test_and_doc/manpages/attachfile.rb +389 -0
- data/meta_test_and_doc/manpages/caption.rb +133 -0
- data/meta_test_and_doc/manpages/characters.rb +3738 -0
- data/meta_test_and_doc/manpages/elements.rb +6851 -0
- data/meta_test_and_doc/manpages/environments.rb +985 -0
- data/meta_test_and_doc/manpages/footnote.rb +439 -0
- data/meta_test_and_doc/manpages/hyperref.rb +605 -0
- data/meta_test_and_doc/manpages/listings.rb +988 -0
- data/meta_test_and_doc/manpages/lists.rb +1463 -0
- data/meta_test_and_doc/manpages/others.rb +129 -0
- data/meta_test_and_doc/manpages/packages.rb +13 -0
- data/meta_test_and_doc/manpages/pdfpages.rb +108 -0
- data/meta_test_and_doc/manpages/readme.rdoc +9 -0
- data/meta_test_and_doc/manpages/scrlettr2.rb +362 -0
- data/meta_test_and_doc/manpages/scrpage2.rb +2028 -0
- data/meta_test_and_doc/manpages/sectioning.rb +2467 -0
- data/meta_test_and_doc/manpages/tables.rb +2088 -0
- data/meta_test_and_doc/manpages/todonotes.rb +235 -0
- data/meta_test_and_doc/manpages/wiki2docgenerator.rb +64 -0
- data/{readme.rd → readme.rdoc} +18 -1
- data/unittest/expected/test_tabular.creole +33 -0
- data/unittest/expected_creole/test_creole_creole1.0test.html +3 -3
- data/unittest/expected_creole/test_creole_creole1.0test.latex +3 -3
- data/unittest/expected_creole/test_creole_creole1.0test.text +3 -3
- data/unittest/expected_creole/test_creole_inline_apostroph.html +6 -0
- data/unittest/expected_creole/test_creole_inline_apostroph.latex +8 -0
- data/unittest/expected_creole/test_creole_inline_apostroph.text +4 -0
- data/unittest/expected_creole/test_creole_input.normsource +12 -12
- data/unittest/expected_creole/test_creole_input.normsource_1.8 +23 -0
- data/unittest/expected_creole/test_creole_links_external_implicit.html +2 -2
- data/unittest/expected_creole/test_creole_links_external_implicit.latex +2 -2
- data/unittest/expected_creole/test_creole_links_external_implicit.text +2 -2
- data/unittest/expected_creole/test_creole_links_implicit_end.html +1 -1
- data/unittest/expected_creole/test_creole_links_implicit_end.latex +1 -1
- data/unittest/expected_creole/test_creole_list_ul.normsource +42 -42
- data/unittest/expected_creole/test_creole_list_ul.normsource_1.8 +83 -0
- data/unittest/expected_creole/test_creole_paragraphs.normsource +15 -15
- data/unittest/expected_creole/test_creole_paragraphs.normsource_1.8 +27 -0
- data/unittest/expected_creole/test_creole_tabular.creole +22 -0
- data/unittest/expected_creole/test_creole_tabular_creole.creole +19 -0
- data/unittest/expected_creole/test_creole_tabular_css.creole +24 -0
- data/unittest/expected_creole/test_creole_tabular_multicols.creole +16 -0
- data/unittest/expected_creole/test_creole_tabular_multicols.html +14 -0
- data/unittest/expected_creole/test_creole_tabular_multicols.latex +16 -0
- data/unittest/expected_creole/test_creole_tabular_with_cell_option.creole +21 -0
- data/unittest/expected_creole/test_creole_toc_level_text.html +2 -2
- data/unittest/expected_creole/test_creole_toc_level_text.latex +2 -2
- data/unittest/expected_packages/test_multicol_3.tex +2 -0
- data/unittest/expected_packages/test_multicol_3_titleline.tex +2 -0
- data/unittest/expected_templates/test_article.tex +23 -0
- data/unittest/expected_templates/test_article_utf8.tex +34 -0
- data/unittest/expected_templates/test_context.miv +18 -0
- data/unittest/expected_templates/test_creole.creole +8 -0
- data/unittest/expected_templates/test_html.html +12 -0
- data/unittest/expected_templates/test_html401_strict.html +14 -0
- data/unittest/expected_templates/test_html401_trans.html +14 -0
- data/unittest/expected_templates/test_html_utf8.html +14 -0
- data/unittest/expected_templates/test_include.tex +17 -0
- data/unittest/expected_templates/test_include_utf8.tex +17 -0
- data/unittest/expected_templates/test_text.txt +6 -0
- data/unittest/expected_templates/test_wiki.wiki +6 -0
- data/unittest/expected_templates/test_xhtml_strict.html +14 -0
- data/unittest/expected_templates/test_xhtml_trans.html +14 -0
- data/unittest/unittest_creole.rb +27 -6
- data/unittest/unittest_creole_placeholders.rb +1 -123
- data/unittest/unittest_creole_tabular.rb +174 -0
- data/unittest/unittest_docgenerator.rb +4 -3
- data/unittest/unittest_docgenerator_characters.rb +4769 -615
- data/unittest/unittest_packages_multicol.rb +84 -0
- data/unittest/unittest_rubycode4doc.rb +0 -1
- data/unittest/unittest_templates.rb +64 -0
- metadata +163 -77
- data/build_test_and_doc.rb +0 -505
- data/manpage_elements.rb +0 -10411
data/lib/docgenerator/lists.rb
CHANGED
|
@@ -1,208 +1,211 @@
|
|
|
1
1
|
module Docgenerator
|
|
2
|
-
module Lists
|
|
2
|
+
module Lists
|
|
3
3
|
=begin rdoc
|
|
4
4
|
Generic class for list environments.
|
|
5
5
|
|
|
6
6
|
Used to define Itemize, Enumerate...
|
|
7
7
|
=end
|
|
8
|
-
class ListEnvironment < Environments::Environment
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
end
|
|
8
|
+
class ListEnvironment < Environments::Environment
|
|
9
|
+
add_attributes( HTML_ATTR_ALL )
|
|
10
|
+
#Only items are allowed to be added.
|
|
11
|
+
#
|
|
12
|
+
#If an array is given, each item is added on it
|
|
13
|
+
def << ( item)
|
|
14
|
+
if item.is_a?(Array)
|
|
15
|
+
item.each{|it| self << it }
|
|
16
|
+
else
|
|
17
|
+
if self.class == Description
|
|
18
|
+
#fixme: Reihenfolge
|
|
19
|
+
if ! ( item.is_a?( Element.get(:dt) ) or item.is_a?( Element.get(:dd) ) )
|
|
20
|
+
@log.warn("Add non-item to list (get #{item.inspect})") if @log.warn
|
|
21
|
+
end
|
|
22
|
+
elsif ! item.is_a?( Element.get(:item) )
|
|
23
|
+
@log.warn("Add non-item to list (get #{item.inspect})") if @log.warn
|
|
24
|
+
end
|
|
25
|
+
@content << item
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
#Add parent-information to options. This is used by the list elements to get the list type.
|
|
29
|
+
def to_doc( target, options = {} )
|
|
30
|
+
o = set_option_defaults(options)
|
|
31
|
+
o[:log].debug("enter to_doc for #{self.inspect}") if o[:log].debug?
|
|
32
|
+
options[:parent] = self
|
|
33
|
+
super
|
|
34
|
+
end
|
|
35
|
+
def to_wiki( options= {} )
|
|
36
|
+
return "#{@content.to_doc(:wiki, options)}\n".gsub(/\n\n/, "\n")
|
|
37
|
+
end
|
|
38
|
+
def to_creole( options= {} )
|
|
39
|
+
return "#{@content.to_doc(:wiki, options)}\n".gsub(/\n\n/, "\n")
|
|
40
|
+
end
|
|
41
|
+
def to_text( options={} )
|
|
42
|
+
return "#{@content.to_doc(:text,options)}\n".gsub(/\n\n/, "\n")
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
45
|
|
|
46
46
|
=begin rdoc
|
|
47
47
|
Unnumbered list
|
|
48
48
|
=end
|
|
49
|
-
class Itemize < ListEnvironment
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
end
|
|
49
|
+
class Itemize < ListEnvironment
|
|
50
|
+
add_attributes HTML_ATTR_ALL
|
|
51
|
+
add_id :ul
|
|
52
|
+
def htmltag(); 'ul'; end
|
|
53
|
+
def to_latex( options={} )
|
|
54
|
+
return to_latex_environment( 'itemize', nil, options )
|
|
55
|
+
end
|
|
56
|
+
def to_context( options={} )
|
|
57
|
+
return to_context_environment( 'itemize', '[1]', options )
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
60
|
=begin rdoc
|
|
61
61
|
Numbered lists.
|
|
62
62
|
=end
|
|
63
|
-
class Enumerate < ListEnvironment
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
end
|
|
63
|
+
class Enumerate < ListEnvironment
|
|
64
|
+
add_attributes HTML_ATTR_ALL
|
|
65
|
+
add_id :ol
|
|
66
|
+
add_html_tag 'ol'
|
|
67
|
+
def to_latex( options={} )
|
|
68
|
+
return to_latex_environment( 'enumerate', nil, options )
|
|
69
|
+
end
|
|
70
|
+
def to_context( options={} )
|
|
71
|
+
return to_context_environment( 'itemize', '[n]', options )
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
74
|
|
|
75
75
|
=begin rdoc
|
|
76
|
-
HTML:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
HTML:
|
|
77
|
+
<dl>
|
|
78
|
+
<dt> <dd>
|
|
79
|
+
</dl>
|
|
80
80
|
=end
|
|
81
|
-
class Description < ListEnvironment
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
end
|
|
81
|
+
class Description < ListEnvironment
|
|
82
|
+
add_attributes( HTML_ATTR_ALL )
|
|
83
|
+
add_id :dl
|
|
84
|
+
add_html_tag 'dl'
|
|
85
|
+
def to_latex( options={} )
|
|
86
|
+
return to_latex_environment( 'description', nil, options )
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
89
|
|
|
90
90
|
=begin rdoc
|
|
91
91
|
Item line in a list.
|
|
92
92
|
|
|
93
93
|
The look will be defined by the environment where it is in (itemize/ul, enumerate/ol)
|
|
94
94
|
=end
|
|
95
|
-
class Item < Element
|
|
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
|
-
end
|
|
95
|
+
class Item < Element
|
|
96
|
+
add_id :li
|
|
97
|
+
add_attribute :text, Attribute.create( [ :latex ] )
|
|
98
|
+
add_attribute :type, Attribute.create( [ :html ], %w{disc square circle 1 a A i I} )
|
|
99
|
+
add_attribute :position, Attribute.create( [ :html ], %w{inside outside} )
|
|
100
|
+
add_attributes HTML_ATTR_ALL
|
|
101
|
+
add_html_tag 'li'
|
|
102
|
+
def to_latex( options={} )
|
|
103
|
+
cmd = ''
|
|
104
|
+
cmd << "\n" if @crbefore
|
|
105
|
+
cmd << "\n\\item "
|
|
106
|
+
cmd << "[#{@attr[:text]}] " if @attr[:text].filled?
|
|
107
|
+
cmd << @content.to_doc(:latex, options)
|
|
108
|
+
cmd << "\n" if @crafter
|
|
109
|
+
return cmd
|
|
110
|
+
end
|
|
111
|
+
#Item is the same like in LaTeX,but we have to use to_context() for the sub-elements.
|
|
112
|
+
def to_context( options={} )
|
|
113
|
+
cmd = ''
|
|
114
|
+
cmd << "\n" if @crbefore
|
|
115
|
+
cmd << "\n\\item "
|
|
116
|
+
#~ cmd << "[#{@attr[:text]}] " if @attr[:text].filled? #fixme
|
|
117
|
+
cmd << @content.to_doc(:context, options)
|
|
118
|
+
cmd << "\n" if @crafter
|
|
119
|
+
return cmd
|
|
120
|
+
end
|
|
121
|
+
def to_text(options={})
|
|
122
|
+
cmd = ''
|
|
123
|
+
cmd << "\n" if @crbefore
|
|
124
|
+
cmd << "- #{@content.to_doc(:text, options)}"
|
|
125
|
+
cmd << "\n" if @crafter
|
|
126
|
+
return cmd
|
|
127
|
+
end
|
|
128
|
+
#fixme cascaded lists will not work!!
|
|
129
|
+
#each list will be on first level.
|
|
130
|
+
#- wanted: ** on level 2
|
|
131
|
+
#- no * if followed by another list.
|
|
132
|
+
def to_wiki(options={})
|
|
133
|
+
o = set_option_defaults(options)
|
|
134
|
+
o[:log].debug("enter to_latex for row") if o[:log].debug?
|
|
135
|
+
cmd = ''
|
|
136
|
+
#~ cmd << "\n" if @crbefore
|
|
137
|
+
case o[:parent] #check for class to get the item type
|
|
138
|
+
when Docgenerator::Lists::Itemize
|
|
139
|
+
cmd << "\n* #{@content.to_doc(:wiki, options)}"
|
|
140
|
+
when Docgenerator::Lists::Enumerate
|
|
141
|
+
cmd << "\n# #{@content.to_doc(:wiki, options)}"
|
|
142
|
+
else
|
|
143
|
+
o[:log].error(":li/wiki: Unknown list type #{o[:parent].inspect}") if o[:log].error?
|
|
144
|
+
cmd << "\n* #{@content.to_doc(:wiki, options)}"
|
|
145
|
+
end
|
|
146
|
+
#~ cmd << "\n" if cmd[-1,1] != "\n"
|
|
147
|
+
cmd << "\n" if @crafter and cmd[-1,1] != "\n"
|
|
148
|
+
return cmd
|
|
149
|
+
end
|
|
150
|
+
#
|
|
151
|
+
alias :to_creole :to_wiki #fixme/to_doc(:wiki falsch
|
|
152
|
+
end #Item
|
|
150
153
|
|
|
151
154
|
=begin rdoc
|
|
152
|
-
HTML:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
HTML:
|
|
156
|
+
<dl>
|
|
157
|
+
<dt> <dd>
|
|
158
|
+
</dl>
|
|
156
159
|
|
|
157
160
|
LaTeX:
|
|
158
161
|
item with optional parameter.
|
|
159
162
|
Should be used only inside List::Description.
|
|
160
163
|
=end
|
|
161
|
-
class DT < Element
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
end
|
|
164
|
+
class DT < Element
|
|
165
|
+
add_attributes HTML_ATTR_ALL
|
|
166
|
+
add_html_tag 'dt'
|
|
167
|
+
def to_text(options={}); "\n#{@content.to_doc(:text, options )}: " end
|
|
168
|
+
def to_wiki(options={})
|
|
169
|
+
cmd = ''
|
|
170
|
+
cmd << "\n" if @crbefore
|
|
171
|
+
cmd << "\n;#{@content.to_doc(:wiki, options )}"
|
|
172
|
+
cmd << "\n"
|
|
173
|
+
return cmd
|
|
174
|
+
end
|
|
175
|
+
def to_latex( options={} )
|
|
176
|
+
cmd = ''
|
|
177
|
+
cmd << "\n" if @crbefore
|
|
178
|
+
cmd << "\n\\item[#{@content.to_doc(:latex, options)}] "
|
|
179
|
+
cmd << "\n" if @crafter
|
|
180
|
+
return cmd
|
|
181
|
+
end
|
|
182
|
+
end
|
|
180
183
|
=begin rdoc
|
|
181
|
-
HTML:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
HTML:
|
|
185
|
+
<dl>
|
|
186
|
+
<dt> <dd>
|
|
187
|
+
</dl>
|
|
185
188
|
|
|
186
189
|
Data for a description list.
|
|
187
190
|
=end
|
|
188
|
-
class DD < Element
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
end
|
|
207
|
-
end #module Lists
|
|
191
|
+
class DD < Element
|
|
192
|
+
add_attributes( HTML_ATTR_ALL )
|
|
193
|
+
def htmltag(); 'dd'; end
|
|
194
|
+
def to_text(options={}); "\n\t#{@content.to_doc(:text, options)}\n" end
|
|
195
|
+
def to_wiki(options={})
|
|
196
|
+
cmd = ''
|
|
197
|
+
cmd << "\n" if @crbefore
|
|
198
|
+
cmd << "\n:#{@content.to_doc(:wiki, options )}"
|
|
199
|
+
cmd << "\n"
|
|
200
|
+
return cmd
|
|
201
|
+
end
|
|
202
|
+
def to_latex( options={} )
|
|
203
|
+
cmd = ''
|
|
204
|
+
cmd << "\n" if @crbefore
|
|
205
|
+
cmd << " #{@content.to_doc(:latex, options )} "
|
|
206
|
+
cmd << "\n" if @crafter
|
|
207
|
+
return cmd
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end #module Lists
|
|
208
211
|
end #module Docgenerator
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
+
#encoding: utf-8
|
|
2
|
+
|
|
3
|
+
#
|
|
1
4
|
module Docgenerator
|
|
2
|
-
module Packages
|
|
5
|
+
module Packages
|
|
3
6
|
=begin rdoc
|
|
4
7
|
Support of package hyperref.sty
|
|
5
8
|
=end
|
|
6
|
-
module Hyperref
|
|
9
|
+
module Hyperref
|
|
7
10
|
|
|
8
11
|
=begin rdoc
|
|
9
12
|
Dynamic PDF-Features
|
|
10
13
|
=end
|
|
11
|
-
class HyperrefForm < Environments::Environment
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
end
|
|
14
|
+
class HyperrefForm < Environments::Environment
|
|
15
|
+
add_attribute:options, Attribute.create( [ :latex ], [nil] )
|
|
16
|
+
add_id :Form
|
|
17
|
+
|
|
18
|
+
add_latex_output {| options = {} |
|
|
19
|
+
option = "[#{@attr[:options].content.join(',')}]"
|
|
20
|
+
option = nil if option == '[]'
|
|
21
|
+
to_latex_environment( 'Form', option, options )
|
|
22
|
+
}
|
|
23
|
+
end
|
|
21
24
|
|
|
22
25
|
=begin rdoc
|
|
23
26
|
Define Element :Reset
|
|
@@ -28,9 +31,9 @@ or
|
|
|
28
31
|
Reset.new( [ attributes, [content]] )
|
|
29
32
|
Attributes are not defined for this element.
|
|
30
33
|
=end
|
|
31
|
-
class Reset < Element
|
|
32
|
-
|
|
33
|
-
end #Reset
|
|
34
|
+
class Reset < Element
|
|
35
|
+
add_latex_output '#{linebreak(@crbefore)}\Reset{#{@content}}#{linebreak(@crafter)}'
|
|
36
|
+
end #Reset
|
|
34
37
|
|
|
35
38
|
=begin rdoc
|
|
36
39
|
Define Element :CheckBox
|
|
@@ -44,13 +47,14 @@ Attributes may be:
|
|
|
44
47
|
* :onclick:
|
|
45
48
|
* :onblur:
|
|
46
49
|
=end
|
|
47
|
-
class Checkbox < Element
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
class Checkbox < Element
|
|
51
|
+
add_attribute :name, Attribute.create( [ :texkeyval ] )
|
|
52
|
+
add_attribute :checked, Attribute.create( [ :texkeyval ], [true,false] )
|
|
53
|
+
add_attribute :onblur, Attribute.create( [ :texkeyval ] )
|
|
54
|
+
add_attribute :onclick, Attribute.create( [ :texkeyval ] )
|
|
55
|
+
|
|
56
|
+
add_latex_output '#{linebreak(@crbefore)}\CheckBox[#{texkeyval()}]{#{@content}}#{linebreak(@crafter)}'
|
|
57
|
+
end #Checkbox
|
|
54
58
|
|
|
55
59
|
=begin rdoc
|
|
56
60
|
Define Element :PushButton
|
|
@@ -68,18 +72,18 @@ Attributes may be:
|
|
|
68
72
|
* :color:
|
|
69
73
|
* :backgroundcolor:
|
|
70
74
|
=end
|
|
71
|
-
class Pushbutton < Element
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
end #Pushbutton
|
|
75
|
+
class Pushbutton < Element
|
|
76
|
+
add_attribute :width, Attribute.create( [ :texkeyval ], nil, 5) #regexp not supported - CSS_WIDTH
|
|
77
|
+
add_attribute :height, Attribute.create( [ :texkeyval ], nil, 6) #regexp not supported - CSS_WIDTH
|
|
78
|
+
add_attribute :borderstyle, Attribute.create( [ :texkeyval ], ['S', 'D', 'B', 'I', 'U'], 10 ) #S (solid, durchgehend), D (dashed, gestrichelt), B (beveled, erhöht), I (inset, versenkt), U (unterstrichen)
|
|
79
|
+
add_attribute :bordercolor, Attribute.create( [ :texkeyval ], nil, 11 )
|
|
80
|
+
add_attribute :color, Attribute.create( [ :texkeyval ], nil, 15 )
|
|
81
|
+
add_attribute :backgroundcolor, Attribute.create( [ :texkeyval ], nil, 15 )
|
|
82
|
+
add_attribute :onclick, Attribute.create( [ :texkeyval ] )
|
|
83
|
+
#~ :onload => Attribute.create( [ :texkeyval ] ), - niht definiert
|
|
84
|
+
#~ :onmousemove => Attribute.create( [ :texkeyval ] ), nee, ghet nicht
|
|
85
|
+
add_latex_output '#{linebreak(@crbefore)}\PushButton[#{texkeyval()}]{#{@content}}#{linebreak(@crafter)}'
|
|
86
|
+
end #Pushbutton
|
|
83
87
|
|
|
84
88
|
=begin rdoc
|
|
85
89
|
Define Element :ChoiceMenu
|
|
@@ -100,19 +104,19 @@ Attributes may be:
|
|
|
100
104
|
* :color:
|
|
101
105
|
* :backgroundcolor:
|
|
102
106
|
=end
|
|
103
|
-
class Choicemenu < Element
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
end #Choicemenu
|
|
107
|
+
class Choicemenu < Element
|
|
108
|
+
add_attribute :name, Attribute.create( [ :required ] )
|
|
109
|
+
add_attribute :onblur, Attribute.create( [ :texkeyval ] )
|
|
110
|
+
add_attribute :default, Attribute.create( [ :texkeyval ] )
|
|
111
|
+
add_attribute :type, Attribute.create( [], ['combo', 'radiobutton'] )
|
|
112
|
+
add_attribute :width, Attribute.create( [ :texkeyval ], nil, 5)#regexp not supported - CSS_WIDTH
|
|
113
|
+
add_attribute :height, Attribute.create( [ :texkeyval ], nil, 6)#regexp not supported - CSS_WIDTH
|
|
114
|
+
add_attribute :borderstyle, Attribute.create( [ :texkeyval ], ['S', 'D', 'B', 'I', 'U'], 10 )
|
|
115
|
+
add_attribute :bordercolor, Attribute.create( [ :texkeyval ], nil, 11 )
|
|
116
|
+
add_attribute :color, Attribute.create( [ :texkeyval ], nil, 15 )
|
|
117
|
+
add_attribute :backgroundcolor, Attribute.create( [ :texkeyval ], nil, 15 )
|
|
118
|
+
add_latex_output '#{linebreak(@crbefore)}\ChoiceMenu[#{@attr[:type]},#{texkeyval()}]{#{@attr[:name]}}{#{@content}}#{linebreak(@crafter)}'
|
|
119
|
+
end #Choicemenu
|
|
116
120
|
|
|
117
121
|
=begin rdoc
|
|
118
122
|
Define Element :TextField
|
|
@@ -140,29 +144,29 @@ Attributes may be:
|
|
|
140
144
|
* :validate:
|
|
141
145
|
* :format:
|
|
142
146
|
=end
|
|
143
|
-
class Textfield < Element
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
end #Textfield
|
|
163
|
-
|
|
164
|
-
end #module Hyperref
|
|
165
|
-
end #module Packages
|
|
147
|
+
class Textfield < Element
|
|
148
|
+
add_attribute :onclick, Attribute.create( [ :texkeyval ] )
|
|
149
|
+
add_attribute :onblur, Attribute.create( [ :texkeyval ] ) #Action, when value changed
|
|
150
|
+
add_attribute :name, Attribute.create( [ :texkeyval ], [String, Symbol], 1 )
|
|
151
|
+
add_attribute :password, Attribute.create( [ :texkeyval ], nil, 3) #Ausgabe als *****
|
|
152
|
+
add_attribute :width, Attribute.create( [ :texkeyval ], nil, 5)
|
|
153
|
+
add_attribute :height, Attribute.create( [ :texkeyval ], nil, 6)
|
|
154
|
+
add_attribute :align, Attribute.create( [ :texkeyval ], [0,1,2], 7) #0=links, 1= center, 2 = right
|
|
155
|
+
add_attribute :borderstyle, Attribute.create( [ :texkeyval ], ['S', 'D', 'B', 'I', 'U'], 10 )
|
|
156
|
+
add_attribute :bordercolor, Attribute.create( [ :texkeyval ], nil, 11 )
|
|
157
|
+
add_attribute :color, Attribute.create( [ :texkeyval ], nil, 15 )
|
|
158
|
+
add_attribute :backgroundcolor, Attribute.create( [ :texkeyval ], nil, 15 )
|
|
159
|
+
add_attribute :multiline, Attribute.create( [ :texkeyval ], [true,false], 30 )
|
|
160
|
+
add_attribute :readonly, Attribute.create( [ :texkeyval ], [true,false], 31 )
|
|
161
|
+
add_attribute :hidden, Attribute.create( [ :texkeyval ], [true,false], 31 )
|
|
162
|
+
add_attribute :value, Attribute.create( [ :texkeyval ], [String, Array], 40 )
|
|
163
|
+
add_attribute :validate, Attribute.create( [ :texkeyval ], [String, Array], 40 )#Validation rule
|
|
164
|
+
add_attribute :format, Attribute.create( [ :texkeyval ], [String, Array], 40 )#Format rule
|
|
165
|
+
add_latex_output '#{linebreak(@crbefore)}\TextField[#{texkeyval()}]{#{@content}}#{linebreak(@crafter)}'
|
|
166
|
+
end #Textfield
|
|
167
|
+
|
|
168
|
+
end #module Hyperref
|
|
169
|
+
end #module Packages
|
|
166
170
|
end #module Docgenerator
|
|
167
171
|
__END__
|
|
168
172
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Docgenerator
|
|
2
|
+
module Packages
|
|
3
|
+
=begin rdoc
|
|
4
|
+
|
|
5
|
+
Example:
|
|
6
|
+
=end
|
|
7
|
+
class Multicols < Environments::Environment
|
|
8
|
+
add_attributes( {
|
|
9
|
+
:colnum => Attribute.create( [:latex], [ Fixnum ], 1 ),
|
|
10
|
+
:titleline => Attribute.create( [:latex], [ String], 2 ),
|
|
11
|
+
}#.update(HTML_ATTR_ALL)
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
def to_latex(options = {})
|
|
15
|
+
cmd = ''
|
|
16
|
+
cmd << "\n" if @crbefore
|
|
17
|
+
cmd << "\\begin{multicols}{"
|
|
18
|
+
cmd << @attr[:colnum].content.first.to_s
|
|
19
|
+
cmd << "}"
|
|
20
|
+
cmd << "[#{@attr[:titleline].content.join}]" if @attr[:titleline].filled?
|
|
21
|
+
cmd << "\n" if @crmid
|
|
22
|
+
cmd << @content.to_doc(:latex, options )
|
|
23
|
+
cmd << "\\end{multicols}"
|
|
24
|
+
cmd << "\n" if @crafter
|
|
25
|
+
return cmd
|
|
26
|
+
end
|
|
27
|
+
#Definition for header.
|
|
28
|
+
def self.head()
|
|
29
|
+
element(:usepackage, {}, 'multicol').cr
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end #module Packages
|
|
33
|
+
end #Docgenerator
|