docgenerator 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/examples/docgenerator_example.rb +34 -17
  2. data/examples/docgenerator_example_footnote.rb +82 -61
  3. data/examples/docgenerator_example_list.rb +24 -18
  4. data/examples/docgenerator_example_restrictions.rb +17 -27
  5. data/examples/docgenerator_example_tabular.rb +20 -20
  6. data/examples/docgenerator_example_tripfalls.rb +28 -20
  7. data/examples/results/readme +1 -0
  8. data/examples/results_expected/docgenerator_example.html +39 -0
  9. data/examples/results_expected/docgenerator_example.pdf +0 -0
  10. data/examples/results_expected/docgenerator_example.tex +56 -0
  11. data/examples/results_expected/docgenerator_example_footnote.html +40 -0
  12. data/examples/results_expected/docgenerator_example_footnote.pdf +0 -0
  13. data/examples/results_expected/docgenerator_example_footnote.tex +50 -0
  14. data/examples/results_expected/docgenerator_example_list.html +18 -0
  15. data/examples/results_expected/docgenerator_example_list.pdf +0 -0
  16. data/examples/results_expected/docgenerator_example_list.tex +46 -0
  17. data/examples/results_expected/docgenerator_example_restrictions.html +22 -0
  18. data/examples/results_expected/docgenerator_example_restrictions.pdf +0 -0
  19. data/examples/results_expected/docgenerator_example_restrictions.tex +31 -0
  20. data/examples/results_expected/docgenerator_example_tabular.html +37 -0
  21. data/examples/results_expected/docgenerator_example_tabular.pdf +0 -0
  22. data/examples/results_expected/docgenerator_example_tabular.tex +41 -0
  23. data/examples/results_expected/docgenerator_example_tripfalls.html +27 -0
  24. data/examples/results_expected/docgenerator_example_tripfalls.pdf +0 -0
  25. data/examples/results_expected/docgenerator_example_tripfalls.tex +31 -0
  26. data/lib/creole/creole2doc.rb +291 -140
  27. data/lib/creole/creole_inclusion_and_plugins.rb +142 -39
  28. data/lib/creole/creole_placeholder.rb +92 -30
  29. data/lib/creole/creole_tabular.rb +119 -20
  30. data/lib/docgenerator.rb +209 -118
  31. data/lib/{docgenerator_attribute.rb → docgenerator/attribute.rb} +2 -1
  32. data/lib/{docgenerator_characters.rb → docgenerator/characters.rb} +75 -6
  33. data/lib/{docgenerator_css.rb → docgenerator/css.rb} +0 -0
  34. data/lib/docgenerator/document.rb +588 -0
  35. data/lib/{docgenerator_element.rb → docgenerator/element.rb} +52 -80
  36. data/lib/{docgenerator_elements.rb → docgenerator/elements.rb} +43 -17
  37. data/lib/{docgenerator_environments.rb → docgenerator/environments.rb} +20 -6
  38. data/lib/{docgenerator_footnote.rb → docgenerator/footnote.rb} +22 -18
  39. data/lib/{docgenerator_lists.rb → docgenerator/lists.rb} +17 -1
  40. data/lib/{docgenerator_sections.rb → docgenerator/sections.rb} +9 -1
  41. data/lib/docgenerator/standard.rb +81 -0
  42. data/lib/{docgenerator_tabular.rb → docgenerator/tabular.rb} +9 -5
  43. data/lib/packages/docgenerator_listings.rb +9 -5
  44. data/lib/packages/docgenerator_pdfpages.rb +17 -11
  45. data/lib/packages/docgenerator_url.rb +0 -2
  46. data/lib/templates/docgenerator_template.rb +66 -29
  47. data/lib/templates/docgenerator_template.yaml +18 -0
  48. data/lib/wiki2doc/wiki2docgenerator.rb +6 -2
  49. data/readme.rd +132 -0
  50. data/unittest/expected/test_document_usepackage_undefined.log +2 -0
  51. data/unittest/expected/test_enumerate.context +4 -0
  52. data/unittest/expected/test_footnote.html +4 -4
  53. data/unittest/expected/test_footnote.latex +4 -4
  54. data/unittest/expected/test_footnote_group.html +6 -6
  55. data/unittest/expected/test_footnote_group.latex +6 -6
  56. data/unittest/expected/test_href.html +2 -2
  57. data/unittest/expected/test_href.latex +2 -2
  58. data/unittest/expected/test_href.text +2 -2
  59. data/unittest/expected/test_itemize.context +4 -0
  60. data/unittest/expected/test_runtex.stdout +3 -0
  61. data/unittest/expected/test_runtex_2.stdout +3 -0
  62. data/unittest/expected/test_section.context +20 -0
  63. data/unittest/expected/test_tabular.html +2 -2
  64. data/unittest/expected/test_verbatim.html +3 -0
  65. data/unittest/expected/test_verbatim.latex +4 -0
  66. data/unittest/expected/test_verbatim_array.html +1 -0
  67. data/unittest/expected/test_verbatim_array.latex +2 -0
  68. data/unittest/expected_creole/test_creole_characters_all.html +12 -5
  69. data/unittest/expected_creole/test_creole_characters_all.latex +20 -6
  70. data/unittest/expected_creole/test_creole_comment.context +11 -0
  71. data/unittest/expected_creole/test_creole_comment.creole +12 -0
  72. data/unittest/expected_creole/test_creole_comment.html +9 -0
  73. data/unittest/expected_creole/test_creole_comment.latex +11 -0
  74. data/unittest/expected_creole/test_creole_creole1.0test.html +3 -3
  75. data/unittest/expected_creole/test_creole_creole1.0test.latex +3 -3
  76. data/unittest/expected_creole/test_creole_creole1.0test.text +4 -4
  77. data/unittest/expected_creole/test_creole_ignore.html +3 -0
  78. data/unittest/expected_creole/test_creole_ignore.latex +4 -0
  79. data/unittest/expected_creole/test_creole_ignore.text +2 -0
  80. data/unittest/expected_creole/test_creole_input.normsource +12 -12
  81. data/unittest/expected_creole/test_creole_input_file_simple.html +15 -0
  82. data/unittest/expected_creole/test_creole_input_file_simple_readlines.html +15 -0
  83. data/unittest/expected_creole/test_creole_links_external_implicit.html +2 -2
  84. data/unittest/expected_creole/test_creole_links_external_implicit.latex +2 -2
  85. data/unittest/expected_creole/test_creole_links_external_implicit.text +2 -2
  86. data/unittest/expected_creole/test_creole_links_implicit_end.creole +4 -0
  87. data/unittest/expected_creole/test_creole_links_implicit_end.html +3 -0
  88. data/unittest/expected_creole/test_creole_links_implicit_end.latex +4 -0
  89. data/unittest/expected_creole/test_creole_list_ul.normsource +42 -42
  90. data/unittest/expected_creole/test_creole_mix_titles_list.html +10 -0
  91. data/unittest/expected_creole/test_creole_mix_titles_list.latex +18 -0
  92. data/unittest/expected_creole/test_creole_mix_titles_list.text +12 -0
  93. data/unittest/expected_creole/test_creole_paragraphs.normsource +15 -15
  94. data/unittest/expected_creole/test_creole_pictures_css.html +4 -1
  95. data/unittest/expected_creole/test_creole_pictures_css.latex +5 -1
  96. data/unittest/expected_creole/test_creole_pictures_longdesc.html +3 -0
  97. data/unittest/expected_creole/test_creole_pictures_width.html +3 -0
  98. data/unittest/expected_creole/test_creole_pictures_width.latex +4 -0
  99. data/unittest/expected_creole/test_creole_short_html.html +3 -0
  100. data/unittest/expected_creole/test_creole_short_html.latex +4 -0
  101. data/unittest/expected_creole/test_creole_short_html.text +2 -0
  102. data/unittest/expected_creole/test_creole_shy.creole +6 -0
  103. data/unittest/expected_creole/test_creole_shy.html +6 -0
  104. data/unittest/expected_creole/test_creole_shy.latex +8 -0
  105. data/unittest/expected_creole/test_creole_shy.text +4 -0
  106. data/unittest/expected_creole/test_creole_tabular_with_cell_option.html +20 -0
  107. data/unittest/expected_creole/test_creole_toc.html +3 -1
  108. data/unittest/expected_creole/test_creole_toc.latex +1 -1
  109. data/unittest/expected_creole/test_creole_toc.text +1 -1
  110. data/unittest/expected_creole/test_creole_toc_level.html +7 -0
  111. data/unittest/expected_creole/test_creole_toc_level.latex +10 -0
  112. data/unittest/expected_creole/test_creole_toc_level.text +3 -0
  113. data/unittest/expected_creole/test_creole_toc_level_text.html +8 -0
  114. data/unittest/expected_creole/test_creole_toc_level_text.latex +9 -0
  115. data/unittest/expected_creole/test_creole_verbatim.html +1 -1
  116. data/unittest/expected_creole/test_creole_verbatim.latex +1 -1
  117. data/unittest/expected_creole/test_creole_verbatim.text +1 -1
  118. data/unittest/expected_creole/test_creole_verbatim_inline.html +1 -1
  119. data/unittest/expected_creole/test_creole_verbatim_inline.latex +1 -1
  120. data/unittest/expected_wiki/test_wiki_description.html +5 -5
  121. data/unittest/expected_wiki/test_wiki_description.latex +5 -5
  122. data/unittest/expected_wiki/test_wiki_description.text +5 -5
  123. data/unittest/expected_wiki/test_wiki_description.wiki +5 -5
  124. data/unittest/test_rakefile_docgenerator.rb +43 -0
  125. data/unittest/unittest_creole2doc.rb +415 -27
  126. data/unittest/unittest_docgenerator.rb +256 -23
  127. data/unittest/unittest_docgenerator_runtex.rb +83 -0
  128. data/unittest/unittest_versions.rb +44 -0
  129. data/unittest/unittest_wiki2doc.rb +28 -27
  130. metadata +473 -106
  131. data/lib/docgenerator_document.rb +0 -525
  132. data/lib/packages/docgenerator_beamer.rb +0 -253
  133. data/lib/yaml2presentation/yaml2presentation.rb +0 -1091
  134. data/unittest/expected/beamer_01_article.tex +0 -13
  135. data/unittest/expected/beamer_01_attachment.tex +0 -15
  136. data/unittest/expected/beamer_01_doc.html +0 -13
  137. data/unittest/expected/beamer_01_doc.tex +0 -18
  138. data/unittest/expected/beamer_01_notes_only.tex +0 -13
  139. data/unittest/expected/beamer_01_notes_onlyslideswithnotes.tex +0 -13
  140. data/unittest/expected/beamer_01_notes_show.tex +0 -13
  141. data/unittest/expected/beamer_01_presentation.tex +0 -13
  142. data/unittest/expected/beamer_02_doc.html +0 -29
  143. data/unittest/expected/beamer_02_doc.tex +0 -34
  144. data/unittest/expected/beamer_block.html +0 -1
  145. data/unittest/expected/beamer_block.latex +0 -1
  146. data/unittest/expected/beamer_doc_fragile_doc.tex +0 -33
  147. data/unittest/expected/beamer_doc_html_overview_with_detailpic_and_text_doc.html +0 -34
  148. data/unittest/expected/beamer_doc_html_overview_with_detailpic_doc.html +0 -34
  149. data/unittest/expected/beamer_doc_key_doc.html +0 -20
  150. data/unittest/expected/beamer_doc_key_doc.tex +0 -29
  151. data/unittest/expected/beamer_doc_note_doc.html +0 -30
  152. data/unittest/expected/beamer_doc_note_doc.tex +0 -37
  153. data/unittest/expected/beamer_doc_pic_bottom_doc.html +0 -24
  154. data/unittest/expected/beamer_doc_pic_doc.html +0 -24
  155. data/unittest/expected/beamer_doc_pic_doc.tex +0 -28
  156. data/unittest/expected/beamer_doc_pic_left_doc.html +0 -24
  157. data/unittest/expected/beamer_doc_pic_left_doc.tex +0 -28
  158. data/unittest/expected/beamer_doc_pic_ratio_doc.tex +0 -29
  159. data/unittest/expected/beamer_doc_pic_right_doc.html +0 -24
  160. data/unittest/expected/beamer_doc_pic_right_doc.tex +0 -28
  161. data/unittest/expected/beamer_doc_pic_top_doc.html +0 -24
  162. data/unittest/expected/beamer_frame.html +0 -5
  163. data/unittest/expected/beamer_frame.tex +0 -11
  164. data/unittest/expected/beamer_frame_fragile.tex +0 -7
  165. data/unittest/expected/beamer_frame_id.html +0 -1
  166. data/unittest/expected/beamer_frame_id.tex +0 -4
  167. data/unittest/expected/beamer_framepic.html +0 -5
  168. data/unittest/expected/beamer_framepic.latex +0 -1
  169. data/unittest/expected/beamer_framepic_link.html +0 -5
  170. data/unittest/expected/beamer_framepic_link.latex +0 -1
  171. data/unittest/expected/beamer_frametitle.html +0 -1
  172. data/unittest/expected/beamer_frametitle.latex +0 -1
  173. data/unittest/expected/beamer_note.html +0 -1
  174. data/unittest/expected/beamer_note.latex +0 -1
  175. data/unittest/expected_privat/test_creole_test_document.html +0 -6
  176. data/unittest/expected_wiki/test_wiki_amazon.html +0 -10
  177. data/unittest/expected_wiki/test_wiki_link.log +0 -3
  178. data/unittest/test_docgenerator.rb +0 -107
  179. data/unittest/unittest_yaml2pres.rb +0 -336
@@ -1,29 +1,47 @@
1
- #
2
- #Create a test-document with docgenerator.rb.
3
- #
1
+ =begin rdoc
2
+ Create a test-document with docgenerator.rb.
3
+
4
+ Result see
5
+ * examples/results_expected/docgenerator_example.html
6
+ * examples/results_expected/docgenerator_example.tex
7
+ * examples/results_expected/docgenerator_example.pdf
8
+ =end
4
9
 
5
- #~ require 'rubygems'
6
- $: << ".." #for local tests with uninstalled gem
10
+ require 'rubygems'
11
+ $:.unshift("../lib") #for local tests with uninstalled gem
7
12
  require 'docgenerator'
13
+ begin
14
+ require 'rake4latex_pdflatex'
15
+ rescue LoadError
16
+ puts "rake4latex not installed -> no translation of LaTeX-file"
17
+ end
18
+
19
+ #
20
+ # Move all results to anothe folder
21
+ #
22
+ Dir.chdir('results')
8
23
 
9
24
  #
10
25
  # Create a document
11
26
  #
12
27
  doc = Document.new(
13
28
  :title => 'Testdocument for docgenerator.rb',
14
- :language => 'english'
29
+ :language => 'english',
30
+ :author => 'Authorname',
31
+ :date => 'Datum',
32
+ :keywords => 'Test, docgenerator.rb',
33
+ :description => 'Testdocument for docgenerator.rb'
15
34
  )
16
35
 
17
36
  #
18
- # Set some settings
19
- #
37
+ # Alternative psooibility to define settings:
20
38
  #~ doc.title ='Titel'
21
39
  #~ doc.author = 'Authorname'
22
40
  #~ doc.date = 'Datum'
23
41
  #~ doc.keywords = 'Test, DocGenerator.rb'
24
- #~ doc.description = 'Testdokument f�r DocGenerator.rb'
42
+ #~ doc.description = 'Testdokument for DocGenerator.rb'
25
43
 
26
- #~ doc.add_option('ngerman')
44
+ doc.add_option('ngerman')
27
45
 
28
46
  #
29
47
  doc.body << element(:maketitle) #Only LaTeX
@@ -74,7 +92,7 @@ doc.body << element(:par, {}, [
74
92
  doc.body << element(:h2, {}, 'Links and URLs').cr
75
93
  doc.body << element(:par,{}, [
76
94
  element(:url,{}, 'http://ruby.lickert.net/').cr,
77
- element(:a, { :href => 'http://ruby.lickert.net/' }, 'Link zu meinen Skripten').cr,
95
+ element(:a, { :href => 'http://ruby.lickert.net/' }, 'link to my scripts').cr,
78
96
  ]).cr
79
97
 
80
98
 
@@ -92,10 +110,9 @@ doc.body.insertafter( par, 'This is inserted after the paragraph.' )
92
110
  #~ doc.body.insertbefore( 'a', 'Before List' )
93
111
 
94
112
  # ###############################
95
- # Save the files
113
+ # Save the files
96
114
  # ###############
97
-
98
- #~ Element.log = true #Write Errors to stdout
99
- doc.save( __FILE__.sub(/\.rb/, ".html"), true )
100
- doc.runtex = true
101
- doc.save( __FILE__.sub(/\.rb/, ".tex"), true )
115
+ doc.save( __FILE__.sub(/\.rb/, ".html"))
116
+ doc.save( __FILE__.sub(/\.rb/, ".tex"),
117
+ :runtex => [:statistic, :clean]
118
+ )
@@ -1,98 +1,119 @@
1
- #
2
- #Create a test-document with docgenerator.rb.
3
- #
1
+ =begin rdoc
2
+ Create a test-document with docgenerator.rb.
3
+
4
+ Result see
5
+ * examples/results_expected/docgenerator_example_footnote.html
6
+ * examples/results_expected/docgenerator_example_footnote.tex
7
+ * examples/results_expected/docgenerator_example_footnote.pdf
8
+
9
+ link:examples/results_expected/docgenerator_example_footnote.pdf
4
10
 
5
- #~ require 'rubygems'
6
- $: << ".." #for local tests with uninstalled gem
11
+ =end
12
+
13
+ require 'rubygems'
14
+ $:.unshift("../lib") #for local tests with uninstalled gem
7
15
  require 'docgenerator'
16
+ begin
17
+ require 'rake4latex_pdflatex'
18
+ rescue LoadError
19
+ puts "rake4latex not installed -> no translation of LaTeX-file"
20
+ end
8
21
 
22
+ #
23
+ # Move all results to anothe folder
24
+ #
25
+ Dir.chdir('results')
9
26
  #
10
27
  # Create a document
11
28
  #
12
29
  doc = Document.new(
13
- :title => 'Testdocument with tabulars'
30
+ :title => 'Testdocument with footnotes'
14
31
  )
15
32
 
16
- #~ doc.head << element( :usepackage, { }, 'longtable' )
17
- #~ doc.head << element( :usepackage, { :option => [] }, 'longtable' )
18
-
19
- #
20
- # Set some settings
21
- #
22
- #~ doc.title ='Titel'
23
- #~ doc.author = 'Authorname'
24
- #~ doc.date = 'Datum'
25
- #~ doc.keywords = 'Test, DocGenerator.rb'
26
- #~ doc.description = 'Testdokument f�r DocGenerator.rb'
27
33
 
28
34
  #
29
35
  doc.body << element(:maketitle) #Only LaTeX
30
36
  doc.body[:lang] << 'de' #language flag for HTML
31
37
 
32
- doc.body << element(:h1, {}, 'Normal Footnotes').cr
38
+ doc.body << element(:h1, {}, 'Standard Footnotes').cr
33
39
 
34
- doc.body << element(:h2, {}, 'Standardfu�noten').cr
35
- doc.body << 'a'
36
- doc.body << f = element(:footnote,{}, 'one')
37
- doc.body << 'b'
40
+ doc.body << element(:h2, {}, 'Standard footnote').cr
41
+ doc.body << 'Some text in front'
42
+ doc.body << foot1 = element(:footnote,{}, 'one')
43
+ doc.body << 'and some text between.'
38
44
  doc.body << element(:footnote,{}, 'two')
39
- doc.body << ' nochmal erste Fu�note'
40
- doc.body << f
41
- doc.body << 'z'
45
+ doc.body << ' repeat first footnote'
46
+ doc.body << foot1 #makes not really sense, but it is possible
47
+ doc.body << ' and finish the text.'
42
48
 
49
+ =begin
50
+ Grouped footnotes (only HTML)
43
51
 
52
+ For LaTeX ledmac, manyfoot or bigfoot could be a solution.
53
+ But yet, there is no support for it.
54
+ =end
44
55
  doc.body << element(:h1, {}, 'Footnotes in their own groups (only HTML)').cr
45
- doc.body << element(:h2, {}, 'Footnotes in a Group 1').cr
46
- doc.body << 'a'
47
- doc.body << f = element(:footnote,{:groupid=>1}, 'Footnote one/Group 1')
48
- doc.body << 'b'
49
- doc.body << element(:footnote,{:groupid=>1}, 'Footnote two/Group 1')
50
- doc.body << 'c'
56
+ doc.body << element(:par, {}, 'Footnote groups not supported for LaTeX.').cr
57
+
58
+ footnotegroup1 = Footnotegroup.new('g1')
59
+ footnotegroup1.attr={:style=>'font-size: smaller'}
60
+
61
+ footnotegroup2 = Footnotegroup.new('g2')
62
+ footnotegroup2.attr={:style=>'font-size: smaller'}
63
+ footnotegroup2.html_link = false #Footnotes are not linked
64
+
65
+ ###############################
66
+ doc.body << element(:h2, {}, 'Footnotes in Group 1').cr
67
+ doc.body << 'Some text in front'
68
+ doc.body << f = element(:footnote,{:group => footnotegroup1}, 'Footnote one/Group 1')
69
+ doc.body << 'and some text between.'
70
+ doc.body << element(:footnote,{:group => footnotegroup1}, 'Footnote two/Group 1')
71
+ doc.body << ' repeat first footnote'
51
72
  doc.body << f
52
- doc.body << 'z'
73
+ doc.body << ' and finish the text.'
53
74
 
54
75
  doc.body << element(:h3, {}, 'Footnotes of the Group 1').cr
55
- Footnotegroup.get(1).attr={:style=>'font-size: smaller'}
56
- doc.body << Footnotegroup.get(1)
57
-
58
- doc.body << element(:h2, {}, 'Footnotes in a Group 2').cr
59
- doc.body << 'a'
60
- doc.body << f = element(:footnote,{:groupid=>2}, 'Footnote one/Group 2')
61
- doc.body << 'b'
62
- doc.body << element(:footnote,{:groupid=>2}, 'Footnote two/Group 2')
63
- doc.body << 'c'
76
+ doc.body << footnotegroup1 #makes no sense for LaTeX
77
+
78
+ ###############################
79
+ doc.body << element(:h2, {}, 'Footnotes in Group 2').cr
80
+ doc.body << 'Some text in front'
81
+ doc.body << f = element(:footnote,{:group=>footnotegroup2}, 'Footnote one/Group 2')
82
+ doc.body << 'and some text between.'
83
+ doc.body << element(:footnote,{:group=>footnotegroup2}, 'Footnote two/Group 2')
84
+ doc.body << ' repeat first footnote'
64
85
  doc.body << f
65
- doc.body << 'z'
86
+ doc.body << ' and finish the text.'
66
87
 
67
88
  doc.body << element(:h3, {}, 'Footnotes of the Group 2 - without links').cr
68
- Footnotegroup.get( 2 ).html_link = false #Footnote are not linked
69
- Footnotegroup.get(2).attr={:style=>'font-size: smaller'}
70
- doc.body << Footnotegroup.get(2)
89
+ doc.body << footnotegroup2 #makes no sense for LaTeX
71
90
 
72
-
73
- doc.body << element(:h1, {}, 'Normal Footnotes - Continued').cr
74
- doc.body << 'a'
91
+ ###############################
92
+ doc.body << element(:h1, {}, 'Standard Footnotes - Continued').cr
93
+ doc.body << 'Some text in front'
75
94
  doc.body << f = element(:footnote,{}, 'three')
76
- doc.body << 'b'
95
+ doc.body << 'and some text between.'
77
96
  doc.body << element(:footnote,{}, 'four')
78
- doc.body << 'c'
97
+ doc.body << ' repeat first footnote'
79
98
  doc.body << f
80
- doc.body << 'z'
99
+ doc.body << ' and finish the text.'
81
100
 
82
101
 
83
- doc.body << element(:hr).cr
84
- doc.body << element(:h1, {}, 'Footnotes').cr
85
- Footnotegroup.get.attr={:style=>'font-size: smaller'}
86
- doc.body << Footnotegroup.get()
102
+ =begin
103
+ Back to standard footnotes
104
+ =end
105
+ doc.body << element(:h2, {}, 'Print Footnotes').cr
106
+ doc.body << element(:par, {}, 'makes only sense in HTML. LaTeX has it''s own output routine for footnotes.').cr
107
+ Footnotegroup[].attr={:style=>'font-size: smaller'}
108
+ doc.body << Footnotegroup[] #makes no sense for LaTeX
87
109
  doc.body << element(:hr)
88
110
 
89
111
 
90
112
 
91
113
  # ###############################
92
- # Save the files
114
+ # Save the files
93
115
  # ###############
94
-
95
- #~ Element.log = true #Write Errors to stdout
96
- doc.save( __FILE__.sub(/\.rb/, ".html"), true )
97
- doc.runtex = true
98
- doc.save( __FILE__.sub(/\.rb/, ".tex"), true )
116
+ doc.save( __FILE__.sub(/\.rb/, ".html"))
117
+ doc.save( __FILE__.sub(/\.rb/, ".tex"),
118
+ :runtex => [:statistic, :clean]
119
+ )
@@ -2,9 +2,19 @@
2
2
  #Create a test-document with docgenerator.rb.
3
3
  #
4
4
 
5
- #~ require 'rubygems'
6
- $: << ".." #for local tests with uninstalled gem
5
+ require 'rubygems'
6
+ $:.unshift("../lib") #for local tests with uninstalled gem
7
7
  require 'docgenerator'
8
+ begin
9
+ require 'rake4latex_pdflatex'
10
+ rescue LoadError
11
+ puts "rake4latex not installed -> no translation of LaTeX-file"
12
+ end
13
+
14
+ #
15
+ # Move all results to anothe folder
16
+ #
17
+ Dir.chdir('results')
8
18
 
9
19
  #
10
20
  # Create a document
@@ -13,27 +23,20 @@ doc = Document.new(
13
23
  :title => 'Testdocument with lists'
14
24
  )
15
25
 
16
- #
17
- # Set some settings
18
- #
19
- #~ doc.title ='Titel'
20
- #~ doc.author = 'Authorname'
21
- #~ doc.date = 'Datum'
22
- #~ doc.keywords = 'Test, DocGenerator.rb'
23
- #~ doc.description = 'Testdokument f�r DocGenerator.rb'
24
26
 
25
27
  #
26
28
  doc.body << element(:maketitle) #Only LaTeX
27
29
  doc.body[:lang] << 'de' #language flag for HTML
28
30
 
29
- doc.body << element(:h1, {}, 'Listen')
31
+ doc.body << element(:h1, {}, 'Lists')
30
32
 
31
- doc.body << element(:h2, {}, 'Unnummerierte Liste')
33
+ doc.body << element(:h2, {}, 'Unnumbered Lists')
32
34
  doc.body << ul = element(:ul)
33
35
  ul << element( :li, {}, 'Listitem 1' )
34
36
  ul << element( :li, {}, 'Listitem 2' )
35
37
  ul << element( :li, {}, 'Listitem 3' )
36
38
 
39
+ doc.body << element(:par,{}, 'Next list')
37
40
 
38
41
  doc.body << itemize = element(:itemize)
39
42
  itemize << element( :item, {}, 'Listitem 1' )
@@ -41,22 +44,25 @@ itemize << element( :item, {}, 'Listitem 2' )
41
44
  itemize << element( :item, {}, 'Listitem 3' )
42
45
 
43
46
 
44
- doc.body << element(:h2, {}, 'Nummerierte Liste')
47
+ doc.body << element(:h2, {}, 'Numbered Lists')
45
48
  doc.body << ol = element(:ol)
46
49
  ol << element( :li, {}, 'Listitem 1' )
47
50
  ol << element( :li, {}, 'Listitem 2' )
48
51
  ol << element( :li, {}, 'Listitem 3' )
49
52
 
53
+ doc.body << element(:par,{}, 'Next list')
54
+
50
55
  doc.body << enumerate = element(:enumerate)
51
56
  enumerate << element( :item, {}, 'Listitem 1' )
52
57
  enumerate << element( :item, {}, 'Listitem 2' )
53
58
  enumerate << element( :item, {}, 'Listitem 3' )
54
59
 
55
60
  # ###############################
56
- # Save the files
61
+ # Save the files
57
62
  # ###############
58
63
 
59
- #~ Element.log = true #Write Errors to stdout
60
- doc.save( __FILE__.sub(/\.rb/, ".html"), true )
61
- doc.runtex = true
62
- doc.save( __FILE__.sub(/\.rb/, ".tex"), true )
64
+ doc.save( __FILE__.sub(/\.rb/, ".html"))
65
+ doc.save( __FILE__.sub(/\.rb/, ".tex"),
66
+ :runtex => [:statistic, :clean]
67
+ )
68
+
@@ -2,29 +2,26 @@
2
2
  #Create a test-document with docgenerator.rb.
3
3
  #
4
4
 
5
- #~ require 'rubygems'
6
- $: << ".." #for local tests with uninstalled gem
5
+ require 'rubygems'
6
+ $:.unshift("../lib") #for local tests with uninstalled gem
7
7
  require 'docgenerator'
8
+ begin
9
+ require 'rake4latex_pdflatex'
10
+ rescue LoadError
11
+ puts "rake4latex not installed -> no translation of LaTeX-file"
12
+ end
8
13
 
14
+ #
15
+ # Move all results to anothe folder
16
+ #
17
+ Dir.chdir('results')
9
18
  #
10
19
  # Create a document
11
20
  #
12
21
  doc = Document.new(
13
- :title => 'Testdocument with retsrictions to output format'
22
+ :title => 'Testdocument with restrictions to output format'
14
23
  )
15
24
 
16
- #~ doc.head << element( :usepackage, { }, 'longtable' )
17
- #~ doc.head << element( :usepackage, { :option => [] }, 'longtable' )
18
-
19
- #
20
- # Set some settings
21
- #
22
- #~ doc.title ='Titel'
23
- #~ doc.author = 'Authorname'
24
- #~ doc.date = 'Datum'
25
- #~ doc.keywords = 'Test, DocGenerator.rb'
26
- #~ doc.description = 'Testdokument f�r DocGenerator.rb'
27
-
28
25
  #
29
26
  doc.body << element(:maketitle) #Only LaTeX
30
27
  doc.body[:lang] << 'en' #language flag for HTML
@@ -43,17 +40,10 @@ doc.body << element(:h2, {}, 'Content only in LaTeX').cr
43
40
  doc.body << element(:p, {}, 'Only in LaTeX').restrict_to(:latex)
44
41
  doc.body << element(:latexonly, {}, 'Only in LaTeX')
45
42
 
46
-
47
-
48
-
49
-
50
-
51
-
52
43
  # ###############################
53
- # Save the files
44
+ # Save the files
54
45
  # ###############
55
-
56
- #~ Element.log = true #Write Errors to stdout
57
- doc.save( __FILE__.sub(/\.rb/, ".html"), true )
58
- doc.runtex = true
59
- doc.save( __FILE__.sub(/\.rb/, ".tex"), true )
46
+ doc.save( __FILE__.sub(/\.rb/, ".html"))
47
+ doc.save( __FILE__.sub(/\.rb/, ".tex"),
48
+ :runtex => [:statistic, :clean]
49
+ )
@@ -1,10 +1,19 @@
1
1
  #
2
2
  #Create a test-document with docgenerator.rb.
3
3
  #
4
-
5
- #~ require 'rubygems'
6
- $: << ".." #for local tests with uninstalled gem
4
+ require 'rubygems'
5
+ $:.unshift("../lib") #for local tests with uninstalled gem
7
6
  require 'docgenerator'
7
+ begin
8
+ require 'rake4latex_pdflatex'
9
+ rescue LoadError
10
+ puts "rake4latex not installed -> no translation of LaTeX-file"
11
+ end
12
+
13
+ #
14
+ # Move all results to anothe folder
15
+ #
16
+ Dir.chdir('results')
8
17
 
9
18
  #
10
19
  # Create a document
@@ -16,20 +25,11 @@ doc = Document.new(
16
25
  #~ doc.head << element( :usepackage, { }, 'longtable' )
17
26
  #~ doc.head << element( :usepackage, { :option => [] }, 'longtable' )
18
27
 
19
- #
20
- # Set some settings
21
- #
22
- #~ doc.title ='Titel'
23
- #~ doc.author = 'Authorname'
24
- #~ doc.date = 'Datum'
25
- #~ doc.keywords = 'Test, DocGenerator.rb'
26
- #~ doc.description = 'Testdokument f�r DocGenerator.rb'
27
-
28
28
  #
29
29
  doc.body << element(:maketitle) #Only LaTeX
30
- doc.body[:lang] << 'de' #language flag for HTML
30
+ doc.body[:lang] << 'en' #language flag for HTML
31
31
 
32
- doc.body << element(:h1, {}, 'Tabellen').cr
32
+ doc.body << element(:h1, {}, 'Tabulars').cr
33
33
 
34
34
  def mk_tabular( columns, lines )
35
35
 
@@ -42,7 +42,7 @@ def mk_tabular( columns, lines )
42
42
  row << element(:multicolumn, {
43
43
  :columns => columns.size,
44
44
  :pos => 'c', #LaTeX
45
- }, 'Titel' )
45
+ }, 'Title' )
46
46
  row.hline #Only LaTeX
47
47
 
48
48
  lines.each{|line|
@@ -59,10 +59,10 @@ doc.body << mk_tabular( Array('A'..'F'), Array(1..5) )
59
59
 
60
60
 
61
61
  # ###############################
62
- # Save the files
62
+ # Save the files
63
63
  # ###############
64
64
 
65
- #~ Element.log = true #Write Errors to stdout
66
- doc.save( __FILE__.sub(/\.rb/, ".html"), true )
67
- doc.runtex = true
68
- doc.save( __FILE__.sub(/\.rb/, ".tex"), true )
65
+ doc.save( __FILE__.sub(/\.rb/, ".html"))
66
+ doc.save( __FILE__.sub(/\.rb/, ".tex"),
67
+ :runtex => [:statistic, :clean]
68
+ )