docgenerator 1.0.4 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/creole/creole2doc.rb +777 -0
- data/lib/creole/creole_inclusion_and_plugins.rb +236 -0
- data/lib/creole/creole_placeholder.rb +74 -0
- data/lib/creole/creole_tabular.rb +170 -0
- data/lib/docgenerator.rb +15 -6
- data/lib/docgenerator_attribute.rb +2 -2
- data/lib/docgenerator_characters.rb +20 -4
- data/lib/docgenerator_document.rb +132 -42
- data/lib/docgenerator_element.rb +531 -524
- data/lib/docgenerator_elements.rb +408 -399
- data/lib/docgenerator_environments.rb +28 -2
- data/lib/docgenerator_footnote.rb +72 -79
- data/lib/docgenerator_sections.rb +1 -1
- data/lib/docgenerator_tabular.rb +8 -3
- data/lib/packages/docgenerator_beamer.rb +253 -0
- data/lib/packages/docgenerator_scrlettr2.rb +53 -9
- data/lib/templates/docgenerator_template_css.rb +4 -0
- data/lib/wiki2doc/wiki2docgenerator.rb +1087 -970
- data/lib/yaml2presentation/yaml2presentation.rb +1091 -0
- data/self_docgenerator.rb +8 -6
- data/unittest/Red_Flower.jpg +0 -0
- data/unittest/creole1.0test.txt +128 -0
- data/unittest/expected/beamer_01_doc.html +1 -1
- data/unittest/expected/beamer_02_doc.html +1 -1
- data/unittest/expected/beamer_doc_html_overview_with_detailpic_and_text_doc.html +34 -0
- data/unittest/expected/beamer_doc_html_overview_with_detailpic_doc.html +34 -0
- data/unittest/expected/beamer_doc_key_doc.html +1 -1
- data/unittest/expected/beamer_doc_note_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_bottom_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_left_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_right_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_top_doc.html +1 -1
- data/unittest/expected/test_footnote.html +2 -2
- data/unittest/expected/test_footnote.latex +1 -1
- data/unittest/expected/test_footnote_group.html +3 -3
- data/unittest/expected/test_footnote_group.latex +2 -2
- data/unittest/expected_creole/test_creole.html +3 -0
- data/unittest/expected_creole/test_creole_characters_all.html +10 -0
- data/unittest/expected_creole/test_creole_characters_all.latex +20 -0
- data/unittest/expected_creole/test_creole_characters_special.html +10 -0
- data/unittest/expected_creole/test_creole_characters_special.latex +18 -0
- data/unittest/expected_creole/test_creole_countdown.html +3 -0
- data/unittest/expected_creole/test_creole_countdown.latex +4 -0
- data/unittest/expected_creole/test_creole_creole1.0test.html +182 -0
- data/unittest/expected_creole/test_creole_creole1.0test.latex +253 -0
- data/unittest/expected_creole/test_creole_creole1.0test.text +160 -0
- data/unittest/expected_creole/test_creole_footnotes.html +9 -0
- data/unittest/expected_creole/test_creole_footnotes.latex +14 -0
- data/unittest/expected_creole/test_creole_footnotes_label.html +9 -0
- data/unittest/expected_creole/test_creole_headings.html +17 -0
- data/unittest/expected_creole/test_creole_headings.latex +19 -0
- data/unittest/expected_creole/test_creole_headings.text +48 -0
- data/unittest/expected_creole/test_creole_headings.wiki +37 -0
- data/unittest/expected_creole/test_creole_hr.html +7 -0
- data/unittest/expected_creole/test_creole_hr.latex +9 -0
- data/unittest/expected_creole/test_creole_hr.text +4 -0
- data/unittest/expected_creole/test_creole_inline.html +3 -0
- data/unittest/expected_creole/test_creole_inline.latex +4 -0
- data/unittest/expected_creole/test_creole_inline.text +2 -0
- data/unittest/expected_creole/test_creole_inline_ruby.html +12 -0
- data/unittest/expected_creole/test_creole_inline_ruby.latex +20 -0
- data/unittest/expected_creole/test_creole_inline_ruby_raw.html +6 -0
- data/unittest/expected_creole/test_creole_inline_ruby_raw.latex +8 -0
- data/unittest/expected_creole/test_creole_input.normsource +23 -0
- data/unittest/expected_creole/test_creole_label.html +12 -0
- data/unittest/expected_creole/test_creole_label.latex +15 -0
- data/unittest/expected_creole/test_creole_line_break.html +6 -0
- data/unittest/expected_creole/test_creole_line_break.latex +8 -0
- data/unittest/expected_creole/test_creole_links_explicit_internal.html +6 -0
- data/unittest/expected_creole/test_creole_links_explicit_internal.text +4 -0
- data/unittest/expected_creole/test_creole_links_explicit_with_em.html +3 -0
- data/unittest/expected_creole/test_creole_links_explicit_with_em.latex +4 -0
- data/unittest/expected_creole/test_creole_links_explicit_with_em.text +2 -0
- data/unittest/expected_creole/test_creole_links_external.html +6 -0
- data/unittest/expected_creole/test_creole_links_external.latex +8 -0
- data/unittest/expected_creole/test_creole_links_external.text +4 -0
- data/unittest/expected_creole/test_creole_links_external_implicit.html +9 -0
- data/unittest/expected_creole/test_creole_links_external_implicit.latex +12 -0
- data/unittest/expected_creole/test_creole_links_external_implicit.text +6 -0
- data/unittest/expected_creole/test_creole_links_file.html +6 -0
- data/unittest/expected_creole/test_creole_links_file.latex +8 -0
- data/unittest/expected_creole/test_creole_links_file.text +4 -0
- data/unittest/expected_creole/test_creole_list_ol.html +12 -0
- data/unittest/expected_creole/test_creole_list_ol.latex +22 -0
- data/unittest/expected_creole/test_creole_list_ol_after_ul.html +12 -0
- data/unittest/expected_creole/test_creole_list_ol_after_ul.latex +20 -0
- data/unittest/expected_creole/test_creole_list_ol_after_ul.text +6 -0
- data/unittest/expected_creole/test_creole_list_ol_ul.html +15 -0
- data/unittest/expected_creole/test_creole_list_ol_ul.latex +26 -0
- data/unittest/expected_creole/test_creole_list_ul.html +22 -0
- data/unittest/expected_creole/test_creole_list_ul.latex +40 -0
- data/unittest/expected_creole/test_creole_list_ul.normsource +83 -0
- data/unittest/expected_creole/test_creole_list_ul_too_much.html +24 -0
- data/unittest/expected_creole/test_creole_list_ul_too_much.latex +44 -0
- data/unittest/expected_creole/test_creole_newline.html +9 -0
- data/unittest/expected_creole/test_creole_newline.latex +11 -0
- data/unittest/expected_creole/test_creole_newline.text +7 -0
- data/unittest/expected_creole/test_creole_paragraphs.html +6 -0
- data/unittest/expected_creole/test_creole_paragraphs.latex +8 -0
- data/unittest/expected_creole/test_creole_paragraphs.normsource +27 -0
- data/unittest/expected_creole/test_creole_paragraphs.text +4 -0
- data/unittest/expected_creole/test_creole_paragraphs.wiki +4 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap.html +5 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap.latex +6 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap.text +4 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap.wiki +4 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.html +9 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.latex +11 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.text +7 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.wiki +7 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.html +5 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.latex +6 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.text +4 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.wiki +4 -0
- data/unittest/expected_creole/test_creole_picture_link.html +6 -0
- data/unittest/expected_creole/test_creole_pictures.html +10 -0
- data/unittest/expected_creole/test_creole_pictures.latex +13 -0
- data/unittest/expected_creole/test_creole_pictures_css.html +3 -0
- data/unittest/expected_creole/test_creole_pictures_css.latex +4 -0
- data/unittest/expected_creole/test_creole_pictures_imgclass.html +6 -0
- data/unittest/expected_creole/test_creole_pictures_imgclass.latex +8 -0
- data/unittest/expected_creole/test_creole_placeholders_html.html +7 -0
- data/unittest/expected_creole/test_creole_placeholders_html.latex +8 -0
- data/unittest/expected_creole/test_creole_placeholders_html.text +4 -0
- data/unittest/expected_creole/test_creole_placeholders_latex.html +6 -0
- data/unittest/expected_creole/test_creole_placeholders_latex.latex +9 -0
- data/unittest/expected_creole/test_creole_placeholders_latex.text +4 -0
- data/unittest/expected_creole/test_creole_tabular.html +20 -0
- data/unittest/expected_creole/test_creole_tabular.latex +22 -0
- data/unittest/expected_creole/test_creole_tabular_creole.html +18 -0
- data/unittest/expected_creole/test_creole_tabular_creole.latex +19 -0
- data/unittest/expected_creole/test_creole_tabular_css.html +20 -0
- data/unittest/expected_creole/test_creole_tabular_css.latex +22 -0
- data/unittest/expected_creole/test_creole_toc.html +11 -0
- data/unittest/expected_creole/test_creole_toc.latex +22 -0
- data/unittest/expected_creole/test_creole_toc.text +4 -0
- data/unittest/expected_creole/test_creole_toc_text.html +5 -0
- data/unittest/expected_creole/test_creole_toc_text.latex +5 -0
- data/unittest/expected_creole/test_creole_ul_multiple_line.html +7 -0
- data/unittest/expected_creole/test_creole_ul_multiple_line.latex +14 -0
- data/unittest/expected_creole/test_creole_ul_with_blank.html +11 -0
- data/unittest/expected_creole/test_creole_ul_with_blank.latex +20 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.creole +0 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.html +11 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.latex +18 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.text +7 -0
- data/unittest/expected_creole/test_creole_verbatim.html +25 -0
- data/unittest/expected_creole/test_creole_verbatim.latex +33 -0
- data/unittest/expected_creole/test_creole_verbatim.text +17 -0
- data/unittest/expected_creole/test_creole_verbatim_inline.html +6 -0
- data/unittest/expected_creole/test_creole_verbatim_inline.latex +8 -0
- data/unittest/expected_creole/test_creole_verbatim_inline_at_start.html +6 -0
- data/unittest/expected_creole/test_creole_verbatim_inline_at_start.latex +8 -0
- data/unittest/expected_privat/test_creole_test_document.html +6 -0
- data/unittest/{expected → expected_wiki}/test_wiki.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_amazon.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_description.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_description.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_description.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_description.wiki +0 -0
- data/unittest/expected_wiki/test_wiki_footnote.html +8 -0
- data/unittest/expected_wiki/test_wiki_footnote.latex +17 -0
- data/unittest/{expected → expected_wiki}/test_wiki_footnote.text +2 -4
- data/unittest/expected_wiki/test_wiki_footnote.wiki +10 -0
- data/unittest/expected_wiki/test_wiki_footnote_2.html +8 -0
- data/unittest/expected_wiki/test_wiki_footnote_groupid.html +21 -0
- data/unittest/{expected → expected_wiki}/test_wiki_html_code.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_html_code.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_html_code.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_html_code.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_inline.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_inline.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_inline.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_inline.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_label.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_link.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_link.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_link.log +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_link.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_after_ul.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_after_ul.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_after_ul.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_after_ul.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_ul.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_ul.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_ul.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_ul.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul_too_much.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul_too_much.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul_too_much.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul_too_much.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_picture.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_picture.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_picture_thumb.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_tab1.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_tab1.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_tab1.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_textformatting.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_textformatting.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_textformatting.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_textformatting.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_toc.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_toc.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_toc.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_toc.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_ul_multiple_line.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_ul_multiple_line.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_ul_multiple_line.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_ul_multiple_line.wiki +0 -0
- data/unittest/test_docgenerator.rb +1 -2
- data/unittest/unittest_creole2doc.rb +1024 -0
- data/unittest/unittest_docgenerator.rb +17 -8
- data/unittest/unittest_wiki2doc.rb +92 -88
- data/unittest/unittest_yaml2pres.rb +336 -0
- metadata +202 -70
- data/unittest/expected/test_wiki_footnote.html +0 -8
- data/unittest/expected/test_wiki_footnote.latex +0 -15
- data/unittest/expected/test_wiki_footnote.wiki +0 -12
- data/unittest/expected/test_wiki_footnote_groupid.html +0 -21
@@ -29,7 +29,9 @@ class Test_elements < Test::Unit::TestCase
|
|
29
29
|
templogfile = set_temporary_logger()
|
30
30
|
assert_equal( "<br />", element(:br,{},'content').to_html)
|
31
31
|
#~ assert_equal_filecontent( "expected/test_content.log", get_temporary_logger() )
|
32
|
-
|
32
|
+
#Problem: ids.inspect is unsorted -> check only match
|
33
|
+
#~ assert_equal(%Q{ WARN docgenerator: Add content to an element without this feature ["br/", :br, :newline, "br"], "content"\n}, get_temporary_logger(templogfile))
|
34
|
+
assert_match(%r{WARN docgenerator: Add content to an element without this feature \[(.*):newline(.*)\], "content"\n}, get_temporary_logger(templogfile))
|
33
35
|
end
|
34
36
|
def test_symbols()
|
35
37
|
#~ log = Log4r::Logger.new( 'section_logger')
|
@@ -75,24 +77,28 @@ class Test_elements < Test::Unit::TestCase
|
|
75
77
|
assert_equal( '→', element(:rarr).to_html)
|
76
78
|
assert_equal( '→', element(:rightarrow).to_html)
|
77
79
|
assert_equal( '→', element(:'->').to_html)
|
80
|
+
assert_equal( '->', element(:'->').to_text)
|
78
81
|
assert_equal( '\ensuremath{\rightarrow}', element(:rarr).to_latex)
|
79
82
|
assert_equal( '\ensuremath{\rightarrow}', element(:rightarrow).to_latex)
|
80
83
|
assert_equal( '\ensuremath{\rightarrow}', element(:'->').to_latex)
|
81
84
|
assert_equal( '⇒', element(:rArr).to_html)
|
82
85
|
assert_equal( '⇒', element(:Rightarrow).to_html)
|
83
86
|
assert_equal( '⇒', element(:'=>').to_html)
|
87
|
+
assert_equal( '=>', element(:'=>').to_text)
|
84
88
|
assert_equal( '\ensuremath{\Rightarrow}', element(:rArr).to_latex)
|
85
89
|
assert_equal( '\ensuremath{\Rightarrow}', element(:Rightarrow).to_latex)
|
86
90
|
assert_equal( '\ensuremath{\Rightarrow}', element(:'=>').to_latex)
|
87
91
|
assert_equal( '←', element(:larr).to_html)
|
88
92
|
assert_equal( '←', element(:leftarrow).to_html)
|
89
93
|
assert_equal( '←', element(:'<-').to_html)
|
94
|
+
assert_equal( '<-', element(:'<-').to_text)
|
90
95
|
assert_equal( '\ensuremath{\leftarrow}', element(:larr).to_latex)
|
91
96
|
assert_equal( '\ensuremath{\leftarrow}', element(:leftarrow).to_latex)
|
92
97
|
assert_equal( '\ensuremath{\leftarrow}', element(:'<-').to_latex)
|
93
98
|
assert_equal( '⇐', element(:lArr).to_html)
|
94
99
|
assert_equal( '⇐', element(:Leftarrow).to_html)
|
95
100
|
assert_equal( '⇐', element(:'<=').to_html)
|
101
|
+
assert_equal( '<=', element(:'<=').to_text)
|
96
102
|
assert_equal( '\ensuremath{\Lefttarrow}', element(:lArr).to_latex)
|
97
103
|
assert_equal( '\ensuremath{\Lefttarrow}', element(:Leftarrow).to_latex)
|
98
104
|
assert_equal( '\ensuremath{\Lefttarrow}', element(:'<=').to_latex)
|
@@ -224,16 +230,18 @@ end #Test_lists
|
|
224
230
|
|
225
231
|
class Test_footnotes < Test::Unit::TestCase
|
226
232
|
def test_footnote
|
233
|
+
footnotegroup = Footnotegroup.new()
|
234
|
+
#~ footnotegroup = nil
|
227
235
|
text = [
|
228
236
|
element(:h1, {}, 'Abschnitt 1' ).cr,
|
229
237
|
element(:par, {}, [
|
230
238
|
'Text zu Abschnitt 1',
|
231
|
-
element(:footnote,{}, 'Fu� eins'),
|
239
|
+
element(:footnote,{ :group => footnotegroup }, 'Fu� eins'),
|
232
240
|
'Weiterer Text',
|
233
241
|
]
|
234
242
|
).cr,
|
235
243
|
element(:h2, {}, 'Fu�noten' ).cr,
|
236
|
-
|
244
|
+
footnotegroup,
|
237
245
|
]
|
238
246
|
assert_equal_filecontent( "expected/test_footnote.html", text.to_doc(:html))
|
239
247
|
assert_equal_filecontent( "expected/test_footnote.latex", text.to_doc(:latex))
|
@@ -241,20 +249,21 @@ class Test_footnotes < Test::Unit::TestCase
|
|
241
249
|
#~ assert_equal_filecontent( "expected/test_footnote.text", text.to_doc(:text))
|
242
250
|
end #test_footnote
|
243
251
|
def test_footnote_group
|
244
|
-
Footnotegroup.
|
252
|
+
footnotegroup = Footnotegroup.new()
|
253
|
+
footnotegroup2 = Footnotegroup.new('g2')
|
245
254
|
text = [
|
246
255
|
element(:h1, {}, 'Abschnitt 1' ).cr,
|
247
256
|
element(:par, {}, [
|
248
257
|
'Text zu Abschnitt 1',
|
249
|
-
element(:footnote,{ :
|
258
|
+
element(:footnote,{ :group => footnotegroup2 }, 'Fu� eins (g1)'),
|
250
259
|
'Weiterer Text',
|
251
|
-
element(:footnote,{}, 'Noch ne Fu�note'),
|
260
|
+
element(:footnote,{ :group => footnotegroup}, 'Noch ne Fu�note'),
|
252
261
|
]
|
253
262
|
).cr,
|
254
263
|
element(:h2, {}, 'Fu�noten' ).cr,
|
255
|
-
|
264
|
+
footnotegroup,
|
256
265
|
element(:h3, {}, 'Fu�noten g1' ).cr,
|
257
|
-
|
266
|
+
footnotegroup2,
|
258
267
|
]
|
259
268
|
assert_equal_filecontent( "expected/test_footnote_group.html", text.to_doc(:html))
|
260
269
|
assert_equal_filecontent( "expected/test_footnote_group.latex", text.to_doc(:latex))
|
@@ -2,6 +2,7 @@ $: << 'C:/usr/Script/DocumentGenerator' #for AMAZON...
|
|
2
2
|
#require 'privat/docgenerator_affiliate'
|
3
3
|
|
4
4
|
require 'test_docgenerator.rb'
|
5
|
+
require 'wiki2doc/wiki2docgenerator'
|
5
6
|
$fixme = []
|
6
7
|
|
7
8
|
END { puts $fixme }
|
@@ -15,10 +16,10 @@ Text
|
|
15
16
|
Text unter Titel 2
|
16
17
|
wiki
|
17
18
|
)
|
18
|
-
assert_equal_filecontent( "
|
19
|
-
assert_equal_filecontent( "
|
20
|
-
assert_equal_filecontent( "
|
21
|
-
assert_equal_filecontent( "
|
19
|
+
assert_equal_filecontent( "expected_wiki/test_wiki.html", wiki.to_doc(:html))
|
20
|
+
assert_equal_filecontent( "expected_wiki/test_wiki.latex", wiki.to_doc(:latex))
|
21
|
+
assert_equal_filecontent( "expected_wiki/test_wiki.wiki", wiki.to_doc(:wiki))
|
22
|
+
assert_equal_filecontent( "expected_wiki/test_wiki.text", wiki.to_doc(:text))
|
22
23
|
end
|
23
24
|
#
|
24
25
|
#Including the definition of a label tor the toc.
|
@@ -32,10 +33,10 @@ Text unter Titel 2
|
|
32
33
|
Text unter Titel 2b
|
33
34
|
wiki
|
34
35
|
)
|
35
|
-
assert_equal_filecontent( "
|
36
|
-
assert_equal_filecontent( "
|
37
|
-
assert_equal_filecontent( "
|
38
|
-
assert_equal_filecontent( "
|
36
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_toc.html", wiki.to_doc(:html))
|
37
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_toc.latex", wiki.to_doc(:latex))
|
38
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_toc.wiki", wiki.to_doc(:wiki))
|
39
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_toc.text", wiki.to_doc(:text))
|
39
40
|
end
|
40
41
|
def test_wiki_inline()
|
41
42
|
wiki = Wikitext.new(:content => <<wiki
|
@@ -47,12 +48,12 @@ Inline-Tags ''kursiv'', '''fett''', ''''kursiv und fett''''
|
|
47
48
|
wiki
|
48
49
|
)
|
49
50
|
#fixme tex unklar. wie zwei dd-tags in tex nachbilden?
|
50
|
-
assert_equal_filecontent( "
|
51
|
-
assert_equal_filecontent( "
|
51
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_inline.html", wiki.to_doc(:html))
|
52
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_inline.latex", wiki.to_doc(:latex))
|
52
53
|
#~ bug! fixme
|
53
54
|
$fixme << 'inline 2 wiki'
|
54
|
-
#~ assert_equal_filecontent( "
|
55
|
-
assert_equal_filecontent( "
|
55
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_inline.wiki", wiki.to_doc(:wiki))
|
56
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_inline.text", wiki.to_doc(:text))
|
56
57
|
end
|
57
58
|
|
58
59
|
def test_wiki_textformatting()
|
@@ -65,10 +66,10 @@ vorher{{newline|clear}}Nachher
|
|
65
66
|
Nach einer Trennlinie
|
66
67
|
wiki
|
67
68
|
)
|
68
|
-
assert_equal_filecontent( "
|
69
|
-
assert_equal_filecontent( "
|
70
|
-
assert_equal_filecontent( "
|
71
|
-
assert_equal_filecontent( "
|
69
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_textformatting.html", wiki.to_doc(:html))
|
70
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_textformatting.latex", wiki.to_doc(:latex))
|
71
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_textformatting.wiki", wiki.to_doc(:wiki))
|
72
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_textformatting.text", wiki.to_doc(:text))
|
72
73
|
end
|
73
74
|
|
74
75
|
def test_wiki_label()
|
@@ -81,10 +82,10 @@ text text
|
|
81
82
|
wiki
|
82
83
|
)
|
83
84
|
#~ fixme: TeX href hyperlabel??
|
84
|
-
assert_equal_filecontent( "
|
85
|
-
#~ assert_equal_filecontent( "
|
86
|
-
#~ assert_equal_filecontent( "
|
87
|
-
#~ assert_equal_filecontent( "
|
85
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_label.html", wiki.to_doc(:html))
|
86
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_label.latex", wiki.to_doc(:latex))
|
87
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_label.wiki", wiki.to_doc(:wiki)) #fixme
|
88
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_label.text", wiki.to_doc(:text))
|
88
89
|
end
|
89
90
|
|
90
91
|
def test_wiki_list_ul()
|
@@ -98,10 +99,10 @@ Text before
|
|
98
99
|
Text afterwords
|
99
100
|
wiki
|
100
101
|
)
|
101
|
-
assert_equal_filecontent( "
|
102
|
-
assert_equal_filecontent( "
|
103
|
-
assert_equal_filecontent( "
|
104
|
-
assert_equal_filecontent( "
|
102
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ul.html", wiki.to_doc(:html))
|
103
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ul.latex", wiki.to_doc(:latex))
|
104
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ul.wiki", wiki.to_doc(:wiki))
|
105
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ul.text", wiki.to_doc(:text))
|
105
106
|
end
|
106
107
|
#It works fine here, but LaTeX will give you an error.
|
107
108
|
def test_wiki_list_ul_too_much()
|
@@ -118,10 +119,10 @@ Text before
|
|
118
119
|
Text afterwords
|
119
120
|
wiki
|
120
121
|
)
|
121
|
-
assert_equal_filecontent( "
|
122
|
-
assert_equal_filecontent( "
|
123
|
-
assert_equal_filecontent( "
|
124
|
-
assert_equal_filecontent( "
|
122
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ul_too_much.html", wiki.to_doc(:html))
|
123
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ul_too_much.latex", wiki.to_doc(:latex))
|
124
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ul_too_much.wiki", wiki.to_doc(:wiki))
|
125
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ul_too_much.text", wiki.to_doc(:text))
|
125
126
|
end
|
126
127
|
def test_wiki_list_ol()
|
127
128
|
wiki = Wikitext.new(:content => <<wiki
|
@@ -134,10 +135,10 @@ Text before
|
|
134
135
|
Text afterwords
|
135
136
|
wiki
|
136
137
|
)
|
137
|
-
assert_equal_filecontent( "
|
138
|
-
assert_equal_filecontent( "
|
139
|
-
assert_equal_filecontent( "
|
140
|
-
assert_equal_filecontent( "
|
138
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol.html", wiki.to_doc(:html))
|
139
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol.latex", wiki.to_doc(:latex))
|
140
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol.wiki", wiki.to_doc(:wiki))
|
141
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol.text", wiki.to_doc(:text))
|
141
142
|
end #ol
|
142
143
|
|
143
144
|
def test_wiki_list_ol_ul()
|
@@ -151,10 +152,10 @@ Text before
|
|
151
152
|
Text afterwords
|
152
153
|
wiki
|
153
154
|
)
|
154
|
-
assert_equal_filecontent( "
|
155
|
-
assert_equal_filecontent( "
|
156
|
-
assert_equal_filecontent( "
|
157
|
-
assert_equal_filecontent( "
|
155
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol_ul.html", wiki.to_doc(:html))
|
156
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol_ul.latex", wiki.to_doc(:latex))
|
157
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol_ul.wiki", wiki.to_doc(:wiki))
|
158
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol_ul.text", wiki.to_doc(:text))
|
158
159
|
$fixmes << "nested lists/wiki: bug"
|
159
160
|
$fixmes << "nested lists/text: bug"
|
160
161
|
end
|
@@ -167,10 +168,10 @@ Text before
|
|
167
168
|
Text afterwords
|
168
169
|
wiki
|
169
170
|
)
|
170
|
-
assert_equal_filecontent( "
|
171
|
-
assert_equal_filecontent( "
|
172
|
-
assert_equal_filecontent( "
|
173
|
-
assert_equal_filecontent( "
|
171
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol_after_ul.html", wiki.to_doc(:html))
|
172
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol_after_ul.latex", wiki.to_doc(:latex))
|
173
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol_after_ul.wiki", wiki.to_doc(:wiki))
|
174
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_list_ol_after_ul.text", wiki.to_doc(:text))
|
174
175
|
end
|
175
176
|
|
176
177
|
#Line breaks will be lost.
|
@@ -187,10 +188,10 @@ wiki
|
|
187
188
|
* nachher
|
188
189
|
wiki
|
189
190
|
)
|
190
|
-
assert_equal_filecontent( "
|
191
|
-
assert_equal_filecontent( "
|
192
|
-
assert_equal_filecontent( "
|
193
|
-
assert_equal_filecontent( "
|
191
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_ul_multiple_line.html", wiki.to_doc(:html))
|
192
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_ul_multiple_line.latex", wiki.to_doc(:latex))
|
193
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_ul_multiple_line.wiki", wiki.to_doc(:wiki))
|
194
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_ul_multiple_line.text", wiki.to_doc(:text)) #fixme
|
194
195
|
end
|
195
196
|
def test_wiki_description()
|
196
197
|
wiki = Wikitext.new(:content => <<wiki
|
@@ -203,10 +204,10 @@ wiki
|
|
203
204
|
wiki
|
204
205
|
)
|
205
206
|
#~ fixme - latex how to implement different <dd> values
|
206
|
-
assert_equal_filecontent( "
|
207
|
-
assert_equal_filecontent( "
|
208
|
-
assert_equal_filecontent( "
|
209
|
-
assert_equal_filecontent( "
|
207
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_description.html", wiki.to_doc(:html))
|
208
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_description.latex", wiki.to_doc(:latex))
|
209
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_description.wiki", wiki.to_doc(:wiki))
|
210
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_description.text", wiki.to_doc(:text))
|
210
211
|
end
|
211
212
|
|
212
213
|
#~ Die Syntax:
|
@@ -238,11 +239,11 @@ wiki
|
|
238
239
|
end
|
239
240
|
def test_wiki_tab1()
|
240
241
|
wiki = Wikitext.new(:content => mk_wiki_tab(Array('A'..'D'), Array(1..5) ) )
|
241
|
-
assert_equal_filecontent( "
|
242
|
-
assert_equal_filecontent( "
|
243
|
-
assert_equal_filecontent( "
|
242
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_tab1.html", wiki.to_doc(:html))
|
243
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_tab1.latex", wiki.to_doc(:latex))
|
244
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_tab1.wiki", wiki.to_doc(:wiki))
|
244
245
|
$fixmes << "text-output for tables"
|
245
|
-
#~ assert_equal_filecontent( "
|
246
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_tab1.text", wiki.to_doc(:text))
|
246
247
|
end
|
247
248
|
|
248
249
|
#With >>> you can call ''WikiCollector''
|
@@ -264,10 +265,10 @@ Beispiel:
|
|
264
265
|
Ende Beispiel
|
265
266
|
wiki
|
266
267
|
)
|
267
|
-
assert_equal_filecontent( "
|
268
|
-
assert_equal_filecontent( "
|
269
|
-
assert_equal_filecontent( "
|
270
|
-
assert_equal_filecontent( "
|
268
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_html_code.html", wiki.to_doc(:html))
|
269
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_html_code.latex", wiki.to_doc(:latex))
|
270
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_html_code.wiki", wiki.to_doc(:wiki))
|
271
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_html_code.text", wiki.to_doc(:text))
|
271
272
|
end
|
272
273
|
#
|
273
274
|
#Add File as verbatimtext
|
@@ -279,9 +280,11 @@ wiki
|
|
279
280
|
{{verbatimfile|#{__FILE__}}}
|
280
281
|
wiki
|
281
282
|
)
|
283
|
+
|
284
|
+
escaped_filecontent = File.read(__FILE__).gsub(/</, '<').gsub(/>/, '>')
|
282
285
|
#~ puts wiki.to_latex[1..50].inspect
|
283
286
|
#~ puts wiki.to_latex[-50..-1].inspect
|
284
|
-
assert_equal( "<p ><pre
|
287
|
+
assert_equal( "<p ><pre>#{escaped_filecontent}</pre></p>\n", wiki.to_doc(:html))
|
285
288
|
assert_equal( "\n\n\n\\begin{verbatim}#{File.read(__FILE__)}\\end{verbatim}\n\n\n", wiki.to_doc(:latex))
|
286
289
|
|
287
290
|
#Add some attributes to the pre-environment.
|
@@ -289,7 +292,7 @@ wiki
|
|
289
292
|
{{verbatimfile|#{__FILE__}|class=cssklasse}}
|
290
293
|
wiki
|
291
294
|
)
|
292
|
-
assert_equal( "<p ><pre class = \"cssklasse\" >#{
|
295
|
+
assert_equal( "<p ><pre class = \"cssklasse\" >#{escaped_filecontent}</pre></p>\n",
|
293
296
|
wiki.to_doc(:html))
|
294
297
|
end
|
295
298
|
#Add File as verbatimtext
|
@@ -322,10 +325,11 @@ a second footnote{{footnote|more remarks}}.
|
|
322
325
|
{{footnotes}}
|
323
326
|
wiki
|
324
327
|
)
|
325
|
-
assert_equal_filecontent( "
|
326
|
-
assert_equal_filecontent( "
|
327
|
-
assert_equal_filecontent( "
|
328
|
-
assert_equal_filecontent( "
|
328
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_footnote.html", wiki.to_doc(:html))
|
329
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_footnote_2.html", wiki.to_doc(:html))
|
330
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_footnote.latex", wiki.to_doc(:latex))
|
331
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_footnote.wiki", wiki.to_doc(:wiki))
|
332
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_footnote.text", wiki.to_doc(:text))
|
329
333
|
end
|
330
334
|
def test_wiki_footnote_groupid()
|
331
335
|
wiki = Wikitext.new(:content => <<wiki
|
@@ -345,10 +349,10 @@ Footnote group 2:
|
|
345
349
|
{{footnotes|group2}}
|
346
350
|
wiki
|
347
351
|
)
|
348
|
-
assert_equal_filecontent( "
|
349
|
-
#~ assert_equal_filecontent( "
|
350
|
-
#~ assert_equal_filecontent( "
|
351
|
-
#~ assert_equal_filecontent( "
|
352
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_footnote_groupid.html", wiki.to_doc(:html))
|
353
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_footnote_groupid.latex", wiki.to_doc(:latex))
|
354
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_footnote_groupid.wiki", wiki.to_doc(:wiki))
|
355
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_footnote_groupid.text", wiki.to_doc(:text))
|
352
356
|
end
|
353
357
|
def test_wiki_amazon()
|
354
358
|
wiki = Wikitext.new(:content => <<wiki
|
@@ -357,10 +361,10 @@ wiki
|
|
357
361
|
{{amazon|asin=B000AFEJAM|right}}
|
358
362
|
wiki
|
359
363
|
)
|
360
|
-
assert_equal_filecontent( "
|
361
|
-
#~ assert_equal_filecontent( "
|
362
|
-
#~ assert_equal_filecontent( "
|
363
|
-
#~ assert_equal_filecontent( "
|
364
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_amazon.html", wiki.to_doc(:html))
|
365
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_amazon.latex", wiki.to_doc(:latex))
|
366
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_amazon.wiki", wiki.to_doc(:wiki))
|
367
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_amazon.text", wiki.to_doc(:text))
|
364
368
|
end
|
365
369
|
#~ Bilder lassen sich mit [ [Bild:Dateiname|Beschreibung]] in Artikel einf�gen.
|
366
370
|
#~ Das Bild wird dann in Originalgr��e links im Artikel angezeigt.
|
@@ -388,20 +392,20 @@ wiki
|
|
388
392
|
[[Bild:test.jpg|figureclass=imgclass]]
|
389
393
|
wiki
|
390
394
|
)
|
391
|
-
assert_equal_filecontent( "
|
392
|
-
assert_equal_filecontent( "
|
393
|
-
#~ assert_equal_filecontent( "
|
394
|
-
#~ assert_equal_filecontent( "
|
395
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_picture.html", wiki.to_doc(:html))
|
396
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_picture.latex", wiki.to_doc(:latex))
|
397
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_picture.wiki", wiki.to_doc(:wiki))
|
398
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_picture.text", wiki.to_doc(:text))
|
395
399
|
|
396
400
|
wiki = Wikitext.new(:content => <<wiki
|
397
401
|
[[Bild:test.jpg|thumb=testthumb.jpg]]
|
398
402
|
wiki
|
399
403
|
)
|
400
404
|
wiki.log.level = Log4r::FATAL #Avoid warning for missing picture
|
401
|
-
assert_equal_filecontent( "
|
402
|
-
#~ assert_equal_filecontent( "
|
403
|
-
#~ assert_equal_filecontent( "
|
404
|
-
#~ assert_equal_filecontent( "
|
405
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_picture_thumb.html", wiki.to_doc(:html))
|
406
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_picture_thumb.latex", wiki.to_doc(:latex))
|
407
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_picture_thumb.wiki", wiki.to_doc(:wiki))
|
408
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_picture_thumb.text", wiki.to_doc(:text))
|
405
409
|
end
|
406
410
|
def test_wiki_link()
|
407
411
|
wiki = Wikitext.new(:content => <<wiki
|
@@ -415,13 +419,13 @@ text after
|
|
415
419
|
wiki
|
416
420
|
)
|
417
421
|
wiki.log.level = Log4r::FATAL
|
418
|
-
#~ wiki.log.outputters = Log4r::FileOutputter.new('wiki_link', :filename => "
|
422
|
+
#~ wiki.log.outputters = Log4r::FileOutputter.new('wiki_link', :filename => "expected_wiki/test_wiki_link.log")
|
419
423
|
|
420
|
-
assert_equal_filecontent( "
|
421
|
-
#~ assert_equal_filecontent( "
|
422
|
-
assert_equal_filecontent( "
|
423
|
-
assert_equal_filecontent( "
|
424
|
-
#~ assert_equal_filecontent( "
|
424
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_link.html", wiki.to_doc(:html))
|
425
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_link.log", wiki.to_doc(:html))
|
426
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_link.latex", wiki.to_doc(:latex))
|
427
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_link.wiki", wiki.to_doc(:wiki))
|
428
|
+
#~ assert_equal_filecontent( "expected_wiki/test_wiki_link.text", wiki.to_doc(:text))
|
425
429
|
end
|
426
430
|
end #TestWiki
|
427
431
|
|
@@ -433,10 +437,10 @@ def newtest(text)
|
|
433
437
|
Text
|
434
438
|
wiki
|
435
439
|
)
|
436
|
-
assert_equal_filecontent( "
|
437
|
-
assert_equal_filecontent( "
|
438
|
-
assert_equal_filecontent( "
|
439
|
-
assert_equal_filecontent( "
|
440
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_??.html", wiki.to_doc(:html))
|
441
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_??.latex", wiki.to_doc(:latex))
|
442
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_??.wiki", wiki.to_doc(:wiki))
|
443
|
+
assert_equal_filecontent( "expected_wiki/test_wiki_??.text", wiki.to_doc(:text))
|
440
444
|
end
|
441
445
|
code
|
442
446
|
puts code.gsub(/\?\?/, text)
|