docgenerator 1.2.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. data/build_test_and_doc.rb +505 -0
  2. data/examples/creole_example.rb +82 -0
  3. data/examples/creole_example_footnote.rb +67 -0
  4. data/examples/creole_example_placeholder.rb +77 -0
  5. data/examples/creole_example_rail.rb +154 -0
  6. data/examples/creole_example_rubycode.rb +144 -0
  7. data/examples/creole_example_struktex.rb +169 -0
  8. data/examples/docgenerator_example.rb +1 -1
  9. data/examples/docgenerator_example_footnote.rb +1 -0
  10. data/examples/docgenerator_example_list.rb +3 -0
  11. data/examples/docgenerator_example_restrictions.rb +1 -1
  12. data/examples/docgenerator_example_tabular.rb +1 -1
  13. data/examples/docgenerator_example_tripfalls.rb +2 -2
  14. data/examples/results/readme +2 -1
  15. data/examples/wiki2docgenerator_example.rb +61 -32
  16. data/lib/creole/creole2doc.rb +57 -58
  17. data/lib/creole/creole_characters.rb +56 -0
  18. data/lib/creole/creole_inclusion_and_plugins.rb +59 -284
  19. data/lib/creole/creole_inclusions.rb +142 -0
  20. data/lib/creole/creole_placeholder.rb +57 -23
  21. data/lib/creole/creole_plugins.rb +198 -0
  22. data/lib/creole/creole_tabular.rb +16 -8
  23. data/lib/creole/plugins/rail.rb +182 -0
  24. data/lib/creole/plugins/rubycode4creole.rb +136 -0
  25. data/lib/creole/plugins/struktex.rb +59 -0
  26. data/lib/creole/plugins/todonotes.rb +70 -0
  27. data/lib/docgenerator.rb +161 -71
  28. data/lib/docgenerator/attribute.rb +189 -156
  29. data/lib/docgenerator/characters.rb +824 -267
  30. data/lib/docgenerator/compatibility_v1.rb +249 -0
  31. data/lib/docgenerator/css.rb +53 -32
  32. data/lib/docgenerator/document.rb +119 -56
  33. data/lib/docgenerator/element.rb +304 -351
  34. data/lib/docgenerator/element_meta.rb +303 -0
  35. data/lib/docgenerator/elements.rb +1112 -481
  36. data/lib/docgenerator/environments.rb +153 -62
  37. data/lib/docgenerator/footnote.rb +30 -9
  38. data/lib/docgenerator/lists.rb +71 -47
  39. data/lib/docgenerator/packages/attachfile.rb +136 -0
  40. data/lib/{packages/docgenerator_caption.rb → docgenerator/packages/caption.rb} +28 -19
  41. data/lib/docgenerator/packages/hyperref.rb +194 -0
  42. data/lib/docgenerator/packages/listings.rb +179 -0
  43. data/lib/docgenerator/packages/pdfpages.rb +43 -0
  44. data/lib/docgenerator/packages/rubycode4doc.rb +227 -0
  45. data/lib/{packages/docgenerator_scrlettr2.rb → docgenerator/packages/scrlettr2.rb} +25 -16
  46. data/lib/docgenerator/packages/scrpage2.rb +410 -0
  47. data/lib/docgenerator/packages/struktex.rb +447 -0
  48. data/lib/docgenerator/packages/todonotes.rb +85 -0
  49. data/lib/{packages/docgenerator_url.rb → docgenerator/packages/url.rb} +7 -6
  50. data/lib/docgenerator/sections.rb +257 -83
  51. data/lib/docgenerator/standard.rb +19 -11
  52. data/lib/docgenerator/tabular.rb +234 -118
  53. data/lib/{templates → docgenerator/templates}/docgenerator_template.rb +52 -44
  54. data/lib/{templates → docgenerator/templates}/docgenerator_template.yaml +0 -0
  55. data/lib/{templates → docgenerator/templates}/docgenerator_template_css.rb +22 -16
  56. data/lib/wiki2doc/plugins/rubycode4wiki.rb +53 -0
  57. data/lib/wiki2doc/plugins/struktex.rb +12 -0
  58. data/lib/wiki2doc/wiki2docgenerator.rb +39 -38
  59. data/lib/wiki2doc/wikimedia_document.rb +24 -0
  60. data/manpage_elements.rb +10411 -0
  61. data/readme.rd +34 -24
  62. data/unittest/creole_testtext.creole +11 -0
  63. data/unittest/expected/test_document_usepackage_undefined.log +2 -2
  64. data/unittest/expected/test_runtex.stdout +0 -1
  65. data/unittest/expected/test_runtex_2.stdout +0 -1
  66. data/unittest/expected/toc_css.css +3 -2
  67. data/unittest/expected_creole/test_creole_characters_all.creole +28 -0
  68. data/unittest/expected_creole/test_creole_characters_all.html +15 -15
  69. data/unittest/expected_creole/test_creole_characters_all.latex +15 -15
  70. data/unittest/expected_creole/test_creole_footnotes_groupid.html +15 -0
  71. data/unittest/expected_creole/test_creole_links_file.html +2 -2
  72. data/unittest/expected_creole/test_creole_links_file.latex +2 -2
  73. data/unittest/expected_creole/test_creole_links_file.text +2 -2
  74. data/unittest/expected_creole/test_creole_picture_link.html +1 -1
  75. data/unittest/expected_creole_rail/test_rail_creole_object.tex +33 -0
  76. data/unittest/expected_creole_rail/test_rail_creole_placeholder.tex +40 -0
  77. data/unittest/expected_rubycode4doc/creole_complete.html +26 -0
  78. data/unittest/expected_rubycode4doc/creole_complete.tex +40 -0
  79. data/unittest/expected_rubycode4doc/creole_in_tab.html +4 -0
  80. data/unittest/expected_rubycode4doc/creole_in_tab.tex +6 -0
  81. data/unittest/expected_rubycode4doc/creole_inline_ruby.html +7 -0
  82. data/unittest/expected_rubycode4doc/creole_output.html +2 -0
  83. data/unittest/expected_rubycode4doc/creole_output.tex +4 -0
  84. data/unittest/expected_rubycode4doc/creole_rubycode.html +1 -0
  85. data/unittest/expected_rubycode4doc/creole_rubycode.tex +3 -0
  86. data/unittest/expected_rubycode4doc/creole_rubycode_evaluated.html +1 -0
  87. data/unittest/expected_rubycode4doc/creole_rubycode_evaluated.tex +3 -0
  88. data/unittest/expected_rubycode4doc/creole_rubycode_evaluated_listings.html +3 -0
  89. data/unittest/expected_rubycode4doc/creole_rubycode_evaluated_listings.tex +5 -0
  90. data/unittest/expected_rubycode4doc/wiki_1.html +8 -0
  91. data/unittest/expected_rubycode4doc/wiki_2.html +8 -0
  92. data/unittest/expected_rubycode4doc/wiki_3.html +9 -0
  93. data/unittest/expected_rubycode4doc/wiki_immediate_1.html +5 -0
  94. data/unittest/expected_rubycode4doc/wiki_immediate_2.html +5 -0
  95. data/unittest/expected_rubycode4doc/wiki_immediate_3.html +8 -0
  96. data/unittest/expected_rubycode4doc/wiki_immediate_full.html +21 -0
  97. data/unittest/expected_struktex/test_struktex_krug.creole +15 -0
  98. data/unittest/expected_struktex/test_struktex_krug.tex +19 -0
  99. data/unittest/expected_struktex/test_struktex_krug.wiki +15 -0
  100. data/unittest/expected_struktex/test_struktex_statement.creole +7 -0
  101. data/unittest/expected_struktex/test_struktex_statement.tex +9 -0
  102. data/unittest/expected_struktex/test_struktex_statement.wiki +7 -0
  103. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki.html +0 -0
  104. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki.latex +0 -0
  105. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki.text +0 -0
  106. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki.wiki +0 -0
  107. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_description.html +1 -1
  108. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_description.latex +1 -1
  109. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_description.text +1 -1
  110. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_description.wiki +1 -1
  111. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote.html +0 -0
  112. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote.latex +0 -0
  113. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote.text +0 -0
  114. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote.wiki +0 -0
  115. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote_2.html +0 -0
  116. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote_groupid.html +0 -0
  117. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_html_code.html +0 -0
  118. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_html_code.latex +0 -0
  119. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_html_code.text +0 -0
  120. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_html_code.wiki +0 -0
  121. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_inline.html +0 -0
  122. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_inline.latex +0 -0
  123. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_inline.text +0 -0
  124. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_inline.wiki +0 -0
  125. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_label.html +0 -0
  126. data/unittest/expected_wikimedia/test_wiki_link.html +8 -0
  127. data/unittest/expected_wikimedia/test_wiki_link.latex +17 -0
  128. data/unittest/expected_wikimedia/test_wiki_link.wiki +11 -0
  129. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol.html +0 -0
  130. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol.latex +0 -0
  131. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol.text +0 -0
  132. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol.wiki +0 -0
  133. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_after_ul.html +0 -0
  134. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_after_ul.latex +0 -0
  135. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_after_ul.text +0 -0
  136. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_after_ul.wiki +0 -0
  137. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_ul.html +0 -0
  138. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_ul.latex +0 -0
  139. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_ul.text +0 -0
  140. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_ul.wiki +0 -0
  141. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul.html +0 -0
  142. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul.latex +0 -0
  143. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul.text +0 -0
  144. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul.wiki +0 -0
  145. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul_too_much.html +0 -0
  146. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul_too_much.latex +0 -0
  147. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul_too_much.text +0 -0
  148. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul_too_much.wiki +0 -0
  149. data/unittest/expected_wikimedia/test_wiki_picture.html +55 -0
  150. data/unittest/expected_wikimedia/test_wiki_picture.latex +76 -0
  151. data/unittest/expected_wikimedia/test_wiki_picture_thumb.html +5 -0
  152. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_tab1.html +0 -0
  153. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_tab1.latex +0 -0
  154. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_tab1.wiki +0 -0
  155. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_textformatting.html +0 -0
  156. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_textformatting.latex +0 -0
  157. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_textformatting.text +0 -0
  158. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_textformatting.wiki +0 -0
  159. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_toc.html +0 -0
  160. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_toc.latex +0 -0
  161. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_toc.text +0 -0
  162. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_toc.wiki +0 -0
  163. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_ul_multiple_line.html +0 -0
  164. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_ul_multiple_line.latex +0 -0
  165. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_ul_multiple_line.text +0 -0
  166. data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_ul_multiple_line.wiki +0 -0
  167. data/unittest/{unittest_creole2doc.rb → unittest_creole.rb} +385 -476
  168. data/unittest/unittest_creole_placeholders.rb +272 -0
  169. data/unittest/unittest_creole_plugin_rail.rb +147 -0
  170. data/unittest/unittest_docgenerator.rb +206 -332
  171. data/unittest/unittest_docgenerator_characters.rb +650 -0
  172. data/unittest/unittest_docgenerator_runtex.rb +48 -20
  173. data/unittest/unittest_packages_struktex.rb +187 -0
  174. data/unittest/unittest_rubycode4doc.rb +275 -0
  175. data/unittest/unittest_wikimedia.rb +479 -0
  176. metadata +245 -172
  177. data/examples/results_expected/docgenerator_example.html +0 -39
  178. data/examples/results_expected/docgenerator_example.pdf +0 -0
  179. data/examples/results_expected/docgenerator_example.tex +0 -56
  180. data/examples/results_expected/docgenerator_example_footnote.html +0 -40
  181. data/examples/results_expected/docgenerator_example_footnote.pdf +0 -0
  182. data/examples/results_expected/docgenerator_example_footnote.tex +0 -50
  183. data/examples/results_expected/docgenerator_example_list.html +0 -18
  184. data/examples/results_expected/docgenerator_example_list.pdf +0 -0
  185. data/examples/results_expected/docgenerator_example_list.tex +0 -46
  186. data/examples/results_expected/docgenerator_example_restrictions.html +0 -22
  187. data/examples/results_expected/docgenerator_example_restrictions.pdf +0 -0
  188. data/examples/results_expected/docgenerator_example_restrictions.tex +0 -31
  189. data/examples/results_expected/docgenerator_example_tabular.html +0 -37
  190. data/examples/results_expected/docgenerator_example_tabular.pdf +0 -0
  191. data/examples/results_expected/docgenerator_example_tabular.tex +0 -41
  192. data/examples/results_expected/docgenerator_example_tripfalls.html +0 -27
  193. data/examples/results_expected/docgenerator_example_tripfalls.pdf +0 -0
  194. data/examples/results_expected/docgenerator_example_tripfalls.tex +0 -31
  195. data/lib/packages/docgenerator_attachfile.rb +0 -71
  196. data/lib/packages/docgenerator_hyperref.rb +0 -109
  197. data/lib/packages/docgenerator_listings.rb +0 -103
  198. data/lib/packages/docgenerator_pdfpages.rb +0 -24
  199. data/lib/packages/docgenerator_scrpage2.rb +0 -172
  200. data/self_docgenerator.rb +0 -163
  201. data/unittest/expected_wiki/test_wiki_link.html +0 -8
  202. data/unittest/expected_wiki/test_wiki_link.latex +0 -17
  203. data/unittest/expected_wiki/test_wiki_link.wiki +0 -11
  204. data/unittest/expected_wiki/test_wiki_picture.html +0 -55
  205. data/unittest/expected_wiki/test_wiki_picture.latex +0 -76
  206. data/unittest/expected_wiki/test_wiki_picture_thumb.html +0 -5
  207. data/unittest/test_rakefile_docgenerator.rb +0 -43
  208. data/unittest/unittest_versions.rb +0 -44
  209. data/unittest/unittest_wiki2doc.rb +0 -464
@@ -1,168 +1,201 @@
1
- #Administrate attributes for elements.
1
+ =begin rdoc
2
+ Define Attribute-class.
3
+
4
+ An Attribute is assigned to an Element.
5
+ It defines additional data outside the content of the Element.
6
+ =end
7
+
8
+ #
9
+
10
+ module Docgenerator
11
+ =begin rdoc
12
+ Administrate attributes for elements.
13
+
14
+ Attributes are the first parameters of element:
15
+ element( :type, {}, 'content' )
16
+ Element.new( {} )
17
+ =end
2
18
  class Attribute
3
- @@settings = {}
4
- @@values = {}
5
- @@sortkey = 99 #Just a counter to get identic positions between different program runs.
6
- #Generic creation of a new class to define a new Atttribute.
7
- #Settings is a hash with generell settings.
8
- #Supported parameters:
9
- #- :required
10
- #- :content adding values to this attribute add it to the content.
11
- #- :values allowed values
12
- #- :html used for html-output
13
- #- :latex used for latex-output
14
- #The sortkey is used for a sort-sequence of attributes.
15
- def Attribute.create( settings = [], values = nil, sortkey = (@@sortkey += 1 ) )
16
- #First some checks
17
- if ! settings.kind_of?( Array )
18
- raise "Type error Attribute.create: Expected Array, get #{attr.class}"
19
- end
20
- #Generic class creation
21
- attributeclass = Class.new( Attribute )
22
- #Set the flags.
23
- settings.each{|setting|
24
- case setting
25
- when :required
26
- attributeclass.class_eval('def required?(); true; end')
27
- when :content
28
- attributeclass.class_eval('def content?(); true; end')
29
- when :unique
30
- attributeclass.class_eval('def unique?(); true; end')
31
- when :html
32
- attributeclass.class_eval('def html?(); true; end')
33
- when :latex
34
- attributeclass.class_eval('def latex?(); true; end')
35
- when :texkeyval
36
- attributeclass.class_eval('def texkeyval?(); true; end')
37
- when :text
38
- attributeclass.class_eval('def text?(); true; end')
39
- when :wiki
40
- attributeclass.class_eval('def wiki?(); true; end')
41
- else
42
- DOCGENERATOR_LOGGER.error("Attribute: Unknown setting <#{setting.inspect}>") if DOCGENERATOR_LOGGER.error?
43
- end
44
- }
45
- if values
46
- attributeclass.class_eval("def allowed_values(); return #{values.inspect}; end")
47
- end
48
- attributeclass.class_eval("def sortkey(); return #{sortkey}; end")
49
- return attributeclass
50
- end
19
+ @@settings = {}
20
+ @@values = {}
21
+ @@sortkey = 99 #Just a counter to get identic positions between different program runs.
22
+ =begin rdoc
23
+ Generic creation of a new class to define a new Atttribute.
24
+ Settings is a hash with generell settings.
25
+
26
+ Supported parameters:
27
+ - :required
28
+ - :content adding values to this attribute add it to the content.
29
+ - :values allowed values
30
+ - :html used for html-output
31
+ - :latex used for latex-output
32
+ - :texkeyval used for latex-output with keyval-syntax.
33
+
34
+ The sortkey is used for a sort-sequence of attributes inside an element
35
+ =end
36
+ def self.create( settings = [], values = nil, sortkey = (@@sortkey += 1 ) )
37
+ #First some checks
38
+ if ! settings.kind_of?( Array )
39
+ raise "Type error Attribute.create: Expected Array, get #{attr.class}"
40
+ end
41
+ #Generic class creation
42
+ attributeclass = Class.new( Attribute )
43
+ #Set the flags.
44
+ settings.each{|setting|
45
+ case setting
46
+ when :required
47
+ attributeclass.class_eval('def required?(); true; end')
48
+ when :content
49
+ attributeclass.class_eval('def content?(); true; end')
50
+ when :unique
51
+ attributeclass.class_eval('def unique?(); true; end')
52
+ when :html
53
+ attributeclass.class_eval('def html?(); true; end')
54
+ when :latex
55
+ attributeclass.class_eval('def latex?(); true; end')
56
+ when :texkeyval
57
+ attributeclass.class_eval('def texkeyval?(); true; end')
58
+ when :text
59
+ attributeclass.class_eval('def text?(); true; end')
60
+ when :wiki
61
+ attributeclass.class_eval('def wiki?(); true; end')
62
+ when :creole
63
+ attributeclass.class_eval('def creole?(); true; end')
64
+ else
65
+ DOCGENERATOR_LOGGER.error("Attribute: Unknown setting <#{setting.inspect}>") if DOCGENERATOR_LOGGER.error?
66
+ end
67
+ }
68
+ if values
69
+ attributeclass.class_eval("def allowed_values(); return #{values.inspect}; end")
70
+ end
71
+ attributeclass.class_eval("def sortkey(); return #{sortkey}; end")
72
+ return attributeclass
73
+ end
51
74
 
52
- #Each attribute is assigned to an element.
53
- def initialize( name, element )
54
- @name = name
55
- @element = element
56
- @attr_content = []
57
- @part_of = [element] #list of elements, where this element is part of (normaly only one element)
58
- @part_of_doc = [] #list of documents, where this element is part of (normaly only one document)
59
- #@part_of_doc = element.part_of_doc May not work - is empty to generation time
60
-
61
- end
62
- #Return class settings. Can be used for some checks.
63
- def settings()
64
- @@settings
65
- end
66
- #Check if the attribute is required.
67
- #Redefined by Attribute.create and used in Element.to_s.
68
- def required?(); false; end
69
- #Check if the attribute can contain a "content".
70
- #Redefined by Attribute.create.
71
- def content?(); false; end
72
- #Values may be added only once.
73
- def unique?(); false; end
74
- #Sometimes the content of an attribute is needed directly.
75
- def content(); @attr_content; end
76
- #Check if content was added
77
- def filled?(); return @attr_content.compact.size > 0; end
78
- #Attribut is used for HTML.
79
- def html?(); false; end
80
- #Attribut is used for Text.
81
- def text?(); false; end
82
- #Attribut is used for Wiki.
83
- def wiki?(); false; end
84
- #Attribute is used for latex.
85
- #Only for informational reasons.
86
- def latex?(); false; end
87
- #Attribute is used as a keyval-option
88
- def texkeyval?(); false; end
89
- #Return all allowed values.
90
- #Redefined by Attribute.create and used in Attributes.<<
91
- #By default everything is allowed.
92
- #
93
- #This method must return an Array with the allowed values or classes.
94
- def allowed_values()
95
- return nil
96
- end
97
- #Check if the given value is allowed.
98
- def allowed?( value )
99
- return true if allowed_values() == nil
100
- allowed_values().each{|v|
101
- if value == v
102
- return true
103
- elsif v.class == Class and value.is_a?( v )
104
- return true
105
- end
106
- #Check next allowed value.
107
- }
108
- #No allowed value is set.
109
- return false
110
- #~ return allowed_values().include?( value )
111
- end
112
- #Add a value to the attribute content.
113
- def <<( value )
114
- if ! self.allowed?( value )
115
- puts "Attribute #{@name}: Illegal value #{value.inspect} in #{@element.inspect}"
116
- end
117
- if unique? and @attr_content.size > 0
118
- puts "Attribute #{@name}: More then one value added (#{value}) in #{@element.inspect}"
119
- return self
120
- end
121
- if content?
122
- @element << value
123
- else
124
- @attr_content << value
125
- end
126
- end
127
- #Return the content.
128
- def to_s()
129
- #~ def to_s( target = Document.target( self ) )
130
- #~ @attr_content.to_s() #Ruby 1.8
131
- @attr_content.join() #Ruby 1.9
132
- end
133
- def inspect()
134
- return "<#Attribute #{@name} #{@attr_content.inspect} (in #{@element.ids}) >"
135
- end
136
- end
75
+ #Each attribute is assigned to an element.
76
+ def initialize( name, element )
77
+ @name = name
78
+ @element = element
79
+ @attr_content = []
80
+ @part_of = [element] #list of elements, where this element is part of (normaly only one element)
81
+ @part_of_doc = [] #list of documents, where this element is part of (normaly only one document)
82
+ #@part_of_doc = element.part_of_doc May not work - is empty to generation time
83
+
84
+ end
85
+ #Key of the attribute
86
+ attr_reader :name
87
+ #Return class settings. Can be used for some checks.
88
+ def settings()
89
+ @@settings
90
+ end
91
+ #Check if the attribute is required.
92
+ #Redefined by Attribute.create and used in Element.to_s.
93
+ def required?(); false; end
94
+ #Check if the attribute can contain a "content".
95
+ #Redefined by Attribute.create.
96
+ def content?(); false; end
97
+ #Sometimes the content of an attribute is needed directly.
98
+ def content(); @attr_content; end
99
+ #Values may be added only once.
100
+ def unique?(); false; end
101
+ #Check if content was added
102
+ def filled?(); return @attr_content.compact.size > 0; end
103
+ #Attribut is used for HTML.
104
+ def html?(); false; end
105
+ #Attribut is used for Text.
106
+ def text?(); false; end
107
+ #Attribut is used for Wiki.
108
+ def wiki?(); false; end
109
+ #Attribut is used for Creole.
110
+ def creole?(); false; end
111
+ #Attribute is used for latex.
112
+ #Only for informational reasons.
113
+ def latex?(); false; end
114
+ #Attribute is used for conTeXt.
115
+ #Only for informational reasons.
116
+ def context?(); false; end
117
+ #Attribute is used as a keyval-option.
118
+ #See also Element#texkeyval
119
+ def texkeyval?(); false; end
120
+ #Return all allowed values.
121
+ #Redefined by Attribute.create and used in Attributes.<<
122
+ #By default everything is allowed.
123
+ #
124
+ #This method must return an Array with the allowed values or classes.
125
+ def allowed_values()
126
+ return nil
127
+ end
128
+ #Check if the given value is allowed.
129
+ def allowed?( value )
130
+ return true if allowed_values() == nil
131
+ allowed_values().each{|v|
132
+ if value == v #same value
133
+ return true
134
+ elsif v.is_a?(Regexp) and value =~ v
135
+ return true
136
+ elsif v.class == Class and value.is_a?( v ) #same class
137
+ return true
138
+ end
139
+ #Check next allowed value.
140
+ }
141
+ #No allowed value is set.
142
+ return false
143
+ #~ return allowed_values().include?( value )
144
+ end
145
+ #Add a value to the attribute content.
146
+ def << ( value )
147
+ if ! self.allowed?( value )
148
+ @element.log.warn("Attribute '#{@name}': Incorrect value '#{value.inspect}' for #{@element.inspect}") if @element.log.warn?
149
+ end
150
+ if unique? and @attr_content.size > 0
151
+ @element.log.warn("Attribute #{@name}: More then one value added to #{@element.inspect} (#{value.inspect})") if @element.log.warn?
152
+ return self
153
+ end
154
+ if content?
155
+ @element << value
156
+ else
157
+ @attr_content << value
158
+ end
159
+ end
160
+ #Return the content.
161
+ def to_s()
162
+ #~ @attr_content.to_s() #Ruby 1.8
163
+ @attr_content.join() #since Ruby 1.9
164
+ end
165
+ def inspect()
166
+ return "<#Attribute #{@name} #{@attr_content.inspect} (in #{@element.inspect}) >"
167
+ end
168
+ end #Attribute
137
169
 
138
170
  #Definition of HTML-Tags (Sublasses of Element).
139
- ATTR_LANG = Attribute.create( [ :html ], ['en', 'de'] )
171
+ ATTR_LANG = Attribute.create( [ :html ], ['en', 'de'] )
140
172
  #
141
- HTML_ATTR_CORE = {
142
- :id => Attribute.create( [ :html ] ),
143
- :class => Attribute.create( [ :html ] ),
144
- :style => Attribute.create( [ :html ], [CSS, String]), #fixm string raus
145
- #~ :name => Attribute.create( [ :html ] ),
146
- :title => Attribute.create( [ :html ] ) }
147
- HTML_ATTR_I18N = {
148
- :lang => ATTR_LANG,
149
- :dir => Attribute.create( [ :html ], ['ltr', 'rtl'] )
173
+ HTML_ATTR_CORE = {
174
+ :id => Attribute.create( [ :html ] ),
175
+ :class => Attribute.create( [ :html ] ),
176
+ :style => Attribute.create( [ :html ], [CSS, String]), #fixme string raus
177
+ #~ :name => Attribute.create( [ :html ] ),
178
+ :title => Attribute.create( [ :html ] ) }
179
+ HTML_ATTR_I18N = {
180
+ :lang => ATTR_LANG,
181
+ :dir => Attribute.create( [ :html ], ['ltr', 'rtl'] )
150
182
  }
151
- HTML_ATTR_EVENTS = { :onclick => Attribute.create( [ :html ] ),
152
- :ondblclick => Attribute.create( [ :html ] ),
153
- :onmousedown => Attribute.create( [ :html ] ),
154
- :onmouseup => Attribute.create( [ :html ] ),
155
- :onmouseover => Attribute.create( [ :html ] ),
156
- :onmousemove => Attribute.create( [ :html ] ),
157
- :onmouseout => Attribute.create( [ :html ] ),
158
- :onkeypress => Attribute.create( [ :html ] ),
159
- :onkeyup => Attribute.create( [ :html ] ),
160
- :onkeydown => Attribute.create( [ :html ] )
183
+ HTML_ATTR_EVENTS = { :onclick => Attribute.create( [ :html ] ),
184
+ :ondblclick => Attribute.create( [ :html ] ),
185
+ :onmousedown => Attribute.create( [ :html ] ),
186
+ :onmouseup => Attribute.create( [ :html ] ),
187
+ :onmouseover => Attribute.create( [ :html ] ),
188
+ :onmousemove => Attribute.create( [ :html ] ),
189
+ :onmouseout => Attribute.create( [ :html ] ),
190
+ :onkeypress => Attribute.create( [ :html ] ),
191
+ :onkeyup => Attribute.create( [ :html ] ),
192
+ :onkeydown => Attribute.create( [ :html ] )
161
193
  }
162
194
  HTML_ATTR_ALL = {}
163
195
  HTML_ATTR_ALL.update(HTML_ATTR_I18N)
164
196
  HTML_ATTR_ALL.update(HTML_ATTR_EVENTS)
165
197
  HTML_ATTR_ALL.update(HTML_ATTR_CORE)
166
198
 
167
- HTML_ATTR_ALIGN = Attribute.create( [ :html ], ['left', 'center', 'right', 'justify', 'char'] )
168
- HTML_ATTR_VALIGN = Attribute.create( [ :html ], ['bottom', 'top', 'middle', 'baseline'] )
199
+ HTML_ATTR_ALIGN = Attribute.create( [ :html ], ['left', 'center', 'right', 'justify', 'char'] )
200
+ HTML_ATTR_VALIGN = Attribute.create( [ :html ], ['bottom', 'top', 'middle', 'baseline'] )
201
+ end #module Docgenerator
@@ -1,271 +1,828 @@
1
- # encoding: utf-8
2
-
3
- #Some Coding to prepare the unit tests
4
- #~ els = nil
5
- #~ DATA.each{|line|
6
- #~ case line
7
- #~ when /\A\s*#/ #skip
8
- #~ when /Element.create\( \[(.*)\]/
9
- #~ els = $1.split(',').map{|el| el.strip }
10
- #~ when /:(html|latex|wiki|text)\s*=>\s*'(.+?)'/
11
- #~ els.each{|el|
12
- #~ puts " assert_equal( '#{$2}', element(#{el}).to_#{$1})"
13
- #~ }
14
- #~ end
15
- #~ }
16
-
17
- #~ __END__
1
+ #encoding: utf-8
2
+ =begin rdoc
3
+ Define special characters.
4
+
5
+ This document is UTF-8-encoded.
6
+ A side effect: Hanna/Rdoc will not add this code to the documentation.
7
+ =end
8
+
9
+
18
10
  #
19
- # Special Characters
11
+ module Docgenerator
12
+ =begin rdoc
13
+ Collection of characters.
14
+
15
+ Elements inside this module represent special characters and
16
+ there representation in HTML, LaTeX...
17
+ =end
18
+ module Characters
19
+
20
20
  #
21
- Element.create( [:shy ], {},false,
22
- { :html => '&shy;',
23
- :latex => '"-', #only with babel/ngerman
24
- :text => '',
25
- :creole => '{{shy}}',
26
- } )
27
- Element.create( [:space, :ensp], {},false,
28
- { :html => '&ensp;',
29
- :latex => '~'
30
- } )
31
- Element.create( [:bigspace, :emsp], {},false,
32
- { :html => '&emsp;',
33
- :latex => '~~'
34
- } )
35
- Element.create( [:nbsp], {},false,
36
- { :html => '&nbsp;',
37
- :latex => '~'
38
- } )
21
+ # Special Characters
39
22
  #
40
- #Requires \usepackage[right,eurosym]{eurofont}
41
- # @head << element(:usepackage, {:option=>'right,eurosym' }, 'eurofont' )
42
- Element.create( [:euro], {},false,
43
- { :html => '&euro;',
44
- :latex => '\euro'
45
- } )
46
-
47
- Element.create( [:percent, :'%'], {},false,
48
- { :html => '%',
49
- :latex => '\%'
50
- } )
51
-
52
- Element.create( [:dollar, :'$'], {},false,
53
- { :html => '$',
54
- :latex => '\$',
55
- :creole => '$',
56
- :wiki => '$',
57
- :text => '$',
58
- } )
59
-
60
- Element.create( [:'^'], {},false,
61
- { :html => '^',
62
- :latex => '\hat{}'
63
- } )
64
-
65
- Element.create( [:iquest ], {},false, #¿ umgekehrtes Fragezeichen
66
- { :html => '&iquest;',
67
- :latex => '¿', #?`
68
- :creole => '¿',
69
- :wiki => '¿',
70
- :text => '¿',
71
- } )
72
-
73
-
74
- Element.create( [:ampersand, :'&'], {},false,
75
- { :html => '&amp;',
76
- :latex => '\&',
77
- :text => '&',
78
- } )
79
-
80
- Element.create( [:rbrace, :'}'], {},false,
81
- { :html => '}',
82
- :latex => '\}'
83
- } )
84
- Element.create( [:lbrace, :'{'], {},false,
85
- { :html => '{',
86
- :latex => '\{'
87
- } )
88
-
89
- Element.create( [:backslash ], {},false,
90
- { :html => '\\',
91
- :latex => '\ensuremath{\backslash}'
92
- } )
93
-
94
- Element.create( [:radic], {},false,
95
- { :html => '&radic;',
96
- :latex => '\ensuremath{\sqrt{}}'
97
- } )
98
-
99
- Element.create( [:rarr, :rightarrow, :'->'], {},false,
100
- { :html => '&rarr;',
101
- :latex => '\ensuremath{\rightarrow}',
102
- :text => '->',
103
- } )
104
-
105
- Element.create( [:rArr, :Rightarrow, :'=>'], {},false,
106
- { :html => '&rArr;',
107
- :latex => '\ensuremath{\Rightarrow}',
108
- :text => '=>',
109
- } )
110
- Element.create( [:larr, :leftarrow, :'<-'], {},false,
111
- { :html => '&larr;',
112
- :latex => '\ensuremath{\leftarrow}',
113
- :text => '<-',
114
- } )
115
-
116
- Element.create( [:lArr, :Leftarrow, :'<='], {},false,
117
- { :html => '&lArr;',
118
- :latex => '\ensuremath{\Lefttarrow}',
119
- :text => '<=',
120
- } )
121
-
122
- Element.create( [:uArr, :Uparrow ], {},false,
123
- { :html => '&uArr;',
124
- :latex => '\ensuremath{\Uparrow}'
125
- } )
126
-
127
- Element.create( [:uarr, :uparrow ], {},false,
128
- { :html => '&uarr;',
129
- :latex => '\ensuremath{\uparrow}'
130
- } )
131
-
132
- Element.create( [:dArr, :Downarrow ], {},false,
133
- { :html => '&dArr;',
134
- :latex => '\ensuremath{\Downarrow}'
135
- } )
136
-
137
- Element.create( [:darr, :downarrow ], {},false,
138
- { :html => '&darr;',
139
- :latex => '\ensuremath{\downarrow}'
140
- } )
141
-
142
-
143
- Element.create( [:lt, :'<'], {},false,
144
- { :html => '&lt;',
145
- :latex => '\ensuremath{<}'
146
- } )
147
- Element.create( [:gt, :'>'], {},false,
148
- { :html => '&gt;',
149
- :latex => '\ensuremath{>}'
150
- } )
151
-
152
- Element.create( [:infin, :infty], {},false,
153
- { :html => '&infin;',
154
- :latex => '\ensuremath{\infty}'
155
- } )
156
-
157
- Element.create( [:divide ], {},false,
158
- { :html => '&divide;',
159
- :latex => '\ensuremath{\div}'
160
- } )
161
-
162
- Element.create( [:yen], {},false,
163
- { :html => '&yen;',
164
- #~ :latex => '\ensuremath{\infty}'
165
- } )
166
-
167
- Element.create( [:sim ], {},false,
168
- { :html => '&sim;',
169
- :latex => '\ensuremath{\sim}'
170
- } )
171
-
172
- Element.create( [:brvbar ], {},false, #durchbrochener Strich
173
- { :html => '&brvbar;',
174
- :latex => '|' #not really correct
175
- #~ :latex => '\ensuremath{\sim}'
176
- } )
177
-
178
- Element.create( [:euros], {},true,
179
- { :html => '#{@content}&euro;',
180
- :latex => '\euros{#{@content}}'
181
- } )
182
-
183
-
184
- Element.create( [:neg, :not], {},false,
185
- { :html => '&not;',
186
- :latex => '\ensuremath{\neg}'
187
- } )
188
-
189
- Element.create( [:times], {},false,
190
- { :html => '&times;',
191
- :latex => '\ensuremath{\times}'
192
- } )
193
-
194
- Element.create( [:otimes], {},false,
195
- { :html => '&otimes;',
196
- :latex => '\ensuremath{\otimes}'
197
- } )
198
-
199
- Element.create( [:empty], {},false,
200
- { :html => '&empty;',
201
- :latex => '\ensuremath{\emptyset}' #fixme richtig?
202
- } )
203
-
204
- Element.create( [:'_', :underscore], {},false,
205
- { :html => '_',
206
- :latex => '\_',
207
- :wiki => '_',
208
- :text => '_',
209
- } )
210
-
211
- Element.create( [:'...', :ldots], {},false,
212
- { :html => '&hellip;',
213
- :latex => '\ldots ',
214
- } )
215
-
216
- Element.create( [:bullet], {},false,
217
- { :html => '&#149;',
218
- :latex => '\ensuremath{\bullet}'
219
- } )
220
- Element.create( [:'--', :ndash], {},false,
221
- { :html => '&ndash;', #'&#8211;'
222
- #:html => '&#150;',
223
- :latex => '--',
224
- } )
225
- Element.create( [:'---', :mdash], {},false,
226
- { :html => '&mdash;', #'&#8212;'
227
- #:html => '&#151;',
228
- :latex => '---'
229
- } )
230
- Element.create( [:dagger], {},false,
231
- { :html => '&dagger;',
232
- :latex => '\dag'
233
- } )
234
-
235
- #See http://www.cs.sfu.ca/~ggbaker/reference/characters/#double
236
- Element.create( [:bdquo], {},false,
237
- { :html => '&bdquo;',
238
- :latex => '"',
239
- :creole => '{{bdquo}}',
240
- } )
241
- Element.create( [:ldquo], {},false,
242
- { :html => '&ldquo;',
243
- :latex => '``',
244
- :text => '``',
245
- :creole => '{{ldquo}}',
246
- } )
247
- Element.create( [:rdquo], {},false,
248
- { :html => '&rdquo;',
249
- :latex => "''",
250
- :text => "''",
251
- :creole => '{{rdquo}}',
252
- } )
23
+
24
+ =begin rdoc
25
+ Define Element :shy
26
+
27
+ Create an instance with
28
+ element( :shy )
29
+ or
30
+ Shy.new( )
31
+ Attributes are not defined for this element.
32
+ =end
33
+ class Shy < Element
34
+ has_no_content false
35
+ add_html_output '&shy;'
36
+ add_latex_output '"-'
37
+ add_text_output ''
38
+ add_creole_output '{{shy}}'
39
+ end #Shy
40
+
41
+ =begin rdoc
42
+ Define Element :space, :ensp
43
+
44
+ Create an instance with
45
+ element( :space )
46
+ element( :ensp )
47
+ or
48
+ Space.new( )
49
+ Attributes are not defined for this element.
50
+ =end
51
+ class Space < Element
52
+ add_id :ensp
53
+ has_no_content false
54
+ add_html_output '&ensp;'
55
+ add_latex_output '~'
56
+ end #Space
57
+
58
+ =begin rdoc
59
+ Define Element :bigspace, :emsp
60
+
61
+ Create an instance with
62
+ element( :bigspace )
63
+ element( :emsp )
64
+ or
65
+ Bigspace.new( )
66
+ Attributes are not defined for this element.
67
+ =end
68
+ class Bigspace < Element
69
+ add_id :emsp
70
+ has_no_content false
71
+ add_html_output '&emsp;'
72
+ add_latex_output '~~'
73
+ end #Bigspace
74
+
75
+ =begin rdoc
76
+ Define Element :nbsp
77
+
78
+ Create an instance with
79
+ element( :nbsp )
80
+ or
81
+ Nbsp.new( )
82
+ Attributes are not defined for this element.
83
+ =end
84
+ class Nbsp < Element
85
+ has_no_content false
86
+ add_html_output '&nbsp;'
87
+ add_latex_output '~'
88
+ end #Nbsp
89
+
90
+ =begin rdoc
91
+ Define Element :euro
92
+
93
+ Create an instance with
94
+ element( :euro )
95
+ or
96
+ Euro.new( )
97
+ Attributes are not defined for this element.
98
+ =end
99
+ class Euro < Element
100
+ has_no_content false
101
+ add_html_output '&euro;'
102
+ add_latex_output '\euro'
103
+ end #Euro
104
+
105
+ =begin rdoc
106
+ Define Element :euros
107
+
108
+ Requires \usepackage[right,eurosym]{eurofont}
109
+ @head << element(:usepackage, {:option=>'right,eurosym' }, 'eurofont' )
110
+
111
+
112
+ Create an instance with
113
+ element( :euros, )
114
+ or
115
+ Euros.new( [ attributes, [content]] )
253
116
 
254
- #einfaches low-9-Zeichen
255
- Element.create( [:sbquo], {},false,
256
- { :html => '&sbquo;',
257
- #~ :latex => '‚', #‚ -> kein Komma ,
258
- :creole => '{{sbquo}}',
259
- } )
260
- Element.create( [:lsquo], {},false,
261
- { :html => '&lsquo;',
262
- :latex => '`',
263
- :text => '`',
264
- :creole => '{{lsquo}}',
265
- } )
266
- Element.create( [:rsquo], {},false,
267
- { :html => '&rsquo;',
268
- :latex => "’",
269
- :text => "’",
270
- :creole => '{{rsquo}}',
271
- } )
117
+ Attributes are not defined for this element.
118
+
119
+ You may add a value to the unit.
120
+ =end
121
+ class Euros < Element
122
+ add_html_output '#{@content}&euro;'
123
+ add_latex_output '\euros{#{@content}}'
124
+ end #Euros
125
+
126
+ =begin rdoc
127
+ Define Element :percent, :%
128
+
129
+ Create an instance with
130
+ element( :percent )
131
+ element( :% )
132
+ or
133
+ Percent.new( )
134
+ Attributes are not defined for this element.
135
+ =end
136
+ class Percent < Element
137
+ add_id :%
138
+ has_no_content false
139
+ add_html_output '%'
140
+ add_latex_output '\%'
141
+ end #Percent
142
+
143
+ =begin rdoc
144
+ Define Element :dollar, :"$"
145
+
146
+ Create an instance with
147
+ element( :dollar )
148
+ element( :"$" )
149
+ or
150
+ Dollar.new( )
151
+ Attributes are not defined for this element.
152
+ =end
153
+ class Dollar < Element
154
+ add_id :"$"
155
+ has_no_content false
156
+ add_html_output '$'
157
+ add_latex_output '\$'
158
+ add_creole_output '$'
159
+ add_wiki_output '$'
160
+ add_text_output '$'
161
+ end #Dollar
162
+
163
+ =begin rdoc
164
+ Define Element :^
165
+
166
+ Create an instance with
167
+ element( :^ )
168
+ or
169
+ ^.new( )
170
+ Attributes are not defined for this element.
171
+ =end
172
+ class Hat < Element
173
+ add_id :'^'
174
+ has_no_content false
175
+ add_html_output '^'
176
+ add_latex_output '\hat{}'
177
+ end #^
178
+
179
+ =begin rdoc
180
+ Define Element :iquest
181
+
182
+ Create an instance with
183
+ element( :iquest )
184
+ or
185
+ Iquest.new( )
186
+ Attributes are not defined for this element.
187
+ =end
188
+ class Iquest < Element
189
+ has_no_content false
190
+ add_html_output '&iquest;'
191
+ add_latex_output '¿'
192
+ add_creole_output '¿'
193
+ add_wiki_output '¿'
194
+ add_text_output '¿'
195
+ end #Iquest
196
+
197
+ =begin rdoc
198
+ Define Element :ampersand, :&
199
+
200
+ Create an instance with
201
+ element( :ampersand )
202
+ element( :& )
203
+ or
204
+ Ampersand.new( )
205
+ Attributes are not defined for this element.
206
+ =end
207
+ class Ampersand < Element
208
+ add_id :&
209
+ has_no_content false
210
+ add_html_output '&amp;'
211
+ add_latex_output '\&'
212
+ add_text_output '&'
213
+ end #Ampersand
214
+
215
+ =begin rdoc
216
+ Define Element :rbrace, :"}"
217
+
218
+ Create an instance with
219
+ element( :rbrace )
220
+ element( :"}" )
221
+ or
222
+ Rbrace.new( )
223
+ Attributes are not defined for this element.
224
+ =end
225
+ class Rbrace < Element
226
+ add_id :"}"
227
+ has_no_content false
228
+ add_html_output '}'
229
+ add_latex_output '\}'
230
+ end #Rbrace
231
+
232
+ =begin rdoc
233
+ Define Element :lbrace, :"{"
234
+
235
+ Create an instance with
236
+ element( :lbrace )
237
+ element( :"{" )
238
+ or
239
+ Lbrace.new( )
240
+ Attributes are not defined for this element.
241
+ =end
242
+ class Lbrace < Element
243
+ add_id :"{"
244
+ has_no_content false
245
+ add_html_output '{'
246
+ add_latex_output '\{'
247
+ end #Lbrace
248
+
249
+ =begin rdoc
250
+ Define Element :backslash
251
+
252
+ Create an instance with
253
+ element( :backslash )
254
+ or
255
+ Backslash.new( )
256
+ Attributes are not defined for this element.
257
+ =end
258
+ class Backslash < Element
259
+ has_no_content false
260
+ add_html_output '\\'
261
+ add_latex_output '\ensuremath{\backslash}'
262
+ end #Backslash
263
+
264
+ =begin rdoc
265
+ Define Element :radic
266
+
267
+ Create an instance with
268
+ element( :radic )
269
+ or
270
+ Radic.new( )
271
+ Attributes are not defined for this element.
272
+ =end
273
+ class Radic < Element
274
+ has_no_content false
275
+ add_html_output '&radic;'
276
+ add_latex_output '\ensuremath{\sqrt{}}'
277
+ end #Radic
278
+
279
+ =begin rdoc
280
+ Define Element :rarr, :rightarrow, :"->"
281
+
282
+ Create an instance with
283
+ element( :rarr )
284
+ element( :rightarrow )
285
+ element( :"->" )
286
+ or
287
+ Rightarrow.new( )
288
+ Attributes are not defined for this element.
289
+ =end
290
+ class Rightarrow < Element
291
+ add_id :rarr
292
+ add_id :"->"
293
+ has_no_content false
294
+ add_html_output '&rarr;'
295
+ add_latex_output '\ensuremath{\rightarrow}'
296
+ add_text_output '->'
297
+ add_creole_output '->'
298
+ end #Rarr
299
+
300
+ =begin rdoc
301
+ Define Element :rArr, :Rightarrow, :"=>"
302
+
303
+ Create an instance with
304
+ element( :rArr )
305
+ element( :Rightarrow )
306
+ element( :"=>" )
307
+ or
308
+ RRightarrow.new( )
309
+ Attributes are not defined for this element.
310
+ =end
311
+ class RRightarrow < Element
312
+ add_id :Rightarrow
313
+ add_id :rArr
314
+ add_id :"=>"
315
+ has_no_content false
316
+ add_html_output '&rArr;'
317
+ add_latex_output '\ensuremath{\Rightarrow}'
318
+ add_text_output '=>'
319
+ add_creole_output '=>'
320
+ end #Rarr
321
+
322
+ =begin rdoc
323
+ Define Element :larr, :leftarrow, :"<-"
324
+
325
+ Create an instance with
326
+ element( :larr )
327
+ element( :leftarrow )
328
+ element( :"<-" )
329
+ or
330
+ Larr.new( )
331
+ Attributes are not defined for this element.
332
+ =end
333
+ class Leftarrow < Element
334
+ add_id :larr
335
+ add_id :"<-"
336
+ has_no_content false
337
+ add_html_output '&larr;'
338
+ add_latex_output '\ensuremath{\leftarrow}'
339
+ add_text_output '<-'
340
+ add_creole_output '<-'
341
+ end #Larr
342
+
343
+ =begin rdoc
344
+ Define Element :lArr, :Leftarrow, :<=
345
+
346
+ Create an instance with
347
+ element( :lArr )
348
+ element( :Leftarrow )
349
+ element( :<= )
350
+ or
351
+ LLeftarrow.new( )
352
+ Attributes are not defined for this element.
353
+ =end
354
+ class LLeftarrow < Element
355
+ add_id :Leftarrow
356
+ add_id :lArr
357
+ add_id :<=
358
+ has_no_content false
359
+ add_html_output '&lArr;'
360
+ add_latex_output '\ensuremath{\Lefttarrow}'
361
+ add_text_output '<='
362
+ add_creole_output '<='
363
+ end #Larr
364
+
365
+ =begin rdoc
366
+ Define Element :uArr, :Uparrow
367
+
368
+ Create an instance with
369
+ element( :uArr )
370
+ element( :Uparrow )
371
+ or
372
+ UUparrow.new( )
373
+ Attributes are not defined for this element.
374
+ =end
375
+ class UUparrow < Element
376
+ add_id :Uparrow
377
+ add_id :uArr
378
+ has_no_content false
379
+ add_html_output '&uArr;'
380
+ add_latex_output '\ensuremath{\Uparrow}'
381
+ end #Uarr
382
+
383
+ =begin rdoc
384
+ Define Element :uarr, :uparrow
385
+
386
+ Create an instance with
387
+ element( :uarr )
388
+ element( :uparrow )
389
+ or
390
+ Uparrow.new( )
391
+ Attributes are not defined for this element.
392
+ =end
393
+ class Uparrow < Element
394
+ add_id :uarr
395
+ has_no_content false
396
+ add_html_output '&uarr;'
397
+ add_latex_output '\ensuremath{\uparrow}'
398
+ end #Uarr
399
+
400
+ =begin rdoc
401
+ Define Element :dArr, :Downarrow
402
+
403
+ Create an instance with
404
+ element( :dArr )
405
+ element( :Downarrow )
406
+ or
407
+ DDownarrow.new( )
408
+ Attributes are not defined for this element.
409
+ =end
410
+ class DDownarrow < Element
411
+ add_id :Downarrow
412
+ add_id :dArr
413
+ has_no_content false
414
+ add_html_output '&dArr;'
415
+ add_latex_output '\ensuremath{\Downarrow}'
416
+ end #Darr
417
+
418
+ =begin rdoc
419
+ Define Element :darr, :downarrow
420
+
421
+ Create an instance with
422
+ element( :darr )
423
+ element( :downarrow )
424
+ or
425
+ Darr.new( )
426
+ Attributes are not defined for this element.
427
+ =end
428
+ class Downarrow < Element
429
+ add_id :darr
430
+ has_no_content false
431
+ add_html_output '&darr;'
432
+ add_latex_output '\ensuremath{\downarrow}'
433
+ end #Darr
434
+
435
+ =begin rdoc
436
+ Define Element :lt, :<
437
+
438
+ Create an instance with
439
+ element( :lt )
440
+ element( :< )
441
+ or
442
+ Lt.new( )
443
+ Attributes are not defined for this element.
444
+ =end
445
+ class Lt < Element
446
+ add_id :<
447
+ has_no_content false
448
+ add_html_output '&lt;'
449
+ add_latex_output '\ensuremath{<}'
450
+ end #Lt
451
+
452
+ =begin rdoc
453
+ Define Element :gt, :>
454
+
455
+ Create an instance with
456
+ element( :gt )
457
+ element( :> )
458
+ or
459
+ Gt.new( )
460
+ Attributes are not defined for this element.
461
+ =end
462
+ class Gt < Element
463
+ add_id :>
464
+ has_no_content false
465
+ add_html_output '&gt;'
466
+ add_latex_output '\ensuremath{>}'
467
+ end #Gt
468
+
469
+ =begin rdoc
470
+ Define Element :infin, :infty
471
+
472
+ Create an instance with
473
+ element( :infin )
474
+ element( :infty )
475
+ or
476
+ Infin.new( )
477
+ Attributes are not defined for this element.
478
+ =end
479
+ class Infin < Element
480
+ add_id :infty
481
+ has_no_content false
482
+ add_html_output '&infin;'
483
+ add_latex_output '\ensuremath{\infty}'
484
+ end #Infin
485
+
486
+ =begin rdoc
487
+ Define Element :divide
488
+
489
+ Create an instance with
490
+ element( :divide )
491
+ or
492
+ Divide.new( )
493
+ Attributes are not defined for this element.
494
+ =end
495
+ class Divide < Element
496
+ has_no_content false
497
+ add_html_output '&divide;'
498
+ add_latex_output '\ensuremath{\div}'
499
+ end #Divide
500
+
501
+ =begin rdoc
502
+ Define Element :yen
503
+
504
+ Create an instance with
505
+ element( :yen )
506
+ or
507
+ Yen.new( )
508
+ Attributes are not defined for this element.
509
+ =end
510
+ class Yen < Element
511
+ has_no_content false
512
+ add_html_output '&yen;'
513
+ end #Yen
514
+
515
+ =begin rdoc
516
+ Define Element :sim
517
+
518
+ Create an instance with
519
+ element( :sim )
520
+ or
521
+ Sim.new( )
522
+ Attributes are not defined for this element.
523
+ =end
524
+ class Sim < Element
525
+ has_no_content false
526
+ add_html_output '&sim;'
527
+ add_latex_output '\ensuremath{\sim}'
528
+ end #Sim
529
+
530
+ =begin rdoc
531
+ Define Element :brvbar
532
+
533
+ Create an instance with
534
+ element( :brvbar )
535
+ or
536
+ Brvbar.new( )
537
+ Attributes are not defined for this element.
538
+ =end
539
+ class Brvbar < Element
540
+ has_no_content false
541
+ add_html_output '&brvbar;'
542
+ add_latex_output '|'
543
+ end #Brvbar
544
+
545
+
546
+ =begin rdoc
547
+ Define Element :neg, :not
548
+
549
+ Create an instance with
550
+ element( :neg )
551
+ element( :not )
552
+ or
553
+ Neg.new( )
554
+ Attributes are not defined for this element.
555
+ =end
556
+ class Neg < Element
557
+ add_id :not
558
+ has_no_content false
559
+ add_html_output '&not;'
560
+ add_latex_output '\ensuremath{\neg}'
561
+ end #Neg
562
+
563
+ =begin rdoc
564
+ Define Element :times
565
+
566
+ Create an instance with
567
+ element( :times )
568
+ or
569
+ Times.new( )
570
+ Attributes are not defined for this element.
571
+ =end
572
+ class Times < Element
573
+ has_no_content false
574
+ add_html_output '&times;'
575
+ add_latex_output '\ensuremath{\times}'
576
+ end #Times
577
+
578
+ =begin rdoc
579
+ Define Element :otimes
580
+
581
+ Create an instance with
582
+ element( :otimes )
583
+ or
584
+ Otimes.new( )
585
+ Attributes are not defined for this element.
586
+ =end
587
+ class Otimes < Element
588
+ has_no_content false
589
+ add_html_output '&otimes;'
590
+ add_latex_output '\ensuremath{\otimes}'
591
+ end #Otimes
592
+
593
+ =begin rdoc
594
+ Define Element :empty
595
+
596
+ Create an instance with
597
+ element( :empty )
598
+ or
599
+ Empty.new( )
600
+ Attributes are not defined for this element.
601
+ =end
602
+ class Empty < Element
603
+ add_id :emptyset
604
+ has_no_content false
605
+ add_html_output '&empty;'
606
+ add_latex_output '\ensuremath{\emptyset}'
607
+ end #Empty
608
+
609
+ =begin rdoc
610
+ Define Element :_, :underscore
611
+
612
+ Create an instance with
613
+ element( :_ )
614
+ element( :underscore )
615
+ or
616
+ Underscore.new( )
617
+ Attributes are not defined for this element.
618
+ =end
619
+ class Underscore < Element
620
+ add_id :_
621
+ has_no_content false
622
+ add_html_output '_'
623
+ add_latex_output '\_'
624
+ add_wiki_output '_'
625
+ add_creole_output '_'
626
+ add_text_output '_'
627
+ end #_
628
+
629
+ =begin rdoc
630
+ Define Element :"...", :ldots
631
+
632
+ Create an instance with
633
+ element( :"..." )
634
+ element( :ldots )
635
+ or
636
+ Ldots.new( )
637
+ Attributes are not defined for this element.
638
+ =end
639
+ class Ldots < Element
640
+ add_id :'...'
641
+ has_no_content false
642
+ add_html_output '&hellip;'
643
+ add_latex_output '\ldots '
644
+ add_creole_output '…'
645
+ end #...
646
+
647
+ =begin rdoc
648
+ Define Element :bullet
649
+
650
+ Create an instance with
651
+ element( :bullet )
652
+ or
653
+ Bullet.new( )
654
+ Attributes are not defined for this element.
655
+ =end
656
+ class Bullet < Element
657
+ has_no_content false
658
+ add_html_output '&#149;'
659
+ add_latex_output '\ensuremath{\bullet}'
660
+ end #Bullet
661
+
662
+ =begin rdoc
663
+ Define Element :"--", :ndash
664
+
665
+ Create an instance with
666
+ element( :"--" )
667
+ element( :ndash )
668
+ or
669
+ Ndash.new( )
670
+ Attributes are not defined for this element.
671
+ =end
672
+ class Ndash < Element
673
+ add_id :'--'
674
+ has_no_content false
675
+ add_html_output '&ndash;'
676
+ add_latex_output '--'
677
+ add_creole_output '–'
678
+ end #--
679
+
680
+ =begin rdoc
681
+ Define Element :"---", :mdash
682
+
683
+ Create an instance with
684
+ element( :"---" )
685
+ element( :mdash )
686
+ or
687
+ Mdash.new( )
688
+ Attributes are not defined for this element.
689
+ =end
690
+ class Mdash < Element
691
+ add_id :'---'
692
+ has_no_content false
693
+ add_html_output '&mdash;'
694
+ add_latex_output '--- '
695
+ add_creole_output '—'
696
+ end #---
697
+
698
+ =begin rdoc
699
+ Define Element :dagger
700
+
701
+ Create an instance with
702
+ element( :dagger )
703
+ or
704
+ Dagger.new( )
705
+ Attributes are not defined for this element.
706
+ =end
707
+ class Dagger < Element
708
+ has_no_content false
709
+ add_html_output '&dagger;'
710
+ add_latex_output '\dag'
711
+ end #Dagger
712
+
713
+ =begin rdoc
714
+ Define Element :bdquo
715
+
716
+ Create an instance with
717
+ element( :bdquo )
718
+ or
719
+ Doublelowquotemark.new( )
720
+ Attributes are not defined for this element.
721
+ =end
722
+ class Doublelowquotemark < Element
723
+ add_id :bdquo
724
+ add_id :glqq
725
+ has_no_content false
726
+ add_html_output '&bdquo;'
727
+ add_latex_output '\glqq '
728
+ add_creole_output '„'
729
+ end #Bdquo
730
+
731
+ =begin rdoc
732
+ Define Element :ldquo
733
+
734
+ Create an instance with
735
+ element( :ldquo )
736
+ or
737
+ Leftdoublequotemark.new( )
738
+ Attributes are not defined for this element.
739
+ =end
740
+ class Leftdoublequotemark < Element
741
+ add_id :ldquo
742
+ add_id :grqq
743
+ has_no_content false
744
+ add_html_output '&ldquo;'
745
+ add_latex_output '\grqq'
746
+ add_text_output '``'
747
+ add_creole_output '“'
748
+ end #Ldquo
749
+
750
+ =begin rdoc
751
+ Define Element :rdquo
752
+
753
+ Create an instance with
754
+ element( :rdquo )
755
+ or
756
+ Rightdoublequotemark.new( )
757
+ Attributes are not defined for this element.
758
+ =end
759
+ class Rightdoublequotemark < Element
760
+ add_id :rdquo
761
+ add_id :rqq
762
+ has_no_content false
763
+ add_html_output '&rdquo;'
764
+ add_latex_output '\rqq '
765
+ add_text_output ''''
766
+ #~ add_creole_output ''
767
+ end #Rdquo
768
+
769
+ =begin rdoc
770
+ Define Element :sbquo
771
+
772
+ Create an instance with
773
+ element( :sbquo )
774
+ element( :glq )
775
+ or
776
+ Singlelowquotemark.new( )
777
+ Attributes are not defined for this element.
778
+ =end
779
+ class Singlelowquotemark < Element
780
+ add_id :sbquo
781
+ add_id :glq
782
+ has_no_content false
783
+ add_html_output '&sbquo;'
784
+ add_latex_output '\glq '
785
+ add_creole_output '‚'
786
+ end #Sbquo
787
+
788
+ =begin rdoc
789
+ Define Element :lsquo
790
+
791
+ Create an instance with
792
+ element( :lsquo )
793
+ element( :lq )
794
+ or
795
+ Leftsinglequotemark.new( )
796
+ Attributes are not defined for this element.
797
+ =end
798
+ class Leftsinglequotemark < Element
799
+ add_id :lsquo
800
+ add_id :lq
801
+ has_no_content false
802
+ add_html_output '&lsquo;'
803
+ add_latex_output '\lq '
804
+ add_text_output '`'
805
+ #~ add_creole_output '{{lsquo}}'
806
+ end #Lsquo
807
+
808
+ =begin rdoc
809
+ Define Element :rsquo
810
+
811
+ Create an instance with
812
+ element( :rsquo )
813
+ or
814
+ Rightsinglequotemark.new( )
815
+ Attributes are not defined for this element.
816
+ =end
817
+ class Rightsinglequotemark < Element
818
+ add_id :rsquo
819
+ add_id :rq
820
+ has_no_content false
821
+ add_html_output '&rsquo;'
822
+ add_latex_output '\rq '
823
+ add_text_output ''''
824
+ add_creole_output '’'
825
+ end #Rsquo
826
+
827
+ end #module Characters
828
+ end #module Docgenerator