docgenerator 2.1.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docgenerator.rb +18 -18
- data/lib/docgenerator/characters.rb +1 -0
- data/lib/docgenerator/css.rb +5 -0
- data/lib/docgenerator/document.rb +7 -2
- data/lib/docgenerator/element.rb +2 -2
- data/lib/docgenerator/elements.rb +69 -2
- data/lib/docgenerator/index.rb +1 -1
- data/lib/docgenerator/packages/listings.rb +94 -94
- data/lib/docgenerator/packages/multicol.rb +1 -1
- data/lib/docgenerator/packages/pdfpages.rb +2 -1
- data/lib/docgenerator/packages/rubycode4doc.rb +173 -172
- data/lib/docgenerator/packages/struktex.rb +395 -379
- data/lib/docgenerator/packages/todonotes.rb +2 -2
- data/lib/docgenerator/packages/url.rb +4 -0
- data/lib/docgenerator/sections.rb +24 -2
- data/lib/docgenerator/tabular.rb +59 -14
- data/lib/docgenerator/templates/docgenerator_template.rb +1 -0
- data/lib/docgenerator/templates/docgenerator_template.yaml +30 -1
- data/lib/docgenerator/version.rb +13 -1
- data/meta_test_and_doc/build__meta.rb +3 -10
- data/meta_test_and_doc/build_doc.rb +4 -2
- data/meta_test_and_doc/build_test.rb +21 -17
- data/meta_test_and_doc/manpages/images.rb +152 -0
- data/unittest/expected/test_document_toc_article.latex +6 -6
- data/unittest/expected_struktex/test_struktex_krug.creole +5 -5
- data/unittest/expected_struktex/test_struktex_krug.wiki +5 -5
- data/unittest/expected_struktex/test_struktex_statement.creole +4 -4
- data/unittest/expected_struktex/test_struktex_statement.wiki +4 -4
- data/unittest/expected_templates/test_report_utf8.tex +34 -0
- data/unittest/expected_templates/test_standalone.tex +2 -1
- data/unittest/unittest_docgenerator.rb +37 -30
- data/unittest/unittest_docgenerator_characters.rb +113 -60
- data/unittest/unittest_docgenerator_runtex.rb +16 -12
- data/unittest/unittest_packages_multicol.rb +4 -9
- data/unittest/unittest_packages_struktex.rb +66 -90
- data/unittest/unittest_rubycode4doc.rb +38 -241
- data/unittest/unittest_templates.rb +4 -8
- metadata +23 -560
- data/examples/creole_example.rb +0 -81
- data/examples/creole_example_footnote.rb +0 -67
- data/examples/creole_example_new_plugin.rb +0 -51
- data/examples/creole_example_placeholder.rb +0 -77
- data/examples/creole_example_rail.rb +0 -154
- data/examples/creole_example_rubycode.rb +0 -144
- data/examples/creole_example_struktex.rb +0 -169
- data/examples/creole_example_tabular.rb +0 -97
- data/examples/wiki2docgenerator_example.rb +0 -299
- data/lib/creole/creole2doc.rb +0 -954
- data/lib/creole/creole_characters.rb +0 -120
- data/lib/creole/creole_inclusion_and_plugins.rb +0 -96
- data/lib/creole/creole_inclusions.rb +0 -154
- data/lib/creole/creole_placeholder.rb +0 -171
- data/lib/creole/creole_plugins.rb +0 -230
- data/lib/creole/creole_tabular.rb +0 -401
- data/lib/creole/plugins/rail.rb +0 -181
- data/lib/creole/plugins/rubycode4creole.rb +0 -136
- data/lib/creole/plugins/struktex.rb +0 -59
- data/lib/creole/plugins/todonotes.rb +0 -77
- data/lib/wiki2doc/plugins/rubycode4wiki.rb +0 -53
- data/lib/wiki2doc/plugins/struktex.rb +0 -12
- data/lib/wiki2doc/wiki2docgenerator.rb +0 -1276
- data/lib/wiki2doc/wikimedia_document.rb +0 -24
- data/meta_test_and_doc/manpages/packages.rb +0 -13
- data/unittest/Red_Flower.jpg +0 -0
- data/unittest/creole1.0test.txt +0 -128
- data/unittest/creole_testtext.creole +0 -11
- data/unittest/expected_creole/test_creole.html +0 -3
- data/unittest/expected_creole/test_creole_characters_all.creole +0 -28
- data/unittest/expected_creole/test_creole_characters_all.html +0 -18
- data/unittest/expected_creole/test_creole_characters_all.latex +0 -36
- data/unittest/expected_creole/test_creole_characters_special.html +0 -10
- data/unittest/expected_creole/test_creole_characters_special.latex +0 -18
- data/unittest/expected_creole/test_creole_comment.context +0 -11
- data/unittest/expected_creole/test_creole_comment.creole +0 -12
- data/unittest/expected_creole/test_creole_comment.html +0 -9
- data/unittest/expected_creole/test_creole_comment.latex +0 -11
- data/unittest/expected_creole/test_creole_countdown.html +0 -3
- data/unittest/expected_creole/test_creole_countdown.latex +0 -4
- data/unittest/expected_creole/test_creole_creole1.0test.html +0 -182
- data/unittest/expected_creole/test_creole_creole1.0test.latex +0 -253
- data/unittest/expected_creole/test_creole_creole1.0test.text +0 -160
- data/unittest/expected_creole/test_creole_footnotes.html +0 -9
- data/unittest/expected_creole/test_creole_footnotes.latex +0 -14
- data/unittest/expected_creole/test_creole_footnotes_groupid.html +0 -15
- data/unittest/expected_creole/test_creole_footnotes_label.html +0 -9
- data/unittest/expected_creole/test_creole_headings.html +0 -17
- data/unittest/expected_creole/test_creole_headings.latex +0 -19
- data/unittest/expected_creole/test_creole_headings.text +0 -48
- data/unittest/expected_creole/test_creole_headings.wiki +0 -37
- data/unittest/expected_creole/test_creole_hr.html +0 -7
- data/unittest/expected_creole/test_creole_hr.latex +0 -9
- data/unittest/expected_creole/test_creole_hr.text +0 -4
- data/unittest/expected_creole/test_creole_ignore.html +0 -3
- data/unittest/expected_creole/test_creole_ignore.latex +0 -4
- data/unittest/expected_creole/test_creole_ignore.text +0 -2
- data/unittest/expected_creole/test_creole_inline.html +0 -3
- data/unittest/expected_creole/test_creole_inline.latex +0 -4
- data/unittest/expected_creole/test_creole_inline.text +0 -2
- data/unittest/expected_creole/test_creole_inline_apostroph.html +0 -6
- data/unittest/expected_creole/test_creole_inline_apostroph.latex +0 -8
- data/unittest/expected_creole/test_creole_inline_apostroph.text +0 -4
- data/unittest/expected_creole/test_creole_inline_ruby.html +0 -12
- data/unittest/expected_creole/test_creole_inline_ruby.latex +0 -20
- data/unittest/expected_creole/test_creole_inline_ruby_raw.html +0 -6
- data/unittest/expected_creole/test_creole_inline_ruby_raw.latex +0 -8
- data/unittest/expected_creole/test_creole_input.normsource +0 -25
- data/unittest/expected_creole/test_creole_input.normsource_1.8 +0 -23
- data/unittest/expected_creole/test_creole_input_file_simple.html +0 -15
- data/unittest/expected_creole/test_creole_input_file_simple_readlines.html +0 -15
- data/unittest/expected_creole/test_creole_label.html +0 -12
- data/unittest/expected_creole/test_creole_label.latex +0 -15
- data/unittest/expected_creole/test_creole_line_break.html +0 -6
- data/unittest/expected_creole/test_creole_line_break.latex +0 -8
- data/unittest/expected_creole/test_creole_links_explicit_internal.html +0 -6
- data/unittest/expected_creole/test_creole_links_explicit_internal.text +0 -4
- data/unittest/expected_creole/test_creole_links_explicit_with_em.html +0 -3
- data/unittest/expected_creole/test_creole_links_explicit_with_em.latex +0 -4
- data/unittest/expected_creole/test_creole_links_explicit_with_em.text +0 -2
- data/unittest/expected_creole/test_creole_links_external.html +0 -6
- data/unittest/expected_creole/test_creole_links_external.latex +0 -8
- data/unittest/expected_creole/test_creole_links_external.text +0 -4
- data/unittest/expected_creole/test_creole_links_external_implicit.html +0 -9
- data/unittest/expected_creole/test_creole_links_external_implicit.latex +0 -12
- data/unittest/expected_creole/test_creole_links_external_implicit.text +0 -6
- data/unittest/expected_creole/test_creole_links_file.html +0 -6
- data/unittest/expected_creole/test_creole_links_file.latex +0 -8
- data/unittest/expected_creole/test_creole_links_file.text +0 -4
- data/unittest/expected_creole/test_creole_links_implicit_end.creole +0 -4
- data/unittest/expected_creole/test_creole_links_implicit_end.html +0 -3
- data/unittest/expected_creole/test_creole_links_implicit_end.latex +0 -4
- data/unittest/expected_creole/test_creole_list_ol.html +0 -12
- data/unittest/expected_creole/test_creole_list_ol.latex +0 -22
- data/unittest/expected_creole/test_creole_list_ol_after_ul.html +0 -12
- data/unittest/expected_creole/test_creole_list_ol_after_ul.latex +0 -20
- data/unittest/expected_creole/test_creole_list_ol_after_ul.text +0 -6
- data/unittest/expected_creole/test_creole_list_ol_ul.html +0 -15
- data/unittest/expected_creole/test_creole_list_ol_ul.latex +0 -26
- data/unittest/expected_creole/test_creole_list_ul.html +0 -22
- data/unittest/expected_creole/test_creole_list_ul.latex +0 -40
- data/unittest/expected_creole/test_creole_list_ul.normsource +0 -89
- data/unittest/expected_creole/test_creole_list_ul.normsource_1.8 +0 -83
- data/unittest/expected_creole/test_creole_list_ul_too_much.html +0 -24
- data/unittest/expected_creole/test_creole_list_ul_too_much.latex +0 -44
- data/unittest/expected_creole/test_creole_list_ulul_without_ul.html +0 -6
- data/unittest/expected_creole/test_creole_list_ulul_without_ul.latex +0 -12
- data/unittest/expected_creole/test_creole_mix_titles_list.html +0 -10
- data/unittest/expected_creole/test_creole_mix_titles_list.latex +0 -18
- data/unittest/expected_creole/test_creole_mix_titles_list.text +0 -12
- data/unittest/expected_creole/test_creole_newline.html +0 -9
- data/unittest/expected_creole/test_creole_newline.latex +0 -11
- data/unittest/expected_creole/test_creole_newline.text +0 -7
- data/unittest/expected_creole/test_creole_paragraphs.html +0 -6
- data/unittest/expected_creole/test_creole_paragraphs.latex +0 -8
- data/unittest/expected_creole/test_creole_paragraphs.normsource +0 -29
- data/unittest/expected_creole/test_creole_paragraphs.normsource_1.8 +0 -27
- data/unittest/expected_creole/test_creole_paragraphs.text +0 -4
- data/unittest/expected_creole/test_creole_paragraphs.wiki +0 -4
- data/unittest/expected_creole/test_creole_paragraphs_wrap.html +0 -5
- data/unittest/expected_creole/test_creole_paragraphs_wrap.latex +0 -6
- data/unittest/expected_creole/test_creole_paragraphs_wrap.text +0 -4
- data/unittest/expected_creole/test_creole_paragraphs_wrap.wiki +0 -4
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.html +0 -9
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.latex +0 -11
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.text +0 -7
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.wiki +0 -7
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.html +0 -5
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.latex +0 -6
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.text +0 -4
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.wiki +0 -4
- data/unittest/expected_creole/test_creole_picture_link.html +0 -6
- data/unittest/expected_creole/test_creole_pictures.html +0 -10
- data/unittest/expected_creole/test_creole_pictures.latex +0 -13
- data/unittest/expected_creole/test_creole_pictures_css.html +0 -6
- data/unittest/expected_creole/test_creole_pictures_css.latex +0 -8
- data/unittest/expected_creole/test_creole_pictures_imgclass.html +0 -6
- data/unittest/expected_creole/test_creole_pictures_imgclass.latex +0 -8
- data/unittest/expected_creole/test_creole_pictures_longdesc.html +0 -3
- data/unittest/expected_creole/test_creole_pictures_width.html +0 -3
- data/unittest/expected_creole/test_creole_pictures_width.latex +0 -4
- data/unittest/expected_creole/test_creole_placeholders_html.html +0 -7
- data/unittest/expected_creole/test_creole_placeholders_html.latex +0 -8
- data/unittest/expected_creole/test_creole_placeholders_html.text +0 -4
- data/unittest/expected_creole/test_creole_placeholders_latex.html +0 -6
- data/unittest/expected_creole/test_creole_placeholders_latex.latex +0 -9
- data/unittest/expected_creole/test_creole_placeholders_latex.text +0 -4
- data/unittest/expected_creole/test_creole_short_html.html +0 -3
- data/unittest/expected_creole/test_creole_short_html.latex +0 -4
- data/unittest/expected_creole/test_creole_short_html.text +0 -2
- data/unittest/expected_creole/test_creole_shy.creole +0 -6
- data/unittest/expected_creole/test_creole_shy.html +0 -6
- data/unittest/expected_creole/test_creole_shy.latex +0 -8
- data/unittest/expected_creole/test_creole_shy.text +0 -4
- data/unittest/expected_creole/test_creole_tabular.creole +0 -22
- data/unittest/expected_creole/test_creole_tabular.html +0 -20
- data/unittest/expected_creole/test_creole_tabular.latex +0 -22
- data/unittest/expected_creole/test_creole_tabular_creole.creole +0 -19
- data/unittest/expected_creole/test_creole_tabular_creole.html +0 -18
- data/unittest/expected_creole/test_creole_tabular_creole.latex +0 -19
- data/unittest/expected_creole/test_creole_tabular_css.creole +0 -24
- data/unittest/expected_creole/test_creole_tabular_css.html +0 -20
- data/unittest/expected_creole/test_creole_tabular_css.latex +0 -22
- data/unittest/expected_creole/test_creole_tabular_multicols.creole +0 -16
- data/unittest/expected_creole/test_creole_tabular_multicols.html +0 -14
- data/unittest/expected_creole/test_creole_tabular_multicols.latex +0 -16
- data/unittest/expected_creole/test_creole_tabular_row_parameters.latex +0 -22
- data/unittest/expected_creole/test_creole_tabular_with_cell_option.creole +0 -21
- data/unittest/expected_creole/test_creole_tabular_with_cell_option.html +0 -20
- data/unittest/expected_creole/test_creole_toc.html +0 -13
- data/unittest/expected_creole/test_creole_toc.latex +0 -22
- data/unittest/expected_creole/test_creole_toc.text +0 -4
- data/unittest/expected_creole/test_creole_toc_level.html +0 -7
- data/unittest/expected_creole/test_creole_toc_level.latex +0 -10
- data/unittest/expected_creole/test_creole_toc_level.text +0 -3
- data/unittest/expected_creole/test_creole_toc_level_text.html +0 -8
- data/unittest/expected_creole/test_creole_toc_level_text.latex +0 -9
- data/unittest/expected_creole/test_creole_toc_text.html +0 -5
- data/unittest/expected_creole/test_creole_toc_text.latex +0 -5
- data/unittest/expected_creole/test_creole_ul_multiple_line.html +0 -7
- data/unittest/expected_creole/test_creole_ul_multiple_line.latex +0 -14
- data/unittest/expected_creole/test_creole_ul_with_blank.html +0 -11
- data/unittest/expected_creole/test_creole_ul_with_blank.latex +0 -20
- data/unittest/expected_creole/test_creole_ul_with_bold.creole +0 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.html +0 -11
- data/unittest/expected_creole/test_creole_ul_with_bold.latex +0 -18
- data/unittest/expected_creole/test_creole_ul_with_bold.text +0 -7
- data/unittest/expected_creole/test_creole_verbatim.html +0 -25
- data/unittest/expected_creole/test_creole_verbatim.latex +0 -33
- data/unittest/expected_creole/test_creole_verbatim.text +0 -17
- data/unittest/expected_creole/test_creole_verbatim_inline.html +0 -6
- data/unittest/expected_creole/test_creole_verbatim_inline.latex +0 -8
- data/unittest/expected_creole/test_creole_verbatim_inline_at_start.html +0 -6
- data/unittest/expected_creole/test_creole_verbatim_inline_at_start.latex +0 -8
- data/unittest/expected_creole_rail/test_rail_creole_object.tex +0 -33
- data/unittest/expected_creole_rail/test_rail_creole_placeholder.tex +0 -40
- data/unittest/expected_rubycode4doc/creole_complete.html +0 -26
- data/unittest/expected_rubycode4doc/creole_complete.tex +0 -40
- data/unittest/expected_rubycode4doc/creole_in_tab.html +0 -4
- data/unittest/expected_rubycode4doc/creole_in_tab.tex +0 -6
- data/unittest/expected_rubycode4doc/creole_inline_ruby.html +0 -7
- data/unittest/expected_rubycode4doc/creole_output.html +0 -2
- data/unittest/expected_rubycode4doc/creole_output.tex +0 -4
- data/unittest/expected_rubycode4doc/creole_rubycode.html +0 -1
- data/unittest/expected_rubycode4doc/creole_rubycode.tex +0 -3
- data/unittest/expected_rubycode4doc/creole_rubycode_evaluated.html +0 -1
- data/unittest/expected_rubycode4doc/creole_rubycode_evaluated.tex +0 -3
- data/unittest/expected_rubycode4doc/creole_rubycode_evaluated_listings.html +0 -3
- data/unittest/expected_rubycode4doc/creole_rubycode_evaluated_listings.tex +0 -5
- data/unittest/expected_rubycode4doc/wiki_1.html +0 -8
- data/unittest/expected_rubycode4doc/wiki_2.html +0 -8
- data/unittest/expected_rubycode4doc/wiki_3.html +0 -9
- data/unittest/expected_rubycode4doc/wiki_immediate_1.html +0 -5
- data/unittest/expected_rubycode4doc/wiki_immediate_2.html +0 -5
- data/unittest/expected_rubycode4doc/wiki_immediate_3.html +0 -8
- data/unittest/expected_rubycode4doc/wiki_immediate_full.html +0 -21
- data/unittest/expected_wikimedia/test_wiki.html +0 -6
- data/unittest/expected_wikimedia/test_wiki.latex +0 -12
- data/unittest/expected_wikimedia/test_wiki.text +0 -14
- data/unittest/expected_wikimedia/test_wiki.wiki +0 -12
- data/unittest/expected_wikimedia/test_wiki_description.html +0 -7
- data/unittest/expected_wikimedia/test_wiki_description.latex +0 -11
- data/unittest/expected_wikimedia/test_wiki_description.text +0 -6
- data/unittest/expected_wikimedia/test_wiki_description.wiki +0 -6
- data/unittest/expected_wikimedia/test_wiki_footnote.html +0 -8
- data/unittest/expected_wikimedia/test_wiki_footnote.latex +0 -17
- data/unittest/expected_wikimedia/test_wiki_footnote.text +0 -10
- data/unittest/expected_wikimedia/test_wiki_footnote.wiki +0 -10
- data/unittest/expected_wikimedia/test_wiki_footnote_2.html +0 -8
- data/unittest/expected_wikimedia/test_wiki_footnote_groupid.html +0 -21
- data/unittest/expected_wikimedia/test_wiki_html_code.html +0 -7
- data/unittest/expected_wikimedia/test_wiki_html_code.latex +0 -10
- data/unittest/expected_wikimedia/test_wiki_html_code.text +0 -6
- data/unittest/expected_wikimedia/test_wiki_html_code.wiki +0 -6
- data/unittest/expected_wikimedia/test_wiki_inline.html +0 -6
- data/unittest/expected_wikimedia/test_wiki_inline.latex +0 -12
- data/unittest/expected_wikimedia/test_wiki_inline.text +0 -8
- data/unittest/expected_wikimedia/test_wiki_inline.wiki +0 -8
- data/unittest/expected_wikimedia/test_wiki_label.html +0 -6
- data/unittest/expected_wikimedia/test_wiki_link.html +0 -8
- data/unittest/expected_wikimedia/test_wiki_link.latex +0 -17
- data/unittest/expected_wikimedia/test_wiki_link.wiki +0 -11
- data/unittest/expected_wikimedia/test_wiki_list_ol.html +0 -24
- data/unittest/expected_wikimedia/test_wiki_list_ol.latex +0 -30
- data/unittest/expected_wikimedia/test_wiki_list_ol.text +0 -10
- data/unittest/expected_wikimedia/test_wiki_list_ol.wiki +0 -12
- data/unittest/expected_wikimedia/test_wiki_list_ol_after_ul.html +0 -16
- data/unittest/expected_wikimedia/test_wiki_list_ol_after_ul.latex +0 -24
- data/unittest/expected_wikimedia/test_wiki_list_ol_after_ul.text +0 -8
- data/unittest/expected_wikimedia/test_wiki_list_ol_after_ul.wiki +0 -10
- data/unittest/expected_wikimedia/test_wiki_list_ol_ul.html +0 -24
- data/unittest/expected_wikimedia/test_wiki_list_ol_ul.latex +0 -30
- data/unittest/expected_wikimedia/test_wiki_list_ol_ul.text +0 -10
- data/unittest/expected_wikimedia/test_wiki_list_ol_ul.wiki +0 -12
- data/unittest/expected_wikimedia/test_wiki_list_ul.html +0 -24
- data/unittest/expected_wikimedia/test_wiki_list_ul.latex +0 -30
- data/unittest/expected_wikimedia/test_wiki_list_ul.text +0 -10
- data/unittest/expected_wikimedia/test_wiki_list_ul.wiki +0 -12
- data/unittest/expected_wikimedia/test_wiki_list_ul_too_much.html +0 -39
- data/unittest/expected_wikimedia/test_wiki_list_ul_too_much.latex +0 -51
- data/unittest/expected_wikimedia/test_wiki_list_ul_too_much.text +0 -11
- data/unittest/expected_wikimedia/test_wiki_list_ul_too_much.wiki +0 -15
- data/unittest/expected_wikimedia/test_wiki_picture.html +0 -55
- data/unittest/expected_wikimedia/test_wiki_picture.latex +0 -76
- data/unittest/expected_wikimedia/test_wiki_picture_thumb.html +0 -5
- data/unittest/expected_wikimedia/test_wiki_tab1.html +0 -30
- data/unittest/expected_wikimedia/test_wiki_tab1.latex +0 -30
- data/unittest/expected_wikimedia/test_wiki_tab1.wiki +0 -29
- data/unittest/expected_wikimedia/test_wiki_textformatting.html +0 -7
- data/unittest/expected_wikimedia/test_wiki_textformatting.latex +0 -16
- data/unittest/expected_wikimedia/test_wiki_textformatting.text +0 -11
- data/unittest/expected_wikimedia/test_wiki_textformatting.wiki +0 -9
- data/unittest/expected_wikimedia/test_wiki_toc.html +0 -9
- data/unittest/expected_wikimedia/test_wiki_toc.latex +0 -18
- data/unittest/expected_wikimedia/test_wiki_toc.text +0 -21
- data/unittest/expected_wikimedia/test_wiki_toc.wiki +0 -18
- data/unittest/expected_wikimedia/test_wiki_ul_multiple_line.html +0 -18
- data/unittest/expected_wikimedia/test_wiki_ul_multiple_line.latex +0 -19
- data/unittest/expected_wikimedia/test_wiki_ul_multiple_line.text +0 -6
- data/unittest/expected_wikimedia/test_wiki_ul_multiple_line.wiki +0 -7
- data/unittest/unittest_creole.rb +0 -1361
- data/unittest/unittest_creole_placeholders.rb +0 -150
- data/unittest/unittest_creole_plugin_rail.rb +0 -147
- data/unittest/unittest_creole_tabular.rb +0 -207
- data/unittest/unittest_wikimedia.rb +0 -479
@@ -1,479 +0,0 @@
|
|
1
|
-
# encoding: ASCII-8BIT
|
2
|
-
require 'test/unit'
|
3
|
-
require 'more_unit_test/assert_equal_filecontent.rb'
|
4
|
-
|
5
|
-
|
6
|
-
=begin
|
7
|
-
To make it better:
|
8
|
-
|
9
|
-
make more testclasses and create test data in setup.
|
10
|
-
eiach test in its own method.
|
11
|
-
|
12
|
-
=end
|
13
|
-
if $0 == __FILE__
|
14
|
-
$:.unshift("../lib")
|
15
|
-
#~ $:.unshift("../lib_privat")
|
16
|
-
end
|
17
|
-
require 'wiki2doc/wiki2docgenerator'
|
18
|
-
include Docgenerator
|
19
|
-
include Wikimedia
|
20
|
-
#~ DOCGENERATOR_LOGGER.level = Log4r::DEBUG
|
21
|
-
|
22
|
-
$fixmes = []
|
23
|
-
|
24
|
-
END { puts $fixmes }
|
25
|
-
|
26
|
-
class Testcase < Test::Unit::TestCase
|
27
|
-
def setup()
|
28
|
-
#Avoid warnings about missing logger in to_doc
|
29
|
-
@opt = { :log => DOCGENERATOR_DEFAULT_LOGGER }
|
30
|
-
end
|
31
|
-
def test_wiki()
|
32
|
-
wiki = Wikitext.new(:content => <<wiki
|
33
|
-
==Titel 1==
|
34
|
-
Text
|
35
|
-
===Titel 2===
|
36
|
-
Text unter Titel 2
|
37
|
-
wiki
|
38
|
-
)
|
39
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki.html", wiki.to_doc(:html, @opt))
|
40
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki.latex", wiki.to_doc(:latex, @opt))
|
41
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki.wiki", wiki.to_doc(:wiki, @opt))
|
42
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki.text", wiki.to_doc(:text, @opt))
|
43
|
-
end
|
44
|
-
#
|
45
|
-
#Including the definition of a label tor the toc.
|
46
|
-
def test_wiki_toc()
|
47
|
-
wiki = Wikitext.new(:content => <<wiki
|
48
|
-
==Titel 1==
|
49
|
-
Text
|
50
|
-
===Titel 2===
|
51
|
-
Text unter Titel 2
|
52
|
-
===[2b]Titel 2b===
|
53
|
-
Text unter Titel 2b
|
54
|
-
wiki
|
55
|
-
)
|
56
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_toc.html", wiki.to_doc(:html, @opt))
|
57
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_toc.latex", wiki.to_doc(:latex, @opt))
|
58
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_toc.wiki", wiki.to_doc(:wiki, @opt))
|
59
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_toc.text", wiki.to_doc(:text, @opt))
|
60
|
-
end
|
61
|
-
def test_wiki_inline()
|
62
|
-
wiki = Wikitext.new(:content => <<wiki
|
63
|
-
Inline-Tags ''kursiv'', '''fett''', ''''kursiv und fett''''
|
64
|
-
|
65
|
-
''kursiv'',
|
66
|
-
'''fett''',
|
67
|
-
''''kursiv und fett''''
|
68
|
-
wiki
|
69
|
-
)
|
70
|
-
#fixme tex unklar. wie zwei dd-tags in tex nachbilden?
|
71
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_inline.html", wiki.to_doc(:html, @opt))
|
72
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_inline.latex", wiki.to_doc(:latex, @opt))
|
73
|
-
#~ bug! fixme
|
74
|
-
$fixmes << 'inline 2 wiki'
|
75
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_inline.wiki", wiki.to_doc(:wiki))
|
76
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_inline.text", wiki.to_doc(:text, @opt))
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_wiki_textformatting()
|
80
|
-
#Clear in newline is used by HTML (needed to handle floats)
|
81
|
-
wiki = Wikitext.new(:content => <<wiki
|
82
|
-
vorher{{newline}}Nachher
|
83
|
-
|
84
|
-
vorher{{newline|clear}}Nachher
|
85
|
-
----
|
86
|
-
Nach einer Trennlinie
|
87
|
-
wiki
|
88
|
-
)
|
89
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_textformatting.html", wiki.to_doc(:html, @opt))
|
90
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_textformatting.latex", wiki.to_doc(:latex, @opt))
|
91
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_textformatting.wiki", wiki.to_doc(:wiki, @opt))
|
92
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_textformatting.text", wiki.to_doc(:text, @opt))
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_wiki_label()
|
96
|
-
wiki = Wikitext.new(:content => <<wiki
|
97
|
-
[[label:a]]
|
98
|
-
|
99
|
-
text text
|
100
|
-
[[#a|hier]]
|
101
|
-
[[#a|hier]]
|
102
|
-
wiki
|
103
|
-
)
|
104
|
-
#~ fixme: TeX href hyperlabel??
|
105
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_label.html", wiki.to_doc(:html, @opt))
|
106
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_label.latex", wiki.to_doc(:latex))
|
107
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_label.wiki", wiki.to_doc(:wiki)) #fixme
|
108
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_label.text", wiki.to_doc(:text))
|
109
|
-
end
|
110
|
-
|
111
|
-
def test_wiki_list_ul()
|
112
|
-
wiki = Wikitext.new(:content => <<wiki
|
113
|
-
Text before
|
114
|
-
*Listentry 1
|
115
|
-
*Listentry 2
|
116
|
-
**Listentry 2.1
|
117
|
-
**Listentry 2.2
|
118
|
-
*Listentry 3
|
119
|
-
Text afterwords
|
120
|
-
wiki
|
121
|
-
)
|
122
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ul.html", wiki.to_doc(:html, @opt))
|
123
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ul.latex", wiki.to_doc(:latex, @opt))
|
124
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ul.wiki", wiki.to_doc(:wiki, @opt))
|
125
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ul.text", wiki.to_doc(:text, @opt))
|
126
|
-
end
|
127
|
-
#It works fine here, but LaTeX will give you an error.
|
128
|
-
def test_wiki_list_ul_too_much()
|
129
|
-
wiki = Wikitext.new(:content => <<wiki
|
130
|
-
Text before
|
131
|
-
*Listentry 1
|
132
|
-
*Listentry 2
|
133
|
-
**Listentry 2.1
|
134
|
-
**Listentry 2.2
|
135
|
-
***Listentry 2.2.1
|
136
|
-
****Listentry 2.2.1.1
|
137
|
-
*****Listentry 2.2.1.1.1
|
138
|
-
*Listentry 3
|
139
|
-
Text afterwords
|
140
|
-
wiki
|
141
|
-
)
|
142
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ul_too_much.html", wiki.to_doc(:html, @opt))
|
143
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ul_too_much.latex", wiki.to_doc(:latex, @opt))
|
144
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ul_too_much.wiki", wiki.to_doc(:wiki, @opt))
|
145
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ul_too_much.text", wiki.to_doc(:text, @opt))
|
146
|
-
end
|
147
|
-
def test_wiki_list_ol()
|
148
|
-
wiki = Wikitext.new(:content => <<wiki
|
149
|
-
Text before
|
150
|
-
#Listentry 1
|
151
|
-
#Listentry 2
|
152
|
-
##Listentry 2.1
|
153
|
-
##Listentry 2.2
|
154
|
-
#Listentry 3
|
155
|
-
Text afterwords
|
156
|
-
wiki
|
157
|
-
)
|
158
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol.html", wiki.to_doc(:html, @opt))
|
159
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol.latex", wiki.to_doc(:latex, @opt))
|
160
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol.wiki", wiki.to_doc(:wiki, @opt))
|
161
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol.text", wiki.to_doc(:text, @opt))
|
162
|
-
end #ol
|
163
|
-
|
164
|
-
def test_wiki_list_ol_ul()
|
165
|
-
wiki = Wikitext.new(:content => <<wiki
|
166
|
-
Text before
|
167
|
-
#Listentry 1
|
168
|
-
#Listentry 2
|
169
|
-
#*Listentry 2.1
|
170
|
-
#*Listentry 2.2
|
171
|
-
#Listentry 3
|
172
|
-
Text afterwords
|
173
|
-
wiki
|
174
|
-
)
|
175
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol_ul.html", wiki.to_doc(:html, @opt))
|
176
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol_ul.latex", wiki.to_doc(:latex, @opt))
|
177
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol_ul.wiki", wiki.to_doc(:wiki, @opt))
|
178
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol_ul.text", wiki.to_doc(:text, @opt))
|
179
|
-
$fixmes << "nested lists/wiki: bug"
|
180
|
-
$fixmes << "nested lists/text: bug"
|
181
|
-
end
|
182
|
-
|
183
|
-
def test_wiki_list_ol_after_ul()
|
184
|
-
wiki = Wikitext.new(:content => <<wiki
|
185
|
-
Text before
|
186
|
-
*Listentry 1
|
187
|
-
#Listentry 2
|
188
|
-
Text afterwords
|
189
|
-
wiki
|
190
|
-
)
|
191
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol_after_ul.html", wiki.to_doc(:html, @opt))
|
192
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol_after_ul.latex", wiki.to_doc(:latex, @opt))
|
193
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol_after_ul.wiki", wiki.to_doc(:wiki, @opt))
|
194
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_list_ol_after_ul.text", wiki.to_doc(:text, @opt))
|
195
|
-
end
|
196
|
-
|
197
|
-
#Line breaks will be lost.
|
198
|
-
def test_wiki_ul_multiple_line()
|
199
|
-
wiki = Wikitext.new(:content => <<wiki
|
200
|
-
* vorher
|
201
|
-
* text
|
202
|
-
mehr text zum item
|
203
|
-
* nachher und vorher
|
204
|
-
* text
|
205
|
-
mehr text zum item
|
206
|
-
|
207
|
-
neuer Absatz im Item funktioniert auch.
|
208
|
-
* nachher
|
209
|
-
wiki
|
210
|
-
)
|
211
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_ul_multiple_line.html", wiki.to_doc(:html, @opt))
|
212
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_ul_multiple_line.latex", wiki.to_doc(:latex, @opt))
|
213
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_ul_multiple_line.wiki", wiki.to_doc(:wiki, @opt))
|
214
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_ul_multiple_line.text", wiki.to_doc(:text, @opt)) #fixme
|
215
|
-
end
|
216
|
-
def test_wiki_description()
|
217
|
-
wiki = Wikitext.new(:content => <<wiki
|
218
|
-
;Something
|
219
|
-
:Now a long description of Something,
|
220
|
-
continued on a second line.
|
221
|
-
:Another entry
|
222
|
-
;Something Else
|
223
|
-
:Definition of Something Else
|
224
|
-
wiki
|
225
|
-
)
|
226
|
-
#~ fixme - latex how to implement different <dd> values
|
227
|
-
# fixme UTF-fehler
|
228
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_description.html", wiki.to_doc(:html, @opt))
|
229
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_description.latex", wiki.to_doc(:latex, @opt))
|
230
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_description.wiki", wiki.to_doc(:wiki, @opt))
|
231
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_description.text", wiki.to_doc(:text, @opt))
|
232
|
-
end
|
233
|
-
|
234
|
-
#~ Die Syntax:
|
235
|
-
#~ *{| beginnt eine Tabelle. Hier k�nnen zus�tzliche Formatierungseigenschaften kommen.
|
236
|
-
#~ **Zumindest columns==__ sollte gesetzt sein
|
237
|
-
#~ *! beginnt eine neue Zelle einer Titelzeile
|
238
|
-
#~ *| beginnt eine neue Zelle
|
239
|
-
#~ *|format| z.B. rowspan...
|
240
|
-
#~ *|format|| Zwei || beenden die Parameter der Zelle.
|
241
|
-
#~ Dann sinnvoll, wenn im Text selbst ein | vorkommt
|
242
|
-
#~ (z.B. ein Macro verwendet wird)
|
243
|
-
#~ *|- trennt zwei Zeilen der Tabelle
|
244
|
-
#~ **hline: Zus�tzlicher Trennstrich �ber der Zeile
|
245
|
-
#~ **toprule, midrule, bottomrule: Zus�tzlicher Trennstrich �ber der Zeile (erfordert booktabs.sty)
|
246
|
-
#~ *|} beendet eine Tabelle
|
247
|
-
|
248
|
-
|
249
|
-
def mk_wiki_tab( columns, lines )
|
250
|
-
tab = [ "{|columns=#{columns.size}|columndescription=#{'c' * columns.size}" ]
|
251
|
-
tab << "|colspan=#{columns.size}|pos=c|Titel"
|
252
|
-
lines.each{|line|
|
253
|
-
tab << "|-"
|
254
|
-
columns.each{|column|
|
255
|
-
tab << "|#{line}#{column}"
|
256
|
-
}
|
257
|
-
}
|
258
|
-
tab << "|}"
|
259
|
-
return tab.join("\n")
|
260
|
-
end
|
261
|
-
def test_wiki_tab1()
|
262
|
-
wiki = Wikitext.new(:content => mk_wiki_tab(Array('A'..'D'), Array(1..5) ) )
|
263
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_tab1.html", wiki.to_doc(:html, @opt))
|
264
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_tab1.latex", wiki.to_doc(:latex, @opt))
|
265
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_tab1.wiki", wiki.to_doc(:wiki, @opt))
|
266
|
-
$fixmes << "text-output for tables"
|
267
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_tab1.text", wiki.to_doc(:text))
|
268
|
-
end
|
269
|
-
|
270
|
-
#With >>> you can call ''WikiCollector''
|
271
|
-
#This collector gets teh content between the start and <<<.
|
272
|
-
#
|
273
|
-
#Collectors must support the methods << and to_doc.
|
274
|
-
#
|
275
|
-
#One predefined collector is html. It takes the content as 'plain text'.
|
276
|
-
#
|
277
|
-
def test_wiki_html_code()
|
278
|
-
wiki = Wikitext.new(:content => <<wiki
|
279
|
-
Beispiel:
|
280
|
-
>>>html{}
|
281
|
-
<div style = "float: right; background-color: yellow">
|
282
|
-
<strong>Fett</strong>
|
283
|
-
<em>kursiv</em>
|
284
|
-
</div>
|
285
|
-
<<<
|
286
|
-
Ende Beispiel
|
287
|
-
wiki
|
288
|
-
)
|
289
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_html_code.html", wiki.to_doc(:html, @opt))
|
290
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_html_code.latex", wiki.to_doc(:latex, @opt))
|
291
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_html_code.wiki", wiki.to_doc(:wiki, @opt))
|
292
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_html_code.text", wiki.to_doc(:text, @opt))
|
293
|
-
end
|
294
|
-
#
|
295
|
-
#Add File as verbatimtext
|
296
|
-
def test_wiki_verbatimfile()
|
297
|
-
#
|
298
|
-
#This test uses the coding of the test itself.
|
299
|
-
#
|
300
|
-
wiki = Wikitext.new(:content => <<wiki
|
301
|
-
{{verbatimfile|#{__FILE__}}}
|
302
|
-
wiki
|
303
|
-
)
|
304
|
-
|
305
|
-
escaped_filecontent = File.read(__FILE__).gsub(/</, '<').gsub(/>/, '>')
|
306
|
-
#~ puts wiki.to_latex[1..50].inspect
|
307
|
-
#~ puts wiki.to_latex[-50..-1].inspect
|
308
|
-
assert_equal( "<p ><pre>#{escaped_filecontent}</pre></p>\n", wiki.to_doc(:html, @opt))
|
309
|
-
assert_equal( "\n\n\n\\begin{verbatim}#{File.read(__FILE__)}\\end{verbatim}\n\n\n", wiki.to_doc(:latex, @opt))
|
310
|
-
|
311
|
-
#Add some attributes to the pre-environment.
|
312
|
-
wiki = Wikitext.new(:content => <<wiki
|
313
|
-
{{verbatimfile|#{__FILE__}|class=cssklasse}}
|
314
|
-
wiki
|
315
|
-
)
|
316
|
-
assert_equal( "<p ><pre class = \"cssklasse\" >#{escaped_filecontent}</pre></p>\n",
|
317
|
-
wiki.to_doc(:html, @opt))
|
318
|
-
end
|
319
|
-
#Add File as verbatimtext
|
320
|
-
def test_wiki_filecontent()
|
321
|
-
#
|
322
|
-
#This test uses the coding of the test itself.
|
323
|
-
#
|
324
|
-
wiki = Wikitext.new(:content => <<wiki
|
325
|
-
{{filecontent|#{__FILE__}}}
|
326
|
-
wiki
|
327
|
-
)
|
328
|
-
#~ puts wiki.to_latex[1..50].inspect
|
329
|
-
assert_equal( "<p ><div >#{File.read(__FILE__)}</div></p>\n", wiki.to_doc(:html, @opt))
|
330
|
-
assert_equal( "\n\n\\begingroup #{File.read(__FILE__)}\\endgroup \n\n", wiki.to_doc(:latex, @opt))
|
331
|
-
|
332
|
-
#Add some attributes to the pre-environment.
|
333
|
-
wiki = Wikitext.new(:content => <<wiki
|
334
|
-
{{filecontent|#{__FILE__}|class=cssklasse}}
|
335
|
-
wiki
|
336
|
-
)
|
337
|
-
assert_equal( "<p ><div class = \"cssklasse\" >#{File.read(__FILE__)}</div></p>\n",
|
338
|
-
wiki.to_doc(:html, @opt))
|
339
|
-
end
|
340
|
-
def test_wiki_footnote()
|
341
|
-
wiki = Wikitext.new(:content => <<wiki
|
342
|
-
Here is a footnote{{footnote|some remarks}}, and
|
343
|
-
a second footnote{{footnote|more remarks}}.
|
344
|
-
|
345
|
-
----
|
346
|
-
{{footnotes}}
|
347
|
-
wiki
|
348
|
-
)
|
349
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote.html", wiki.to_doc(:html, @opt))
|
350
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote_2.html", wiki.to_doc(:html, @opt))
|
351
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote.latex", wiki.to_doc(:latex, @opt))
|
352
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote.wiki", wiki.to_doc(:wiki, @opt))
|
353
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote.text", wiki.to_doc(:text, @opt))
|
354
|
-
end
|
355
|
-
def test_wiki_footnote_groupid()
|
356
|
-
wiki = Wikitext.new(:content => <<wiki
|
357
|
-
There are normal footnotes{{footnote|Like this one}}. But:
|
358
|
-
Here is a footnote in group 1{{footnote[group1]some remarks}}, and
|
359
|
-
a second footnote{{footnote[group1]more remarks}}.
|
360
|
-
In another group{{footnote[group2]Each group gets a name}}, we can define further remarks.
|
361
|
-
|
362
|
-
----
|
363
|
-
Normal Footnotes:
|
364
|
-
{{footnotes}}
|
365
|
-
----
|
366
|
-
Footnote group 1:
|
367
|
-
{{footnotes|group1}}
|
368
|
-
----
|
369
|
-
Footnote group 2:
|
370
|
-
{{footnotes|group2}}
|
371
|
-
wiki
|
372
|
-
)
|
373
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote_groupid.html", wiki.to_doc(:html, @opt))
|
374
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote_groupid.latex", wiki.to_doc(:latex, @opt))
|
375
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote_groupid.wiki", wiki.to_doc(:wiki, @opt))
|
376
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_footnote_groupid.text", wiki.to_doc(:text, @opt))
|
377
|
-
end
|
378
|
-
#~ Bilder lassen sich mit [ [Bild:Dateiname|Beschreibung]] in Artikel einf�gen.
|
379
|
-
#~ Das Bild wird dann in Originalgr��e links im Artikel angezeigt.
|
380
|
-
|
381
|
-
#~ Parameter sind optional mit [ [Bild:Dateiname|parameter|Beschreibung]] anzugeben.
|
382
|
-
#~ Es sind beliebig viele, mit | getrennte Parameter m�glich.
|
383
|
-
def test_wiki_picture()
|
384
|
-
wiki = Wikitext.new(:content => <<wiki
|
385
|
-
[[Bild:Red_Flower.jpg]]
|
386
|
-
|
387
|
-
[[Bild:Red_Flower.jpg|alt=description]]
|
388
|
-
[[Bild:Red_Flower.jpg|alt=description|beforetitle=vorher]]
|
389
|
-
[[Bild:Red_Flower.jpg|alt=description|aftertitle=nachher]]
|
390
|
-
|
391
|
-
[[Bild:Red_Flower.jpg|href=http://ruby.lickert.net]]
|
392
|
-
[[Bild:Red_Flower.jpg|href=http://ruby.lickert.net|alt=test]]
|
393
|
-
|
394
|
-
[[Bild:Red_Flower.jpg|right]]
|
395
|
-
[[Bild:Red_Flower.jpg|left]]
|
396
|
-
|
397
|
-
[[Bild:Red_Flower.jpg|width=123px]]
|
398
|
-
|
399
|
-
[[Bild:Red_Flower.jpg|class=pictureclass]]
|
400
|
-
[[Bild:Red_Flower.jpg|imgclass=imgclass]]
|
401
|
-
[[Bild:Red_Flower.jpg|figureclass=imgclass]]
|
402
|
-
wiki
|
403
|
-
)
|
404
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_picture.html", wiki.to_doc(:html, @opt))
|
405
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_picture.latex", wiki.to_doc(:latex, @opt))
|
406
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_picture.wiki", wiki.to_doc(:wiki, @opt))
|
407
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_picture.text", wiki.to_doc(:text, @opt))
|
408
|
-
|
409
|
-
wiki = Wikitext.new(:content => <<wiki
|
410
|
-
[[Bild:Red_Flower.jpg|thumb=testthumb.jpg]]
|
411
|
-
wiki
|
412
|
-
)
|
413
|
-
wiki.log.level = Log4r::FATAL #Avoid warning for missing picture
|
414
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_picture_thumb.html", wiki.to_doc(:html, @opt))
|
415
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_picture_thumb.latex", wiki.to_doc(:latex, @opt))
|
416
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_picture_thumb.wiki", wiki.to_doc(:wiki, @opt))
|
417
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_picture_thumb.text", wiki.to_doc(:text, @opt))
|
418
|
-
end
|
419
|
-
|
420
|
-
#
|
421
|
-
#
|
422
|
-
def test_wiki_link()
|
423
|
-
#thisfile is needed to avoid different values of __FILE__
|
424
|
-
#(Running stand alone it's the filename, with require it's './<<filename>>'
|
425
|
-
thisfile = File.basename(__FILE__)
|
426
|
-
|
427
|
-
wiki = Wikitext.new(:content => <<wiki
|
428
|
-
text before [./#{thisfile} link to test] text after
|
429
|
-
|
430
|
-
text before
|
431
|
-
[./#{thisfile} link to test]
|
432
|
-
text after
|
433
|
-
|
434
|
-
[./unexisting_file.xx link with error]
|
435
|
-
wiki
|
436
|
-
)
|
437
|
-
wiki.log.level = Log4r::FATAL
|
438
|
-
#~ wiki.log.outputters = Log4r::FileOutputter.new('wiki_link', :filename => "expected_wikimedia/test_wiki_link.log")
|
439
|
-
|
440
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_link.html", wiki.to_doc(:html, @opt))
|
441
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_link.log", wiki.to_doc(:html, @opt))
|
442
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_link.latex", wiki.to_doc(:latex, @opt))
|
443
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_link.wiki", wiki.to_doc(:wiki, @opt))
|
444
|
-
#~ assert_equal_filecontent( "expected_wikimedia/test_wiki_link.text", wiki.to_doc(:text, @opt))
|
445
|
-
end
|
446
|
-
end #TestWiki
|
447
|
-
|
448
|
-
def newtest(text)
|
449
|
-
code = <<code
|
450
|
-
def test_wiki_??()
|
451
|
-
wiki = Wikitext.new(:content => <<wiki
|
452
|
-
==Titel 1==
|
453
|
-
Text
|
454
|
-
wiki
|
455
|
-
)
|
456
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_??.html", wiki.to_doc(:html, @opt))
|
457
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_??.latex", wiki.to_doc(:latex, @opt))
|
458
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_??.wiki", wiki.to_doc(:wiki, @opt))
|
459
|
-
assert_equal_filecontent( "expected_wikimedia/test_wiki_??.text", wiki.to_doc(:text, @opt))
|
460
|
-
end
|
461
|
-
code
|
462
|
-
puts code.gsub(/\?\?/, text)
|
463
|
-
end
|
464
|
-
#~ newtest('link')
|
465
|
-
|
466
|
-
__END__
|
467
|
-
==Wiki2docgenerator.rb==
|
468
|
-
===Einr�ckungen===
|
469
|
-
Nicht realisiert, macht implizit Definitionsliste (fixme)
|
470
|
-
: Text macht implizit Definitionsliste (fixme)
|
471
|
-
:: Noch tiefer
|
472
|
-
|
473
|
-
==Makros==
|
474
|
-
Makros sind eingeleitet mit {{.
|
475
|
-
nach dem Makronamen sind Parameter mit | getrennt.
|
476
|
-
|
477
|
-
===Link ins ODP===
|
478
|
-
*{{dmoz|World/Deutsch}}
|
479
|
-
*{{dmoz|World/Deutsch|Deutschsprachige Inhalte}}
|