docgenerator 1.2.1 → 2.0.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.
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
@@ -0,0 +1,136 @@
1
+ module Docgenerator
2
+ module Packages
3
+ =begin rdoc
4
+ Support for attachfile.sty.
5
+ =end
6
+ module Attachfile
7
+ #Options for Support for Attachfile
8
+ ATTACHFILE_OPTIONS = {
9
+ :author => Attribute.create( [ :texkeyval], [ String ] ),
10
+ :description=> Attribute.create( [ :texkeyval], [ String ] ),
11
+ :subject => Attribute.create( [ :texkeyval], [ String ] ),
12
+ :icon => Attribute.create( [ :texkeyval], [ 'Graph', 'Paperclip', 'PushPin', 'Tag' ] ),
13
+ :mimetype=> Attribute.create( [ :texkeyval], [
14
+ 'text/plain',
15
+ 'video/mpeg',
16
+ ] ),
17
+ }
18
+
19
+ =begin rdoc
20
+ Define Element :attachfile
21
+
22
+ Create an instance with
23
+ element( :attachfile, [ attributes, [content]] )
24
+ or
25
+ Attachfile.new( [ attributes, [content]] )
26
+ Attributes may be:
27
+ * :author:
28
+ * :description:
29
+ * :subject:
30
+ * :icon:
31
+ * :mimetype:
32
+ =end
33
+ class Attachfile < Element
34
+ add_attributes ATTACHFILE_OPTIONS
35
+ add_latex_output '#{linebreak(@crbefore)}\attachfile[#{texkeyval()}]{#{@content}}#{linebreak(@crafter)}'
36
+ end #Attachfile
37
+
38
+ =begin rdoc
39
+ Define Element :noattachfile
40
+
41
+ Create an instance with
42
+ element( :noattachfile, [ attributes, [content]] )
43
+ or
44
+ Noattachfile.new( [ attributes, [content]] )
45
+ Attributes may be:
46
+ * :author:
47
+ * :description:
48
+ * :subject:
49
+ * :icon:
50
+ * :mimetype:
51
+ =end
52
+ class Noattachfile < Element
53
+ has_no_content false
54
+ add_attributes ATTACHFILE_OPTIONS
55
+ add_latex_output '#{linebreak(@crbefore)}\noattachfile[#{texkeyval()}]#{linebreak(@crafter)}'
56
+ end #Noattachfile
57
+
58
+ =begin rdoc
59
+ Define Element :textattachfile
60
+
61
+ Create an instance with
62
+ element( :textattachfile, [ attributes, [content]] )
63
+ or
64
+ Textattachfile.new( [ attributes, [content]] )
65
+ Attributes may be:
66
+ * :text:
67
+ * :author:
68
+ * :description:
69
+ * :subject:
70
+ * :icon:
71
+ * :mimetype:
72
+ =end
73
+ class Textattachfile < Element
74
+ add_attributes ATTACHFILE_OPTIONS
75
+ add_attribute :text, Attribute.create( [], [ String ] )
76
+ add_latex_output '#{linebreak(@crbefore)}\textattachfile[#{texkeyval()}]{#{@content}}{#{@attr[:text]}}#{linebreak(@crafter)}'
77
+ end #Textattachfile
78
+
79
+ =begin rdoc
80
+ Define Element :notextattachfile
81
+
82
+ Create an instance with
83
+ element( :notextattachfile, [ attributes, [content]] )
84
+ or
85
+ Notextattachfile.new( [ attributes, [content]] )
86
+ Attributes may be:
87
+ * :text:
88
+ * :author:
89
+ * :description:
90
+ * :subject:
91
+ * :icon:
92
+ * :mimetype:
93
+ =end
94
+ class Notextattachfile < Element
95
+ has_no_content false
96
+ add_attribute :text, Attribute.create( [], [ String ] )
97
+ add_attributes ATTACHFILE_OPTIONS
98
+ add_latex_output '#{linebreak(@crbefore)}\notextattachfile[#{texkeyval()}]{#{@attr[:text]}}#{linebreak(@crafter)}'
99
+ end #Notextattachfile
100
+
101
+ end #module Docgenerator
102
+ end #module Attachfile
103
+ end # module Packages
104
+ __END__
105
+ doc.body << element(:usepackage,{ }, 'listings').cr
106
+ \attachfilesetup {hoptionsi}
107
+
108
+ ==Options==
109
+ appearance=hbooleani
110
+ author=htexti
111
+ color=hredi hgreeni hbluei
112
+ date=htexti
113
+ description=htexti
114
+ subject=htexti
115
+ icon=hnamei
116
+ Graph
117
+ Paperclip
118
+ PushPin
119
+ Tag
120
+ mimetype=htypei
121
+ print=hbooleani
122
+ timezone=hoffseti
123
+ zoom=hbooleani
124
+
125
+ Option Default setting
126
+ appearance true
127
+ author none
128
+ color 1 0.9255 0.7765
129
+ date automatic
130
+ description none
131
+ subject none
132
+ icon PushPin
133
+ mimetype none
134
+ print true
135
+ timezone none
136
+ zoom true
@@ -1,8 +1,16 @@
1
+ =begin rdoc
2
+ Support for caption.sty.
3
+ =end
4
+
1
5
  #
2
- #Support for caption.sty.
3
- #-
4
- #
6
+ module Docgenerator
7
+ module Packages
8
+ =begin rdoc
9
+ Support for caption.sty.
5
10
 
11
+ * http://www.ctan.org/tex-archive/macros/latex/contrib/caption/
12
+ =end
13
+ module Caption
6
14
  #~ Element.create( [:captionof], {
7
15
  #~ :float_type => Attribute.create( [ :latex, :required ], [ 'figure', 'table' ] ),
8
16
  #~ :lst_entry => Attribute.create( [ ], [ String ] ),
@@ -10,34 +18,35 @@
10
18
  #~ :latex => '#{linebreak(@crbefore)}\captionof{#{@attr[:float_type]}}[#{@attr[:lst_entry]}]{#{@content}}#{linebreak(@crafter)}',
11
19
  #~ })
12
20
 
13
- #
14
- #
21
+ =begin rdoc
22
+ Macro defined by caption.sty.
23
+
24
+ =end
15
25
  class Captionof < Element
16
- #Make the key known to the complete key-list of elements.
17
- Element.add( [:captionof], Captionof)
18
26
  #~ add_attributes( HTML_ATTR_ALL )
19
- add_attributes( {
20
- :float_type => Attribute.create( [ :latex, :required ], [ 'figure', 'table' ] ),
21
- :lst_entry => Attribute.create( [ ], [ String ] ),
22
- } )
27
+ add_attribute :float_type, Attribute.create( [ :latex, :required ], [ 'figure', 'table' ] )
28
+ add_attribute :lst_entry, Attribute.create( [ ], [ String ] )
23
29
 
24
30
  #Redefine standard output.
25
31
  #Options are given, if an option is avalaible.
26
- def to_latex()
32
+ add_latex_output { | options = {} |
27
33
  cmd = linebreak(@crbefore)
28
34
  cmd << "\\captionof{#{@attr[:float_type]}}"
29
35
  #Empty [] would return empty entry for list of figures,
30
36
  cmd << "[#{@attr[:lst_entry]}]" if @attr[:lst_entry].content?
31
37
  cmd << "{#{@content}}"
32
38
  cmd << linebreak(@crafter)
33
- return cmd
34
- end
35
- def htmltag(); 'span'; end #fixme
36
- #~ def to_html()
37
- #~ return ''
38
- #~ end
39
- end #Usepackage
39
+
40
+ cmd
41
+ }
42
+
43
+ add_html_tag 'span' #fixme
44
+
45
+ end #Captionof
40
46
 
47
+ end #module Caption
48
+ end #module Packages
49
+ end #module Docgenerator
41
50
  __END__
42
51
 
43
52
  C:\proTeXt\texmf\doc\latex\caption
@@ -0,0 +1,194 @@
1
+ module Docgenerator
2
+ module Packages
3
+ =begin rdoc
4
+ Support of package hyperref.sty
5
+ =end
6
+ module Hyperref
7
+
8
+ =begin rdoc
9
+ Dynamic PDF-Features
10
+ =end
11
+ class HyperrefForm < Environments::Environment
12
+ add_attribute:options, Attribute.create( [ :latex ], [nil] )
13
+ add_id :Form
14
+
15
+ add_latex_output {| options = {} |
16
+ option = "[#{@attr[:options].content.join(',')}]"
17
+ option = nil if option == '[]'
18
+ to_latex_environment( 'Form', option, options )
19
+ }
20
+ end
21
+
22
+ =begin rdoc
23
+ Define Element :Reset
24
+
25
+ Create an instance with
26
+ element( :Reset, [ attributes, [content]] )
27
+ or
28
+ Reset.new( [ attributes, [content]] )
29
+ Attributes are not defined for this element.
30
+ =end
31
+ class Reset < Element
32
+ add_latex_output '#{linebreak(@crbefore)}\Reset{#{@content}}#{linebreak(@crafter)}'
33
+ end #Reset
34
+
35
+ =begin rdoc
36
+ Define Element :CheckBox
37
+
38
+ Create an instance with
39
+ element( :CheckBox, [ attributes, [content]] )
40
+ or
41
+ Checkbox.new( [ attributes, [content]] )
42
+ Attributes may be:
43
+ * :name:
44
+ * :onclick:
45
+ * :onblur:
46
+ =end
47
+ class Checkbox < Element
48
+ add_attribute :name, Attribute.create( [ :texkeyval ] )
49
+ add_attribute :onblur, Attribute.create( [ :texkeyval ] )
50
+ add_attribute :onclick, Attribute.create( [ :texkeyval ] )
51
+
52
+ add_latex_output '#{linebreak(@crbefore)}\CheckBox[#{texkeyval()}]{#{@content}}#{linebreak(@crafter)}'
53
+ end #Checkbox
54
+
55
+ =begin rdoc
56
+ Define Element :PushButton
57
+
58
+ Create an instance with
59
+ element( :PushButton, [ attributes, [content]] )
60
+ or
61
+ Pushbutton.new( [ attributes, [content]] )
62
+ Attributes may be:
63
+ * :onclick:
64
+ * :width:
65
+ * :height:
66
+ * :borderstyle:
67
+ * :bordercolor:
68
+ * :color:
69
+ * :backgroundcolor:
70
+ =end
71
+ class Pushbutton < Element
72
+ add_attribute :width, Attribute.create( [ :texkeyval ], nil, 5) #regexp not supported - CSS_WIDTH
73
+ add_attribute :height, Attribute.create( [ :texkeyval ], nil, 6) #regexp not supported - CSS_WIDTH
74
+ 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)
75
+ add_attribute :bordercolor, Attribute.create( [ :texkeyval ], nil, 11 )
76
+ add_attribute :color, Attribute.create( [ :texkeyval ], nil, 15 )
77
+ add_attribute :backgroundcolor, Attribute.create( [ :texkeyval ], nil, 15 )
78
+ add_attribute :onclick, Attribute.create( [ :texkeyval ] )
79
+ #~ :onload => Attribute.create( [ :texkeyval ] ), - niht definiert
80
+ #~ :onmousemove => Attribute.create( [ :texkeyval ] ), nee, ghet nicht
81
+ add_latex_output '#{linebreak(@crbefore)}\PushButton[#{texkeyval()}]{#{@content}}#{linebreak(@crafter)}'
82
+ end #Pushbutton
83
+
84
+ =begin rdoc
85
+ Define Element :ChoiceMenu
86
+
87
+ Create an instance with
88
+ element( :ChoiceMenu, [ attributes, [content]] )
89
+ or
90
+ Choicemenu.new( [ attributes, [content]] )
91
+ Attributes may be:
92
+ * :name:
93
+ * :onblur:
94
+ * :default:
95
+ * :type:
96
+ * :width:
97
+ * :height:
98
+ * :borderstyle:
99
+ * :bordercolor:
100
+ * :color:
101
+ * :backgroundcolor:
102
+ =end
103
+ class Choicemenu < Element
104
+ add_attribute :name, Attribute.create( [ :required ] )
105
+ add_attribute :onblur, Attribute.create( [ :texkeyval ] )
106
+ add_attribute :default, Attribute.create( [ :texkeyval ] )
107
+ add_attribute :type, Attribute.create( [], ['combo', 'radiobutton'] )
108
+ add_attribute :width, Attribute.create( [ :texkeyval ], nil, 5)#regexp not supported - CSS_WIDTH
109
+ add_attribute :height, Attribute.create( [ :texkeyval ], nil, 6)#regexp not supported - CSS_WIDTH
110
+ add_attribute :borderstyle, Attribute.create( [ :texkeyval ], ['S', 'D', 'B', 'I', 'U'], 10 )
111
+ add_attribute :bordercolor, Attribute.create( [ :texkeyval ], nil, 11 )
112
+ add_attribute :color, Attribute.create( [ :texkeyval ], nil, 15 )
113
+ add_attribute :backgroundcolor, Attribute.create( [ :texkeyval ], nil, 15 )
114
+ add_latex_output '#{linebreak(@crbefore)}\ChoiceMenu[#{@attr[:type]},#{texkeyval()}]{#{@attr[:name]}}{#{@content}}#{linebreak(@crafter)}'
115
+ end #Choicemenu
116
+
117
+ =begin rdoc
118
+ Define Element :TextField
119
+
120
+ Create an instance with
121
+ element( :TextField, [ attributes, [content]] )
122
+ or
123
+ Textfield.new( [ attributes, [content]] )
124
+ Attributes may be:
125
+ * :onclick:
126
+ * :onblur:
127
+ * :name:
128
+ * :password:
129
+ * :width:
130
+ * :height:
131
+ * :align:
132
+ * :borderstyle:
133
+ * :bordercolor:
134
+ * :color:
135
+ * :backgroundcolor:
136
+ * :multiline:
137
+ * :readonly:
138
+ * :hidden:
139
+ * :value:
140
+ * :validate:
141
+ * :format:
142
+ =end
143
+ class Textfield < Element
144
+ add_attribute :onclick, Attribute.create( [ :texkeyval ] )
145
+ add_attribute :onblur, Attribute.create( [ :texkeyval ] ) #Action, when value changed
146
+ add_attribute :name, Attribute.create( [ :texkeyval ], [String, Symbol], 1 )
147
+ add_attribute :password, Attribute.create( [ :texkeyval ], nil, 3) #Ausgabe als *****
148
+ add_attribute :width, Attribute.create( [ :texkeyval ], nil, 5)
149
+ add_attribute :height, Attribute.create( [ :texkeyval ], nil, 6)
150
+ add_attribute :align, Attribute.create( [ :texkeyval ], [0,1,2], 7) #0=links, 1= center, 2 = right
151
+ add_attribute :borderstyle, Attribute.create( [ :texkeyval ], ['S', 'D', 'B', 'I', 'U'], 10 )
152
+ add_attribute :bordercolor, Attribute.create( [ :texkeyval ], nil, 11 )
153
+ add_attribute :color, Attribute.create( [ :texkeyval ], nil, 15 )
154
+ add_attribute :backgroundcolor, Attribute.create( [ :texkeyval ], nil, 15 )
155
+ add_attribute :multiline, Attribute.create( [ :texkeyval ], [true,false], 30 )
156
+ add_attribute :readonly, Attribute.create( [ :texkeyval ], [true,false], 31 )
157
+ add_attribute :hidden, Attribute.create( [ :texkeyval ], [true,false], 31 )
158
+ add_attribute :value, Attribute.create( [ :texkeyval ], [String, Array], 40 )
159
+ add_attribute :validate, Attribute.create( [ :texkeyval ], [String, Array], 40 )#Validation rule
160
+ add_attribute :format, Attribute.create( [ :texkeyval ], [String, Array], 40 )#Format rule
161
+ add_latex_output '#{linebreak(@crbefore)}\TextField[#{texkeyval()}]{#{@content}}#{linebreak(@crafter)}'
162
+ end #Textfield
163
+
164
+ end #module Hyperref
165
+ end #module Packages
166
+ end #module Docgenerator
167
+ __END__
168
+
169
+ #~ \renewcommand{\LayoutCheckField}[2]{\mbox{#2}\,#1}
170
+
171
+ \ChoiceMenu[popdown,name=mitlgiedsnr]{Mitgliedsnummer}%
172
+ {Kein Mitglied=N,}
173
+
174
+ Acrobat-Funktionen:
175
+
176
+ Zu TextField#validate:
177
+ AFRange_Validate(b1,w1,b2,w2)
178
+
179
+ b1: Testen auf Minimum (true/false)
180
+ w1: Minimaler wert
181
+ b2: Testen auf Maximalwert (true/false)
182
+ w2: Maximaler wert
183
+
184
+ Zu TextField#format:
185
+ AFNumber_Format(nDec,0,0,0,0,"",true)
186
+ nDec: Anzahl der Nachkommastellen.
187
+
188
+
189
+ Paket insdljs (nach hyperref laden.
190
+ \begin{insDLJS}{name}{titel}
191
+ Javascript
192
+ \end{insDLJS}
193
+
194
+ name ergint name.js und bei begin{document} geladen.
@@ -0,0 +1,179 @@
1
+ module Docgenerator
2
+ module Listings
3
+ LSTSETTINGS = {
4
+ :language => Attribute.create( [ :texkeyval] ),
5
+ :style => Attribute.create( [ :texkeyval] ),
6
+ :basicstyle => Attribute.create( [ :texkeyval] ),
7
+ :emph => Attribute.create( [ :texkeyval] ),
8
+ :emphstyle => Attribute.create( [ :texkeyval] ),
9
+ :keywordstyle => Attribute.create( [ :texkeyval] ),
10
+ :commentstyle => Attribute.create( [ :texkeyval] ),
11
+ :style => Attribute.create( [ :texkeyval] ),
12
+ :breaklines => Attribute.create( [ :texkeyval], ['true', 'false'] ),
13
+ :mathescape => Attribute.create( [ :texkeyval], ['true', 'false'] ),
14
+ :prebreak => Attribute.create( [ :texkeyval] ),
15
+ :postbreak => Attribute.create( [ :texkeyval] ),
16
+ :tabsize => Attribute.create( [ :texkeyval], [ Integer ] ),
17
+ :firstline => Attribute.create( [ :texkeyval], [ Integer ] ),
18
+ :lastline => Attribute.create( [ :texkeyval], [ Integer ] ),
19
+ #~ showspaces=true,
20
+ #~ showtabs=true,
21
+ #~ tab=\rightarrowfill}
22
+ :numbers => Attribute.create( [ :texkeyval], [ 'none', 'left', 'right' ] ),
23
+ :numberstyle => Attribute.create( [ :texkeyval] ),
24
+ :firstnumber => Attribute.create( [ :texkeyval], [ Integer ] ),
25
+ :stepnumber => Attribute.create( [ :texkeyval], [ Integer ] ),
26
+ :numbersep => Attribute.create( [ :texkeyval], [ Integer ] ),
27
+ #
28
+ :morekeywords => Attribute.create( [ :texkeyval], [ String ] ),
29
+ :morecomment => Attribute.create( [ :texkeyval], [ String ] ),
30
+ }
31
+
32
+
33
+ =begin rdoc
34
+ Define Element :lstlistoflistings
35
+
36
+ Create an instance with
37
+ element( :lstlistoflistings, [ attributes, [content]] )
38
+ or
39
+ Lstlistoflistings.new( [ attributes, [content]] )
40
+ Attributes are not defined for this element.
41
+ =end
42
+ class Lstlistoflistings < Element
43
+ has_no_content false
44
+ end #Lstlistoflistings
45
+
46
+
47
+ =begin rdoc
48
+ Define Element :lstloadlanguages
49
+
50
+ Create an instance with
51
+ element( :lstloadlanguages, [ attributes, [content]] )
52
+ or
53
+ Lstloadlanguages.new( [ attributes, [content]] )
54
+ Attributes are not defined for this element.
55
+ =end
56
+ class Lstloadlanguages < Element
57
+ add_latex_output '#{linebreak(@crbefore)}\lstloadlanguages{#{@content}}#{linebreak(@crafter)}'
58
+ add_html_output ''
59
+ end #Lstloadlanguages
60
+
61
+ =begin rdoc
62
+ Define Element :lstset
63
+
64
+ Create an instance with
65
+ element( :lstset, [ attributes, [content]] )
66
+ or
67
+ Lstset.new( [ attributes, [content]] )
68
+ Attributes may be:
69
+ * LSTSETTINGS
70
+ =end
71
+ class Lstset < Element
72
+ has_no_content false
73
+ add_attributes LSTSETTINGS
74
+ add_latex_output '#{linebreak(@crbefore)}\lstset{#{texkeyval()}}#{linebreak(@crafter)}'
75
+ add_html_output ''
76
+ end #Lstset
77
+
78
+ =begin rdoc
79
+ Define Element :lstdefinestyle
80
+
81
+ Create an instance with
82
+ element( :lstdefinestyle, [ attributes, [content]] )
83
+ or
84
+ Lstdefinestyle.new( [ attributes, [content]] )
85
+ Attributes may be:
86
+ * LSTSETTINGS
87
+ =end
88
+ class Lstdefinestyle < Element
89
+ add_attributes LSTSETTINGS
90
+ add_latex_output '#{linebreak(@crbefore)}\lstdefinestyle{#{@content}}{#{texkeyval()}}#{linebreak(@crafter)}'
91
+ end #Lstdefinestyle
92
+ =begin rdoc
93
+ Define Element :lstinputlisting
94
+
95
+ Create an instance with
96
+ element( :lstinputlisting, [ attributes, [content]] )
97
+ or
98
+ Lstinputlisting.new( [ attributes, [content]] )
99
+ Attributes may be:
100
+ *
101
+ =end
102
+ class Lstinputlisting < Element
103
+ add_attributes LSTSETTINGS
104
+ add_attributes HTML_ATTR_CORE
105
+ add_attributes HTML_ATTR_I18N
106
+ add_attributes HTML_ATTR_EVENTS
107
+ add_attribute :lang, ATTR_LANG
108
+ add_attribute :caption, Attribute.create( [ :texkeyval], nil, 1 )
109
+ add_html_tag 'pre'
110
+ add_latex_output '#{linebreak(@crbefore)}\lstinputlisting[#{texkeyval()}]{#{@content}}#{linebreak(@crafter)}'
111
+ end #Lstinputlisting
112
+
113
+ #~ lstlisting
114
+
115
+ =begin rdoc
116
+ Define Element :lstinline
117
+
118
+ Create an instance with
119
+ element( :lstinline, [ attributes, [content]] )
120
+ or
121
+ Lstinline.new( [ attributes, [content]] )
122
+ Attributes are not defined for this element.
123
+ =end
124
+ class Lstinline < Element
125
+ add_attributes HTML_ATTR_ALL
126
+ add_attributes LSTSETTINGS
127
+ add_attribute :caption, Attribute.create( [ :latex ], nil, 1 )
128
+ add_html_tag 'pre'
129
+ #Redefine standard output.
130
+ #Options are given, if an option is avalaible.
131
+ def to_latex( options={} )
132
+ o = set_option_defaults(options)
133
+ if ! @content.include?( '!' ); sep = '!'
134
+ elsif ! @content.include?( '?' ); sep = '?'
135
+ else
136
+ o[:log].warn("lstinline: found no sep. for #{content}") if o[:log].warn?
137
+ end
138
+ cmd = linebreak(@crbefore)
139
+ cmd << '\lstinline'
140
+ cmd << "[#{texkeyval()}]"
141
+ cmd << sep
142
+ cmd << "#{@content.to_latex( options)}"
143
+ cmd << sep
144
+ cmd << linebreak(@crafter)
145
+ return cmd
146
+ end
147
+ end
148
+
149
+ =begin rdoc
150
+ Define Environment :lstlisting
151
+
152
+ Create an instance with
153
+ element( :lstlisting, [ attributes, [content]] )
154
+ or
155
+ Lstlisting.new( [ attributes, [content]] )
156
+ Attributes are not defined for this element.
157
+ =end
158
+ class Lstlisting < Environments::Environment
159
+ add_attributes HTML_ATTR_ALL
160
+ add_attributes LSTSETTINGS
161
+ add_attribute :options, Attribute.create( [ :texkeyval], nil, 1 )
162
+
163
+ add_html_tag 'pre'
164
+ =begin rdoc
165
+ Redefine standard output.
166
+ Options are given, if an option is avalaible.
167
+ =end
168
+ def to_latex( options={} )
169
+ option = "[#{texkeyval()}]"
170
+ option = nil if option == '[]'
171
+ return to_latex_environment( 'lstlisting', option, options )
172
+ end
173
+ end
174
+ end #module Listings
175
+ end #module Docgenerator
176
+ __END__
177
+ doc.head << element(:usepackage,{ }, 'listings').cr
178
+ doc.head << element(:lstloadlanguages,{}, 'ruby' ).cr
179
+ doc.head << element(:lstset,{ :language => 'ruby' } ).cr