docgenerator 2.1.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (324) hide show
  1. checksums.yaml +4 -4
  2. data/lib/docgenerator.rb +18 -18
  3. data/lib/docgenerator/characters.rb +1 -0
  4. data/lib/docgenerator/css.rb +5 -0
  5. data/lib/docgenerator/document.rb +7 -2
  6. data/lib/docgenerator/element.rb +2 -2
  7. data/lib/docgenerator/elements.rb +69 -2
  8. data/lib/docgenerator/index.rb +1 -1
  9. data/lib/docgenerator/packages/listings.rb +94 -94
  10. data/lib/docgenerator/packages/multicol.rb +1 -1
  11. data/lib/docgenerator/packages/pdfpages.rb +2 -1
  12. data/lib/docgenerator/packages/rubycode4doc.rb +173 -172
  13. data/lib/docgenerator/packages/struktex.rb +395 -379
  14. data/lib/docgenerator/packages/todonotes.rb +2 -2
  15. data/lib/docgenerator/packages/url.rb +4 -0
  16. data/lib/docgenerator/sections.rb +24 -2
  17. data/lib/docgenerator/tabular.rb +59 -14
  18. data/lib/docgenerator/templates/docgenerator_template.rb +1 -0
  19. data/lib/docgenerator/templates/docgenerator_template.yaml +30 -1
  20. data/lib/docgenerator/version.rb +13 -1
  21. data/meta_test_and_doc/build__meta.rb +3 -10
  22. data/meta_test_and_doc/build_doc.rb +4 -2
  23. data/meta_test_and_doc/build_test.rb +21 -17
  24. data/meta_test_and_doc/manpages/images.rb +152 -0
  25. data/unittest/expected/test_document_toc_article.latex +6 -6
  26. data/unittest/expected_struktex/test_struktex_krug.creole +5 -5
  27. data/unittest/expected_struktex/test_struktex_krug.wiki +5 -5
  28. data/unittest/expected_struktex/test_struktex_statement.creole +4 -4
  29. data/unittest/expected_struktex/test_struktex_statement.wiki +4 -4
  30. data/unittest/expected_templates/test_report_utf8.tex +34 -0
  31. data/unittest/expected_templates/test_standalone.tex +2 -1
  32. data/unittest/unittest_docgenerator.rb +37 -30
  33. data/unittest/unittest_docgenerator_characters.rb +113 -60
  34. data/unittest/unittest_docgenerator_runtex.rb +16 -12
  35. data/unittest/unittest_packages_multicol.rb +4 -9
  36. data/unittest/unittest_packages_struktex.rb +66 -90
  37. data/unittest/unittest_rubycode4doc.rb +38 -241
  38. data/unittest/unittest_templates.rb +4 -8
  39. metadata +23 -560
  40. data/examples/creole_example.rb +0 -81
  41. data/examples/creole_example_footnote.rb +0 -67
  42. data/examples/creole_example_new_plugin.rb +0 -51
  43. data/examples/creole_example_placeholder.rb +0 -77
  44. data/examples/creole_example_rail.rb +0 -154
  45. data/examples/creole_example_rubycode.rb +0 -144
  46. data/examples/creole_example_struktex.rb +0 -169
  47. data/examples/creole_example_tabular.rb +0 -97
  48. data/examples/wiki2docgenerator_example.rb +0 -299
  49. data/lib/creole/creole2doc.rb +0 -954
  50. data/lib/creole/creole_characters.rb +0 -120
  51. data/lib/creole/creole_inclusion_and_plugins.rb +0 -96
  52. data/lib/creole/creole_inclusions.rb +0 -154
  53. data/lib/creole/creole_placeholder.rb +0 -171
  54. data/lib/creole/creole_plugins.rb +0 -230
  55. data/lib/creole/creole_tabular.rb +0 -401
  56. data/lib/creole/plugins/rail.rb +0 -181
  57. data/lib/creole/plugins/rubycode4creole.rb +0 -136
  58. data/lib/creole/plugins/struktex.rb +0 -59
  59. data/lib/creole/plugins/todonotes.rb +0 -77
  60. data/lib/wiki2doc/plugins/rubycode4wiki.rb +0 -53
  61. data/lib/wiki2doc/plugins/struktex.rb +0 -12
  62. data/lib/wiki2doc/wiki2docgenerator.rb +0 -1276
  63. data/lib/wiki2doc/wikimedia_document.rb +0 -24
  64. data/meta_test_and_doc/manpages/packages.rb +0 -13
  65. data/unittest/Red_Flower.jpg +0 -0
  66. data/unittest/creole1.0test.txt +0 -128
  67. data/unittest/creole_testtext.creole +0 -11
  68. data/unittest/expected_creole/test_creole.html +0 -3
  69. data/unittest/expected_creole/test_creole_characters_all.creole +0 -28
  70. data/unittest/expected_creole/test_creole_characters_all.html +0 -18
  71. data/unittest/expected_creole/test_creole_characters_all.latex +0 -36
  72. data/unittest/expected_creole/test_creole_characters_special.html +0 -10
  73. data/unittest/expected_creole/test_creole_characters_special.latex +0 -18
  74. data/unittest/expected_creole/test_creole_comment.context +0 -11
  75. data/unittest/expected_creole/test_creole_comment.creole +0 -12
  76. data/unittest/expected_creole/test_creole_comment.html +0 -9
  77. data/unittest/expected_creole/test_creole_comment.latex +0 -11
  78. data/unittest/expected_creole/test_creole_countdown.html +0 -3
  79. data/unittest/expected_creole/test_creole_countdown.latex +0 -4
  80. data/unittest/expected_creole/test_creole_creole1.0test.html +0 -182
  81. data/unittest/expected_creole/test_creole_creole1.0test.latex +0 -253
  82. data/unittest/expected_creole/test_creole_creole1.0test.text +0 -160
  83. data/unittest/expected_creole/test_creole_footnotes.html +0 -9
  84. data/unittest/expected_creole/test_creole_footnotes.latex +0 -14
  85. data/unittest/expected_creole/test_creole_footnotes_groupid.html +0 -15
  86. data/unittest/expected_creole/test_creole_footnotes_label.html +0 -9
  87. data/unittest/expected_creole/test_creole_headings.html +0 -17
  88. data/unittest/expected_creole/test_creole_headings.latex +0 -19
  89. data/unittest/expected_creole/test_creole_headings.text +0 -48
  90. data/unittest/expected_creole/test_creole_headings.wiki +0 -37
  91. data/unittest/expected_creole/test_creole_hr.html +0 -7
  92. data/unittest/expected_creole/test_creole_hr.latex +0 -9
  93. data/unittest/expected_creole/test_creole_hr.text +0 -4
  94. data/unittest/expected_creole/test_creole_ignore.html +0 -3
  95. data/unittest/expected_creole/test_creole_ignore.latex +0 -4
  96. data/unittest/expected_creole/test_creole_ignore.text +0 -2
  97. data/unittest/expected_creole/test_creole_inline.html +0 -3
  98. data/unittest/expected_creole/test_creole_inline.latex +0 -4
  99. data/unittest/expected_creole/test_creole_inline.text +0 -2
  100. data/unittest/expected_creole/test_creole_inline_apostroph.html +0 -6
  101. data/unittest/expected_creole/test_creole_inline_apostroph.latex +0 -8
  102. data/unittest/expected_creole/test_creole_inline_apostroph.text +0 -4
  103. data/unittest/expected_creole/test_creole_inline_ruby.html +0 -12
  104. data/unittest/expected_creole/test_creole_inline_ruby.latex +0 -20
  105. data/unittest/expected_creole/test_creole_inline_ruby_raw.html +0 -6
  106. data/unittest/expected_creole/test_creole_inline_ruby_raw.latex +0 -8
  107. data/unittest/expected_creole/test_creole_input.normsource +0 -25
  108. data/unittest/expected_creole/test_creole_input.normsource_1.8 +0 -23
  109. data/unittest/expected_creole/test_creole_input_file_simple.html +0 -15
  110. data/unittest/expected_creole/test_creole_input_file_simple_readlines.html +0 -15
  111. data/unittest/expected_creole/test_creole_label.html +0 -12
  112. data/unittest/expected_creole/test_creole_label.latex +0 -15
  113. data/unittest/expected_creole/test_creole_line_break.html +0 -6
  114. data/unittest/expected_creole/test_creole_line_break.latex +0 -8
  115. data/unittest/expected_creole/test_creole_links_explicit_internal.html +0 -6
  116. data/unittest/expected_creole/test_creole_links_explicit_internal.text +0 -4
  117. data/unittest/expected_creole/test_creole_links_explicit_with_em.html +0 -3
  118. data/unittest/expected_creole/test_creole_links_explicit_with_em.latex +0 -4
  119. data/unittest/expected_creole/test_creole_links_explicit_with_em.text +0 -2
  120. data/unittest/expected_creole/test_creole_links_external.html +0 -6
  121. data/unittest/expected_creole/test_creole_links_external.latex +0 -8
  122. data/unittest/expected_creole/test_creole_links_external.text +0 -4
  123. data/unittest/expected_creole/test_creole_links_external_implicit.html +0 -9
  124. data/unittest/expected_creole/test_creole_links_external_implicit.latex +0 -12
  125. data/unittest/expected_creole/test_creole_links_external_implicit.text +0 -6
  126. data/unittest/expected_creole/test_creole_links_file.html +0 -6
  127. data/unittest/expected_creole/test_creole_links_file.latex +0 -8
  128. data/unittest/expected_creole/test_creole_links_file.text +0 -4
  129. data/unittest/expected_creole/test_creole_links_implicit_end.creole +0 -4
  130. data/unittest/expected_creole/test_creole_links_implicit_end.html +0 -3
  131. data/unittest/expected_creole/test_creole_links_implicit_end.latex +0 -4
  132. data/unittest/expected_creole/test_creole_list_ol.html +0 -12
  133. data/unittest/expected_creole/test_creole_list_ol.latex +0 -22
  134. data/unittest/expected_creole/test_creole_list_ol_after_ul.html +0 -12
  135. data/unittest/expected_creole/test_creole_list_ol_after_ul.latex +0 -20
  136. data/unittest/expected_creole/test_creole_list_ol_after_ul.text +0 -6
  137. data/unittest/expected_creole/test_creole_list_ol_ul.html +0 -15
  138. data/unittest/expected_creole/test_creole_list_ol_ul.latex +0 -26
  139. data/unittest/expected_creole/test_creole_list_ul.html +0 -22
  140. data/unittest/expected_creole/test_creole_list_ul.latex +0 -40
  141. data/unittest/expected_creole/test_creole_list_ul.normsource +0 -89
  142. data/unittest/expected_creole/test_creole_list_ul.normsource_1.8 +0 -83
  143. data/unittest/expected_creole/test_creole_list_ul_too_much.html +0 -24
  144. data/unittest/expected_creole/test_creole_list_ul_too_much.latex +0 -44
  145. data/unittest/expected_creole/test_creole_list_ulul_without_ul.html +0 -6
  146. data/unittest/expected_creole/test_creole_list_ulul_without_ul.latex +0 -12
  147. data/unittest/expected_creole/test_creole_mix_titles_list.html +0 -10
  148. data/unittest/expected_creole/test_creole_mix_titles_list.latex +0 -18
  149. data/unittest/expected_creole/test_creole_mix_titles_list.text +0 -12
  150. data/unittest/expected_creole/test_creole_newline.html +0 -9
  151. data/unittest/expected_creole/test_creole_newline.latex +0 -11
  152. data/unittest/expected_creole/test_creole_newline.text +0 -7
  153. data/unittest/expected_creole/test_creole_paragraphs.html +0 -6
  154. data/unittest/expected_creole/test_creole_paragraphs.latex +0 -8
  155. data/unittest/expected_creole/test_creole_paragraphs.normsource +0 -29
  156. data/unittest/expected_creole/test_creole_paragraphs.normsource_1.8 +0 -27
  157. data/unittest/expected_creole/test_creole_paragraphs.text +0 -4
  158. data/unittest/expected_creole/test_creole_paragraphs.wiki +0 -4
  159. data/unittest/expected_creole/test_creole_paragraphs_wrap.html +0 -5
  160. data/unittest/expected_creole/test_creole_paragraphs_wrap.latex +0 -6
  161. data/unittest/expected_creole/test_creole_paragraphs_wrap.text +0 -4
  162. data/unittest/expected_creole/test_creole_paragraphs_wrap.wiki +0 -4
  163. data/unittest/expected_creole/test_creole_paragraphs_wrap0.html +0 -9
  164. data/unittest/expected_creole/test_creole_paragraphs_wrap0.latex +0 -11
  165. data/unittest/expected_creole/test_creole_paragraphs_wrap0.text +0 -7
  166. data/unittest/expected_creole/test_creole_paragraphs_wrap0.wiki +0 -7
  167. data/unittest/expected_creole/test_creole_paragraphs_wrap60.html +0 -5
  168. data/unittest/expected_creole/test_creole_paragraphs_wrap60.latex +0 -6
  169. data/unittest/expected_creole/test_creole_paragraphs_wrap60.text +0 -4
  170. data/unittest/expected_creole/test_creole_paragraphs_wrap60.wiki +0 -4
  171. data/unittest/expected_creole/test_creole_picture_link.html +0 -6
  172. data/unittest/expected_creole/test_creole_pictures.html +0 -10
  173. data/unittest/expected_creole/test_creole_pictures.latex +0 -13
  174. data/unittest/expected_creole/test_creole_pictures_css.html +0 -6
  175. data/unittest/expected_creole/test_creole_pictures_css.latex +0 -8
  176. data/unittest/expected_creole/test_creole_pictures_imgclass.html +0 -6
  177. data/unittest/expected_creole/test_creole_pictures_imgclass.latex +0 -8
  178. data/unittest/expected_creole/test_creole_pictures_longdesc.html +0 -3
  179. data/unittest/expected_creole/test_creole_pictures_width.html +0 -3
  180. data/unittest/expected_creole/test_creole_pictures_width.latex +0 -4
  181. data/unittest/expected_creole/test_creole_placeholders_html.html +0 -7
  182. data/unittest/expected_creole/test_creole_placeholders_html.latex +0 -8
  183. data/unittest/expected_creole/test_creole_placeholders_html.text +0 -4
  184. data/unittest/expected_creole/test_creole_placeholders_latex.html +0 -6
  185. data/unittest/expected_creole/test_creole_placeholders_latex.latex +0 -9
  186. data/unittest/expected_creole/test_creole_placeholders_latex.text +0 -4
  187. data/unittest/expected_creole/test_creole_short_html.html +0 -3
  188. data/unittest/expected_creole/test_creole_short_html.latex +0 -4
  189. data/unittest/expected_creole/test_creole_short_html.text +0 -2
  190. data/unittest/expected_creole/test_creole_shy.creole +0 -6
  191. data/unittest/expected_creole/test_creole_shy.html +0 -6
  192. data/unittest/expected_creole/test_creole_shy.latex +0 -8
  193. data/unittest/expected_creole/test_creole_shy.text +0 -4
  194. data/unittest/expected_creole/test_creole_tabular.creole +0 -22
  195. data/unittest/expected_creole/test_creole_tabular.html +0 -20
  196. data/unittest/expected_creole/test_creole_tabular.latex +0 -22
  197. data/unittest/expected_creole/test_creole_tabular_creole.creole +0 -19
  198. data/unittest/expected_creole/test_creole_tabular_creole.html +0 -18
  199. data/unittest/expected_creole/test_creole_tabular_creole.latex +0 -19
  200. data/unittest/expected_creole/test_creole_tabular_css.creole +0 -24
  201. data/unittest/expected_creole/test_creole_tabular_css.html +0 -20
  202. data/unittest/expected_creole/test_creole_tabular_css.latex +0 -22
  203. data/unittest/expected_creole/test_creole_tabular_multicols.creole +0 -16
  204. data/unittest/expected_creole/test_creole_tabular_multicols.html +0 -14
  205. data/unittest/expected_creole/test_creole_tabular_multicols.latex +0 -16
  206. data/unittest/expected_creole/test_creole_tabular_row_parameters.latex +0 -22
  207. data/unittest/expected_creole/test_creole_tabular_with_cell_option.creole +0 -21
  208. data/unittest/expected_creole/test_creole_tabular_with_cell_option.html +0 -20
  209. data/unittest/expected_creole/test_creole_toc.html +0 -13
  210. data/unittest/expected_creole/test_creole_toc.latex +0 -22
  211. data/unittest/expected_creole/test_creole_toc.text +0 -4
  212. data/unittest/expected_creole/test_creole_toc_level.html +0 -7
  213. data/unittest/expected_creole/test_creole_toc_level.latex +0 -10
  214. data/unittest/expected_creole/test_creole_toc_level.text +0 -3
  215. data/unittest/expected_creole/test_creole_toc_level_text.html +0 -8
  216. data/unittest/expected_creole/test_creole_toc_level_text.latex +0 -9
  217. data/unittest/expected_creole/test_creole_toc_text.html +0 -5
  218. data/unittest/expected_creole/test_creole_toc_text.latex +0 -5
  219. data/unittest/expected_creole/test_creole_ul_multiple_line.html +0 -7
  220. data/unittest/expected_creole/test_creole_ul_multiple_line.latex +0 -14
  221. data/unittest/expected_creole/test_creole_ul_with_blank.html +0 -11
  222. data/unittest/expected_creole/test_creole_ul_with_blank.latex +0 -20
  223. data/unittest/expected_creole/test_creole_ul_with_bold.creole +0 -0
  224. data/unittest/expected_creole/test_creole_ul_with_bold.html +0 -11
  225. data/unittest/expected_creole/test_creole_ul_with_bold.latex +0 -18
  226. data/unittest/expected_creole/test_creole_ul_with_bold.text +0 -7
  227. data/unittest/expected_creole/test_creole_verbatim.html +0 -25
  228. data/unittest/expected_creole/test_creole_verbatim.latex +0 -33
  229. data/unittest/expected_creole/test_creole_verbatim.text +0 -17
  230. data/unittest/expected_creole/test_creole_verbatim_inline.html +0 -6
  231. data/unittest/expected_creole/test_creole_verbatim_inline.latex +0 -8
  232. data/unittest/expected_creole/test_creole_verbatim_inline_at_start.html +0 -6
  233. data/unittest/expected_creole/test_creole_verbatim_inline_at_start.latex +0 -8
  234. data/unittest/expected_creole_rail/test_rail_creole_object.tex +0 -33
  235. data/unittest/expected_creole_rail/test_rail_creole_placeholder.tex +0 -40
  236. data/unittest/expected_rubycode4doc/creole_complete.html +0 -26
  237. data/unittest/expected_rubycode4doc/creole_complete.tex +0 -40
  238. data/unittest/expected_rubycode4doc/creole_in_tab.html +0 -4
  239. data/unittest/expected_rubycode4doc/creole_in_tab.tex +0 -6
  240. data/unittest/expected_rubycode4doc/creole_inline_ruby.html +0 -7
  241. data/unittest/expected_rubycode4doc/creole_output.html +0 -2
  242. data/unittest/expected_rubycode4doc/creole_output.tex +0 -4
  243. data/unittest/expected_rubycode4doc/creole_rubycode.html +0 -1
  244. data/unittest/expected_rubycode4doc/creole_rubycode.tex +0 -3
  245. data/unittest/expected_rubycode4doc/creole_rubycode_evaluated.html +0 -1
  246. data/unittest/expected_rubycode4doc/creole_rubycode_evaluated.tex +0 -3
  247. data/unittest/expected_rubycode4doc/creole_rubycode_evaluated_listings.html +0 -3
  248. data/unittest/expected_rubycode4doc/creole_rubycode_evaluated_listings.tex +0 -5
  249. data/unittest/expected_rubycode4doc/wiki_1.html +0 -8
  250. data/unittest/expected_rubycode4doc/wiki_2.html +0 -8
  251. data/unittest/expected_rubycode4doc/wiki_3.html +0 -9
  252. data/unittest/expected_rubycode4doc/wiki_immediate_1.html +0 -5
  253. data/unittest/expected_rubycode4doc/wiki_immediate_2.html +0 -5
  254. data/unittest/expected_rubycode4doc/wiki_immediate_3.html +0 -8
  255. data/unittest/expected_rubycode4doc/wiki_immediate_full.html +0 -21
  256. data/unittest/expected_wikimedia/test_wiki.html +0 -6
  257. data/unittest/expected_wikimedia/test_wiki.latex +0 -12
  258. data/unittest/expected_wikimedia/test_wiki.text +0 -14
  259. data/unittest/expected_wikimedia/test_wiki.wiki +0 -12
  260. data/unittest/expected_wikimedia/test_wiki_description.html +0 -7
  261. data/unittest/expected_wikimedia/test_wiki_description.latex +0 -11
  262. data/unittest/expected_wikimedia/test_wiki_description.text +0 -6
  263. data/unittest/expected_wikimedia/test_wiki_description.wiki +0 -6
  264. data/unittest/expected_wikimedia/test_wiki_footnote.html +0 -8
  265. data/unittest/expected_wikimedia/test_wiki_footnote.latex +0 -17
  266. data/unittest/expected_wikimedia/test_wiki_footnote.text +0 -10
  267. data/unittest/expected_wikimedia/test_wiki_footnote.wiki +0 -10
  268. data/unittest/expected_wikimedia/test_wiki_footnote_2.html +0 -8
  269. data/unittest/expected_wikimedia/test_wiki_footnote_groupid.html +0 -21
  270. data/unittest/expected_wikimedia/test_wiki_html_code.html +0 -7
  271. data/unittest/expected_wikimedia/test_wiki_html_code.latex +0 -10
  272. data/unittest/expected_wikimedia/test_wiki_html_code.text +0 -6
  273. data/unittest/expected_wikimedia/test_wiki_html_code.wiki +0 -6
  274. data/unittest/expected_wikimedia/test_wiki_inline.html +0 -6
  275. data/unittest/expected_wikimedia/test_wiki_inline.latex +0 -12
  276. data/unittest/expected_wikimedia/test_wiki_inline.text +0 -8
  277. data/unittest/expected_wikimedia/test_wiki_inline.wiki +0 -8
  278. data/unittest/expected_wikimedia/test_wiki_label.html +0 -6
  279. data/unittest/expected_wikimedia/test_wiki_link.html +0 -8
  280. data/unittest/expected_wikimedia/test_wiki_link.latex +0 -17
  281. data/unittest/expected_wikimedia/test_wiki_link.wiki +0 -11
  282. data/unittest/expected_wikimedia/test_wiki_list_ol.html +0 -24
  283. data/unittest/expected_wikimedia/test_wiki_list_ol.latex +0 -30
  284. data/unittest/expected_wikimedia/test_wiki_list_ol.text +0 -10
  285. data/unittest/expected_wikimedia/test_wiki_list_ol.wiki +0 -12
  286. data/unittest/expected_wikimedia/test_wiki_list_ol_after_ul.html +0 -16
  287. data/unittest/expected_wikimedia/test_wiki_list_ol_after_ul.latex +0 -24
  288. data/unittest/expected_wikimedia/test_wiki_list_ol_after_ul.text +0 -8
  289. data/unittest/expected_wikimedia/test_wiki_list_ol_after_ul.wiki +0 -10
  290. data/unittest/expected_wikimedia/test_wiki_list_ol_ul.html +0 -24
  291. data/unittest/expected_wikimedia/test_wiki_list_ol_ul.latex +0 -30
  292. data/unittest/expected_wikimedia/test_wiki_list_ol_ul.text +0 -10
  293. data/unittest/expected_wikimedia/test_wiki_list_ol_ul.wiki +0 -12
  294. data/unittest/expected_wikimedia/test_wiki_list_ul.html +0 -24
  295. data/unittest/expected_wikimedia/test_wiki_list_ul.latex +0 -30
  296. data/unittest/expected_wikimedia/test_wiki_list_ul.text +0 -10
  297. data/unittest/expected_wikimedia/test_wiki_list_ul.wiki +0 -12
  298. data/unittest/expected_wikimedia/test_wiki_list_ul_too_much.html +0 -39
  299. data/unittest/expected_wikimedia/test_wiki_list_ul_too_much.latex +0 -51
  300. data/unittest/expected_wikimedia/test_wiki_list_ul_too_much.text +0 -11
  301. data/unittest/expected_wikimedia/test_wiki_list_ul_too_much.wiki +0 -15
  302. data/unittest/expected_wikimedia/test_wiki_picture.html +0 -55
  303. data/unittest/expected_wikimedia/test_wiki_picture.latex +0 -76
  304. data/unittest/expected_wikimedia/test_wiki_picture_thumb.html +0 -5
  305. data/unittest/expected_wikimedia/test_wiki_tab1.html +0 -30
  306. data/unittest/expected_wikimedia/test_wiki_tab1.latex +0 -30
  307. data/unittest/expected_wikimedia/test_wiki_tab1.wiki +0 -29
  308. data/unittest/expected_wikimedia/test_wiki_textformatting.html +0 -7
  309. data/unittest/expected_wikimedia/test_wiki_textformatting.latex +0 -16
  310. data/unittest/expected_wikimedia/test_wiki_textformatting.text +0 -11
  311. data/unittest/expected_wikimedia/test_wiki_textformatting.wiki +0 -9
  312. data/unittest/expected_wikimedia/test_wiki_toc.html +0 -9
  313. data/unittest/expected_wikimedia/test_wiki_toc.latex +0 -18
  314. data/unittest/expected_wikimedia/test_wiki_toc.text +0 -21
  315. data/unittest/expected_wikimedia/test_wiki_toc.wiki +0 -18
  316. data/unittest/expected_wikimedia/test_wiki_ul_multiple_line.html +0 -18
  317. data/unittest/expected_wikimedia/test_wiki_ul_multiple_line.latex +0 -19
  318. data/unittest/expected_wikimedia/test_wiki_ul_multiple_line.text +0 -6
  319. data/unittest/expected_wikimedia/test_wiki_ul_multiple_line.wiki +0 -7
  320. data/unittest/unittest_creole.rb +0 -1361
  321. data/unittest/unittest_creole_placeholders.rb +0 -150
  322. data/unittest/unittest_creole_plugin_rail.rb +0 -147
  323. data/unittest/unittest_creole_tabular.rb +0 -207
  324. data/unittest/unittest_wikimedia.rb +0 -479
@@ -1,5 +0,0 @@
1
- <p ><span >
2
- <a href = "Red_Flower.jpg" ><img src = "testthumb.jpg" /></a>
3
- </span>
4
-
5
- </p>
@@ -1,30 +0,0 @@
1
-
2
- <table >
3
- <tr ><td colspan = "4" >Titel</td>
4
- </tr>
5
- <tr ><td >1A</td>
6
- <td >1B</td>
7
- <td >1C</td>
8
- <td >1D</td>
9
- </tr>
10
- <tr ><td >2A</td>
11
- <td >2B</td>
12
- <td >2C</td>
13
- <td >2D</td>
14
- </tr>
15
- <tr ><td >3A</td>
16
- <td >3B</td>
17
- <td >3C</td>
18
- <td >3D</td>
19
- </tr>
20
- <tr ><td >4A</td>
21
- <td >4B</td>
22
- <td >4C</td>
23
- <td >4D</td>
24
- </tr>
25
- <tr ><td >5A</td>
26
- <td >5B</td>
27
- <td >5C</td>
28
- <td >5D</td>
29
- </tr>
30
- </table>
@@ -1,30 +0,0 @@
1
-
2
- \begin{tabular}{cccc}
3
- \multicolumn{4}{c}{Titel}
4
- \\
5
- 1A
6
- & 1B
7
- & 1C
8
- & 1D
9
- \\
10
- 2A
11
- & 2B
12
- & 2C
13
- & 2D
14
- \\
15
- 3A
16
- & 3B
17
- & 3C
18
- & 3D
19
- \\
20
- 4A
21
- & 4B
22
- & 4C
23
- & 4D
24
- \\
25
- 5A
26
- & 5B
27
- & 5C
28
- & 5D
29
- \\
30
- \end{tabular}
@@ -1,29 +0,0 @@
1
- {|
2
- |-
3
- |columns=4|pos=c||Titel
4
- |-
5
- |1A
6
- |1B
7
- |1C
8
- |1D
9
- |-
10
- |2A
11
- |2B
12
- |2C
13
- |2D
14
- |-
15
- |3A
16
- |3B
17
- |3C
18
- |3D
19
- |-
20
- |4A
21
- |4B
22
- |4C
23
- |4D
24
- |-
25
- |5A
26
- |5B
27
- |5C
28
- |5D
29
- |}
@@ -1,7 +0,0 @@
1
- <p >vorher<br />Nachher
2
- </p>
3
- <p >vorher<br clear = "all" />Nachher
4
- </p>
5
- <hr />
6
- <p >Nach einer Trennlinie
7
- </p>
@@ -1,16 +0,0 @@
1
-
2
-
3
- vorher\newline Nachher
4
-
5
-
6
-
7
-
8
- vorher\newline Nachher
9
-
10
-
11
- \hrulefill
12
-
13
-
14
- Nach einer Trennlinie
15
-
16
-
@@ -1,11 +0,0 @@
1
-
2
- vorher
3
- Nachher
4
-
5
-
6
- vorher
7
- Nachher
8
-
9
- -------------------------
10
- Nach einer Trennlinie
11
-
@@ -1,9 +0,0 @@
1
-
2
- vorher{{newline}}Nachher
3
-
4
-
5
- vorher{{newline}}Nachher
6
-
7
- ----
8
- Nach einer Trennlinie
9
-
@@ -1,9 +0,0 @@
1
- <h1 >Titel 1</h1>
2
- <p >Text
3
- </p>
4
- <h2 >Titel 2</h2>
5
- <p >Text unter Titel 2
6
- </p>
7
- <h2 id = "2b" >Titel 2b</h2>
8
- <p >Text unter Titel 2b
9
- </p>
@@ -1,18 +0,0 @@
1
- \section{Titel 1}
2
-
3
-
4
- Text
5
-
6
-
7
- \subsection{Titel 2}
8
-
9
-
10
- Text unter Titel 2
11
-
12
-
13
- \subsection{Titel 2b}\hypertarget{2b}{}
14
-
15
-
16
- Text unter Titel 2b
17
-
18
-
@@ -1,21 +0,0 @@
1
-
2
- Titel 1
3
- ------------------------------
4
-
5
-
6
- Text
7
-
8
-
9
- Titel 2
10
- ------------------------------
11
-
12
-
13
- Text unter Titel 2
14
-
15
-
16
- Titel 2b
17
- ------------------------------
18
-
19
-
20
- Text unter Titel 2b
21
-
@@ -1,18 +0,0 @@
1
-
2
- ==Titel 1==
3
-
4
-
5
- Text
6
-
7
-
8
- ===Titel 2===
9
-
10
-
11
- Text unter Titel 2
12
-
13
-
14
- ===Titel 2b===
15
-
16
-
17
- Text unter Titel 2b
18
-
@@ -1,18 +0,0 @@
1
-
2
- <ul >
3
- <li >
4
- vorher
5
- </li>
6
- <li >
7
- text mehr text zum item
8
- </li>
9
- <li >
10
- nachher und vorher
11
- </li>
12
- <li >
13
- text mehr text zum item<p >neuer Absatz im Item funktioniert auch.</p>
14
- </li>
15
- <li >
16
- nachher
17
- </li>
18
- </ul>
@@ -1,19 +0,0 @@
1
-
2
-
3
- \begin{itemize}
4
-
5
- \item vorher
6
-
7
- \item text mehr text zum item
8
-
9
- \item nachher und vorher
10
-
11
- \item text mehr text zum item
12
-
13
- neuer Absatz im Item funktioniert auch.
14
-
15
-
16
-
17
- \item nachher
18
- \end{itemize}
19
-
@@ -1,6 +0,0 @@
1
- - vorher
2
- - text mehr text zum item
3
- - nachher und vorher
4
- - text mehr text zum item
5
- neuer Absatz im Item funktioniert auch.
6
- - nachher
@@ -1,7 +0,0 @@
1
-
2
- * vorher
3
- * text mehr text zum item
4
- * nachher und vorher
5
- * text mehr text zum item
6
- neuer Absatz im Item funktioniert auch.
7
- * nachher
@@ -1,1361 +0,0 @@
1
- # encoding: cp1252
2
- if $0 == __FILE__
3
- $:.unshift("../lib")
4
- end
5
-
6
- gem 'more_unit_test' #Wichtig das unit test-version correct verwendet wird
7
- #~ gem 'test-unit', '~> 2'
8
- require 'test/unit'
9
- require 'more_unit_test/assert_equal_filecontent.rb'
10
-
11
- require 'creole/creole2doc.rb'
12
-
13
- #~ Docgenerator.trace_on
14
-
15
- <<missingtests
16
- see Text and
17
- description
18
- labels
19
-
20
- <<ruby>>
21
-
22
- Creole_document
23
- *content mit level..., \tableofcontents...
24
-
25
- Bug:
26
- http://... am Ende ohne folgenden Text wird falsch erkannt.
27
- --> test_creole_links_implicit_end()
28
- missingtests
29
-
30
- #thisfile is needed to avoid different values of $thisfile
31
- #(Running stand alone it's the filename, with require it's './<<filename>>'
32
- $thisfile = File.basename(__FILE__)
33
-
34
- class Docgenerator::Creole::Creole
35
- #Access to the options.
36
- attr_reader :options
37
- end
38
-
39
- require 'yaml'
40
- require 'log4r'
41
- #
42
- #Warn -> report missing important test
43
- #Info -> report missing test
44
-
45
- $log = Log4r::Logger.new('Unittest creole', Log4r::ERROR)
46
- #~ $log = Log4r::Logger.new('Unittest creole', Log4r::WARN)
47
- #~ $log = Log4r::Logger.new('Unittest creole', Log4r::INFO)
48
- $log.outputters = Log4r::StdoutOutputter.new('log_stdout')
49
-
50
- #Logger to catch unwanted messages
51
- $tmplog = Log4r::Logger.new('Creole', Log4r::FATAL)
52
-
53
- class Test_creole_basics < Test::Unit::TestCase
54
- def setup()
55
- #Avoid warnings about missing logger in to_doc
56
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
57
- end
58
- #Test some basic definitions.
59
- def test_creole_initialize()
60
- creole = Docgenerator::Creole::Creole.new(
61
- :content => 'test'
62
- )
63
- assert_instance_of( Log4r::Logger, creole.log)
64
- assert_equal( Log4r::INFO, creole.log.level, "Default Level of Default-Logger (creole.log) changed:")
65
- assert_instance_of( Log4r::StdoutOutputter, creole.log.outputters.first)
66
- #~ assert_equal( Log4r::DEBUG, creole.log.outputters.first.level)
67
- assert_equal( creole.options[:wrap_at], 75 )
68
- end
69
- # Get some content and check the content.
70
- def test_creole_input_string()
71
- source = <<creole
72
- Text,
73
- more Text.
74
- And some more text.
75
-
76
- A new paragraph.
77
- creole
78
- creole = Docgenerator::Creole::Creole.new(:content => source )
79
- assert_equal( [source], creole.source)
80
-
81
- #ruby 1.8: symbols as key, ruby 1.9: Strings
82
- #~ omit_if( RUBY_VERSION !~ /1.9/, "Wrong ruby version #{RUBY_VERSION}"){
83
- assert_equal_filecontent( "expected_creole/test_creole_input.normsource", creole.normsource.to_yaml)
84
- #~ }
85
-
86
- creole = Docgenerator::Creole::Creole.new(:content => source )
87
- creole = Docgenerator::Creole::Creole.new()
88
- creole << source
89
- creole << source
90
- assert_equal( [source, source], creole.source)
91
- end
92
- def test_creole_input_array()
93
-
94
- creole = Docgenerator::Creole::Creole.new(:content => [ "Text1", "Text2" ] )
95
- assert_equal( ["Text1\nText2"], creole.source)
96
-
97
- creole = Docgenerator::Creole::Creole.new(:content => [ "Text1\n", "Text2" ] )
98
- assert_equal( ["Text1\nText2"], creole.source)
99
-
100
- #Leading spaces keep staying
101
- creole = Docgenerator::Creole::Creole.new(:content => [ " Text1\n", "Text2" ] )
102
- assert_equal( [" Text1\nText2"], creole.source)
103
-
104
- #Trailing spaces keep staying
105
- creole = Docgenerator::Creole::Creole.new(:content => [ "Text1 \n", "Text2" ] )
106
- assert_equal( ["Text1 \nText2"], creole.source)
107
-
108
- end #
109
- def test_creole_input_undefined()
110
- assert_nothing_raised(RuntimeError){ Docgenerator::Creole::Creole.new(:content => 'source' ) }
111
- #~ assert_nothing_raised(RuntimeError){ Creole.new(:content => ['source'] ) }
112
- assert_raise(Docgenerator::Creole::Creole::InputError){ Docgenerator::Creole::Creole.new(:content => :source ) }
113
- end
114
- #Check for open File-handles
115
- def test_creole_input_file()
116
- creole1 = Docgenerator::Creole::Creole.new( :content => File.read('creole1.0test.txt') )
117
- creole2 = nil
118
- File.open('creole1.0test.txt'){|filehandle|
119
- creole2 = Docgenerator::Creole::Creole.new( :content => filehandle )
120
- }
121
- assert_equal( creole1.source, creole2.source)
122
- end
123
- #
124
- #Test for filehandle, if the file is a Rubyscript (Take only parts after __END__)
125
- def test_creole_input_file_rb()
126
- #ignore this test, if tests are loaded via require.
127
- return unless $0 == __FILE__
128
-
129
- creole1 = Docgenerator::Creole::Creole.new( :name => 'input_file_rb/DATA', :content => DATA )
130
-
131
- creole2 = nil
132
- File.open($thisfile){|filehandle|
133
- #~ $log.warn('Test Filehandle auf ruby nicht m�glich (Test $0 == input.path)')
134
- #Modify $0 temporary to allow test with condition $0 == input.path
135
- $0 = "xxxx#{$thisfile}"
136
- creole2 = Docgenerator::Creole::Creole.new( :name => 'input_file_rb', :content => filehandle, :log => $tmplog )
137
- $0 = $thisfile
138
- }
139
- #normalize line ends
140
- assert_equal( creole1.source.map{|entry|entry.gsub( /\r\n?/, "\n")}, creole2.source)
141
- end
142
- def test_creole_input_file_simple
143
- assert_true(File.exist?('creole_testtext.creole'))
144
- creole = Docgenerator::Creole::Creole.new()
145
- File.open('creole_testtext.creole'){|f| creole << f.readlines }
146
- end
147
- def test_creole_input_file_simple_readlines
148
- creole = Docgenerator::Creole::Creole.new()
149
- File.open('creole_testtext.creole'){|f| creole << f }
150
- assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html, @opt))
151
- end
152
- #
153
- #This testcases are taken from http://www.wikicreole.org/wiki/Creole1.0TestCases
154
- def test_creole_creole1_0test()
155
- $log.info('Testcases uncomplete creole1.0test.txt')
156
- #Logger w/o messages
157
- @opt_silent = { :log => Log4r::Logger.new('silent') }
158
- creole = Docgenerator::Creole::Creole.new(
159
- :name => 'creole_creole1_0test',
160
- :content => File.readlines('creole1.0test.txt').join,
161
- :log => $tmplog #catch warning for [[links]]
162
- )
163
-
164
- assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.html", creole.to_doc(:html, @opt_silent))
165
- assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.latex", creole.to_doc(:latex, @opt_silent))
166
- $log.warn('test_creole_creole1.0test: to_context')
167
- #~ assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.context", creole.to_doc(:context))
168
- $log.info('test_creole_creole1_0test: uncomplete to_creole')
169
- #~ assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.creole", creole.to_doc(:creole, @opt))
170
- assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.text", creole.to_doc(:text, @opt_silent))
171
- end
172
- end #Test_creole_basics
173
-
174
- class Test_creole_paragraphs < Test::Unit::TestCase
175
- def setup()
176
- #Avoid warnings about missing logger in to_doc
177
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
178
- end
179
-
180
- def test_creole_paragraphs()
181
- source = <<creole
182
- This is some text,
183
- followed by more Text.
184
- And some more text.
185
-
186
- And now a new paragraph with some other text.
187
-
188
- creole
189
- creole = Docgenerator::Creole::Creole.new(:content => source )
190
- assert_equal( [source], creole.source)
191
-
192
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs.html", creole.to_doc(:html, @opt))
193
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs.latex", creole.to_doc(:latex, @opt))
194
- $log.warn('test_creole_paragraphs: to_context')
195
- #~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs.context", creole.to_doc(:context))
196
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs.wiki", creole.to_doc(:wiki, @opt))
197
- $log.info('test_creole_paragraphs: uncomplete to_creole')
198
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs.text", creole.to_doc(:text, @opt))
199
-
200
- #ruby 1.8: symbols as key, ruby 1.9: Strings
201
- #~ omit_if( RUBY_VERSION !~ /1.9/, "Wrong ruby version #{RUBY_VERSION}"){
202
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs.normsource", creole.normsource.to_yaml)
203
- #~ }
204
- end
205
- def test_creole_paragraphs_wrap()
206
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
207
- And now a line which is a bit longer then 80 characters in the input line. Creole should split it at position 75 or a bit later (depending on the word length at position 75).
208
- creole
209
- )
210
-
211
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.html", creole.to_doc(:html, @opt))
212
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.latex", creole.to_doc(:latex, @opt))
213
- $log.warn('test_creole_paragraphs_wrap: to_context')
214
- #~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.context", creole.to_doc(:context))
215
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.wiki", creole.to_doc(:wiki, @opt))
216
- $log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
217
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.text", creole.to_doc(:text, @opt))
218
- end #test_creole_paragraphs_wrap()
219
- def test_creole_paragraphs_wrap60()
220
-
221
- creole = Docgenerator::Creole::Creole.new(:wrap_at => 60, :content => <<creole
222
- And now a line which is a bit longer then 80 characters in the input line. Creole should split it at position 60 or a bit later (depending on the word length at position 60).
223
- creole
224
- )
225
-
226
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.html", creole.to_doc(:html, @opt))
227
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.latex", creole.to_doc(:latex, @opt))
228
- $log.warn('test_creole_paragraphs_wrap60: to_context')
229
- #~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.context", creole.to_doc(:context))
230
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.wiki", creole.to_doc(:wiki, @opt))
231
- $log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
232
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.text", creole.to_doc(:text, @opt))
233
- end #test_creole_paragraphs_wrap60()
234
-
235
- def test_creole_paragraphs_wrap0()
236
-
237
- creole = Docgenerator::Creole::Creole.new(:wrap_at => 0, :content => <<creole
238
- And now a line which is a bit longer then 80 characters in the input line. Creole should not split it, because we defined split_at to 0.
239
-
240
- And now a line which is a bit longer then 80 characters in the input line.
241
- Creole should not split it, because we defined split_at to 0.
242
- creole
243
- )
244
-
245
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.html", creole.to_doc(:html, @opt))
246
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.latex", creole.to_doc(:latex, @opt))
247
- $log.warn('test_creole_paragraphs_wrap0: to_context')
248
- #~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.context", creole.to_doc(:context))
249
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.wiki", creole.to_doc(:wiki, @opt))
250
- $log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
251
- assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.text", creole.to_doc(:text, @opt))
252
- end
253
- end #Test_creole_paragraphs < Test::Unit::TestCase
254
-
255
- class Test_creole_headings < Test::Unit::TestCase
256
- def setup()
257
- #Avoid warnings about missing logger in to_doc
258
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
259
- end
260
-
261
- def test_creole_headings()
262
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
263
- = Top-level heading (1)
264
- == This a test for creole 0.1 (2)
265
- === This is a Subheading (3)
266
- ==== Subsub (4)
267
- ===== Subsubsub (5)
268
-
269
- The ending equal signs should not be displayed:
270
-
271
- = Top-level heading (1) =
272
- == This a test for creole 0.1 (2) ==
273
- === This is a Subheading (3) ===
274
- ==== Subsub (4) ====
275
- ===== Subsubsub (5) =====
276
-
277
-
278
- = **not** //parsed// =
279
- The content is not parsed.
280
- creole
281
- )
282
-
283
- assert_equal_filecontent( "expected_creole/test_creole_headings.html", creole.to_doc(:html, @opt))
284
- assert_equal_filecontent( "expected_creole/test_creole_headings.latex", creole.to_doc(:latex, @opt))
285
- $log.warn('test_creole_headings: to_context')
286
- #~ assert_equal_filecontent( "expected_creole/test_creole_headings.context", creole.to_doc(:context))
287
- assert_equal_filecontent( "expected_creole/test_creole_headings.wiki", creole.to_doc(:wiki, @opt))
288
- $log.info('test_creole_paragraphs: uncomplete to_creole')
289
- assert_equal_filecontent( "expected_creole/test_creole_headings.text", creole.to_doc(:text, @opt))
290
- end #test_creole_headings
291
- #
292
- #Modification of standard: Labels for headings.
293
- #
294
- #Including the definition of a label tor the toc.
295
- def test_creole_label()
296
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
297
- ==Titel 1==
298
- Text
299
- ===Titel 2===
300
- Text unter Titel 2
301
- ===[2b]Titel 2b===
302
- Text unter Titel 2b.
303
- creole
304
- )
305
- #Check the manual label
306
- assert_equal_filecontent( "expected_creole/test_creole_label.html", creole.to_doc(:html, @opt))
307
- assert_equal_filecontent( "expected_creole/test_creole_label.latex", creole.to_doc(:latex, @opt))
308
- $log.warn('test_creole_label: to_context')
309
- #~ assert_equal_filecontent( "expected_creole/test_creole_label.context", creole.to_doc(:context))
310
- $log.info('test_creole_label: uncomplete text/to_creole')
311
- #~ assert_equal_filecontent( "expected_creole/test_creole_label.creole", creole.to_doc(:creole, @opt))
312
- #~ assert_equal_filecontent( "expected_creole/test_creole_label.text", creole.to_doc(:text, @opt))
313
-
314
- end
315
- end #Test_creole_headings < Test::Unit::TestCase
316
-
317
- class Test_creole_toc < Test::Unit::TestCase
318
- def setup()
319
- #Avoid warnings about missing logger in to_doc
320
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
321
- end
322
- def test_creole_toc()
323
- creole = Docgenerator::Creole::Creole.new(
324
- :name => 'toc',
325
- :content => <<creole
326
- =one
327
- =two
328
- ==two-one
329
- =[drei]three
330
- ==three-one
331
- creole
332
- )
333
- assert_equal_filecontent( "expected_creole/test_creole_toc.html", creole.toc.to_doc(:html, @opt))
334
- assert_equal_filecontent( "expected_creole/test_creole_toc_text.html", creole.to_doc(:html, @opt))
335
- assert_equal_filecontent( "expected_creole/test_creole_toc.latex", creole.toc.to_doc(:latex, @opt))
336
- assert_equal_filecontent( "expected_creole/test_creole_toc_text.latex", creole.to_doc(:latex, @opt))
337
- $log.warn('test_creole_toc_text: to_context')
338
- #~ assert_equal_filecontent( "expected_creole/test_creole_toc_text.context", creole.to_doc(:context))
339
- $log.warn('test_creole_toc: to wiki/creole')
340
- #~ assert_equal_filecontent( "expected_creole/test_creole_toc.creole", creole.to_doc(:creole, @opt))
341
- assert_equal_filecontent( "expected_creole/test_creole_toc.text", creole.toc.to_doc(:text, @opt))
342
- end #test_creole_toc
343
- #Build the toc, but only up to level toclevel.
344
- def test_creole_toc_level()
345
- toclevel = 1
346
- creole = Docgenerator::Creole::Creole.new(
347
- :name => 'toc',
348
- :content => <<creole
349
- Test for document with toc-level #{toclevel}
350
- =one
351
- =two
352
- ==two-one
353
- =[drei]three
354
- ==three-one
355
- creole
356
- )
357
- assert_equal_filecontent( "expected_creole/test_creole_toc_level.html", creole.toc(:level => toclevel).to_doc(:html, @opt))
358
- assert_equal_filecontent( "expected_creole/test_creole_toc_level_text.html", creole.to_doc(:html, @opt))
359
- assert_equal_filecontent( "expected_creole/test_creole_toc_level.latex", creole.toc(:level => toclevel).to_doc(:latex, @opt))
360
- assert_equal_filecontent( "expected_creole/test_creole_toc_level_text.latex", creole.to_doc(:latex, :level => toclevel))
361
- $log.warn('test_creole_toc_text: to_context')
362
- #~ assert_equal_filecontent( "expected_creole/test_creole_toc_text.context", creole.to_doc(:context)
363
- $log.warn('test_creole_toc: to wiki/creole')
364
- #~ assert_equal_filecontent( "expected_creole/test_creole_toc_level.creole", creole.to_doc(:creole, @opt)
365
- assert_equal_filecontent( "expected_creole/test_creole_toc_level.text", creole.toc(:level => toclevel).to_doc(:text, @opt))
366
- end #test_creole_toc_level
367
- end #Test_creole_toc
368
-
369
- class Test_creole_paragraph2 < Test::Unit::TestCase
370
- def setup()
371
- #Avoid warnings about missing logger in to_doc
372
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
373
- end
374
- def test_creole_newline()
375
- creole = Docgenerator::Creole::Creole.new(
376
- :name => 'newline',
377
- :content => <<'creole'
378
- You can format an address by simply forcing linebreaks:
379
-
380
- My contact dates:\\
381
- Pone: xyz\\
382
- Fax: +45\\
383
- Mobile: abc
384
-
385
- creole
386
- )
387
- assert_equal_filecontent( "expected_creole/test_creole_newline.html", creole.to_doc(:html, @opt))
388
- assert_equal_filecontent( "expected_creole/test_creole_newline.latex", creole.to_doc(:latex, @opt))
389
- $log.warn('test_creole_newline: to_context')
390
- #~ assert_equal_filecontent( "expected_creole/test_creole_newline.context", creole.to_doc(:context))
391
- $log.warn('test_creole_newline: to wiki/creole')
392
- #~ assert_equal_filecontent( "expected_creole/test_creole_newline.creole", creole.to_doc(:creole, @opt))
393
- assert_equal_filecontent( "expected_creole/test_creole_newline.text", creole.to_doc(:text, @opt))
394
- end #test_creole_newline
395
- def test_creole_hr()
396
- creole = Docgenerator::Creole::Creole.new(
397
- :name => 'hr',
398
- :content => <<creole
399
-
400
- You can use this to draw a line to separate the page:
401
- ----
402
- This is after the horizontal line
403
- creole
404
- )
405
- assert_equal_filecontent( "expected_creole/test_creole_hr.html", creole.to_doc(:html, @opt))
406
- assert_equal_filecontent( "expected_creole/test_creole_hr.latex", creole.to_doc(:latex, @opt))
407
- $log.warn('test_creole_hr: to_context')
408
- #~ assert_equal_filecontent( "expected_creole/test_creole_hr.context", creole.to_doc(:context))
409
- $log.warn('test_creole_hr: to wiki/creole')
410
- #~ assert_equal_filecontent( "expected_creole/test_creole_hr.creole", creole.to_doc(:creole, @opt))
411
- assert_equal_filecontent( "expected_creole/test_creole_hr.text", creole.to_doc(:text, @opt))
412
- end #test_creole_hr
413
-
414
- end #Test_creole_paragraph2
415
-
416
-
417
- class Test_creole_inline < Test::Unit::TestCase
418
- def setup()
419
- #Avoid warnings about missing logger in to_doc
420
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
421
- end
422
-
423
- def test_creole_inline_bold_em()
424
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
425
- You can make things **bold** or //italic// or **//both//** or //**both**//.
426
- creole
427
- )
428
- assert_equal_filecontent( "expected_creole/test_creole_inline.html", creole.to_doc(:html, @opt))
429
- assert_equal_filecontent( "expected_creole/test_creole_inline.latex", creole.to_doc(:latex, @opt))
430
- $log.warn('test_creole_inline: to_context')
431
- #~ assert_equal_filecontent( "expected_creole/test_creole_inline.context", creole.to_doc(:context))
432
- $log.info('test_creole_inline_bold_em: inline to wiki/creole')
433
- #~ assert_equal_filecontent( "expected_creole/test_creole_inline.creole", creole.to_doc(:creole, @opt))
434
- $log.warn('test_creole_inline_bold_em: inline text with additional spaces')
435
- assert_equal_filecontent( "expected_creole/test_creole_inline.text", creole.to_doc(:text, @opt))
436
- end
437
-
438
- def test_creole_inline_bold_line_break()
439
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
440
- Character formatting extends across line breaks: **bold,
441
- this is still bold. This line deliberately does not end in star-star.
442
-
443
- Not bold. Character formatting does not cross paragraph boundaries.
444
- creole
445
- )
446
- assert_equal_filecontent( "expected_creole/test_creole_line_break.html", creole.to_doc(:html, @opt))
447
- assert_equal_filecontent( "expected_creole/test_creole_line_break.latex", creole.to_doc(:latex, @opt))
448
- $log.warn('test_creole_line_break: to_context')
449
- #~ assert_equal_filecontent( "expected_creole/test_creole_line_break.context", creole.to_doc(:context))
450
- $log.info('test_creole_inline_bold_line_break: inline to wiki/creole')
451
- #~ assert_equal_filecontent( "expected_creole/test_creole_line_break.creole", creole.to_doc(:creole, @opt))
452
- #~ assert_equal_filecontent( "expected_creole/test_creole_line_break.text", creole.to_doc(:text, @opt))
453
- end
454
-
455
- def test_creole_inline_apostroph()
456
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
457
- You can add text "in apostoph".
458
-
459
- Problem may be german.sty and activated " like in "a.
460
- It will be converted to an a-Umlaut.
461
- creole
462
- )
463
- assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html, @opt))
464
- assert_equal_filecontent( "expected_creole/#{__method__}.latex", creole.to_doc(:latex, @opt))
465
- $log.warn('#{__method__}: to_context')
466
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.context", creole.to_doc(:context))
467
- $log.info('#{__method__}_bold_em: inline to wiki/creole')
468
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.creole", creole.to_doc(:creole, @opt))
469
- $log.warn('#{__method__}_bold_em: inline text with additional spaces')
470
- assert_equal_filecontent( "expected_creole/#{__method__}.text", creole.to_doc(:text, @opt))
471
- end
472
-
473
- end #Test_creole_inline
474
-
475
-
476
- class Test_creole_lists < Test::Unit::TestCase
477
- def setup()
478
- #Avoid warnings about missing logger in to_doc
479
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
480
- end
481
- def test_creole_list_ul()
482
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
483
- Text before
484
- *Listentry 1
485
- *Listentry 2
486
- **Listentry 2.1
487
- **Listentry 2.2
488
- *Listentry 3
489
- **Listentry 3.2
490
-
491
-
492
- * You can have
493
- multiline list items
494
- * this is a second multiline
495
- list item
496
-
497
- Text afterwords
498
- creole
499
- )
500
- assert_equal_filecontent( "expected_creole/test_creole_list_ul.html", creole.to_doc(:html, @opt))
501
- assert_equal_filecontent( "expected_creole/test_creole_list_ul.latex", creole.to_doc(:latex, @opt))
502
- $log.warn('test_creole_list_ul: to_context')
503
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.context", creole.to_doc(:context))
504
- $log.warn('test_creole_list_ul: list to wiki/creole')
505
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.creole", creole.to_doc(:creole, @opt))
506
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.wiki", creole.to_doc(:wiki, @opt))
507
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.text", creole.to_doc(:text, @opt))
508
- #ruby 1.8: symbols as key, ruby 1.9: Strings
509
- #~ omit_if( RUBY_VERSION !~ /1.9/, "Wrong ruby version #{RUBY_VERSION}"){
510
- assert_equal_filecontent( "expected_creole/test_creole_list_ul.normsource", creole.normsource.to_yaml)
511
- #~ }
512
- end
513
- #It works fine here, but LaTeX will give you an error.
514
- def test_creole_list_ul_too_much()
515
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
516
- Text before
517
- *Listentry 1
518
- *Listentry 2
519
- **Listentry 2.1
520
- **Listentry 2.2
521
- ***Listentry 2.2.1
522
- ****Listentry 2.2.1.1
523
- *****Listentry 2.2.1.1.1
524
- *Listentry 3
525
-
526
- Text afterwords
527
- creole
528
- )
529
- assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.html", creole.to_doc(:html, @opt))
530
- assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.latex", creole.to_doc(:latex, @opt))
531
- $log.warn('test_creole_list_ul_too_much: to_context')
532
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.context", creole.to_doc(:context))
533
- $log.warn('test_creole_list_ul_too_much: list to wiki/creole')
534
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.creole", creole.to_doc(:creole, @opt))
535
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.text", creole.to_doc(:text, @opt))
536
- end
537
- def test_creole_list_ol()
538
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
539
- Text before
540
- #Listentry 1
541
- #Listentry 2
542
- ##Listentry 2.1
543
- ##Listentry 2.2
544
- #Listentry 3
545
- Text afterwords
546
- creole
547
- )
548
- assert_equal_filecontent( "expected_creole/test_creole_list_ol.html", creole.to_doc(:html, @opt))
549
- assert_equal_filecontent( "expected_creole/test_creole_list_ol.latex", creole.to_doc(:latex, @opt))
550
- $log.warn('test_creole_list_ol: to_context')
551
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.context", creole.to_doc(:context))
552
- $log.warn('test_creole_list_ol: list to wiki/creole')
553
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.creole", creole.to_doc(:creole, @opt))
554
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.text", creole.to_doc(:text, @opt))
555
- end #ol
556
-
557
- def test_creole_list_ol_ul()
558
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
559
- Text before
560
- #Listentry 1
561
- #Listentry 2
562
- #*Listentry 2.1
563
- #*Listentry 2.2
564
- #Listentry 3
565
-
566
- Text afterwords
567
- creole
568
- )
569
- assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.html", creole.to_doc(:html, @opt))
570
- assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.latex", creole.to_doc(:latex, @opt))
571
- $log.warn('test_creole_list_ol_ul: to_context')
572
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.context", creole.to_doc(:context))
573
- $log.warn('test_creole_list_ol_ul: list to wiki/creole')
574
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.creole", creole.to_doc(:creole, @opt))
575
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.text", creole.to_doc(:text, @opt))
576
- end
577
-
578
- def test_creole_list_ol_after_ul()
579
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
580
- Text before
581
- *Listentry 1
582
- #Listentry 2
583
-
584
- Text afterwords
585
- creole
586
- )
587
- assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.html", creole.to_doc(:html, @opt))
588
- assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.latex", creole.to_doc(:latex, @opt))
589
- $log.warn('test_creole_list_ol_after_ul: to_context')
590
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.context", creole.to_doc(:context))
591
- $log.warn('test_creole_list_ol_after_ul: list to wiki/creole')
592
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.creole", creole.to_doc(:creole, @opt))
593
- #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.text", creole.to_doc(:text, @opt))
594
- end
595
-
596
- def test_creole_list_ulul_without_ul()
597
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
598
- Text before
599
- **Listentry 1
600
- Text afterwords
601
- creole
602
- )
603
- @opt[:log] = $tmplog #Suppress error message
604
- assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html, @opt))
605
- assert_equal_filecontent( "expected_creole/#{__method__}.latex", creole.to_doc(:latex, @opt))
606
- $log.warn("#{__method__}: to_context")
607
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.context", creole.to_doc(:context))
608
- $log.warn("#{__method__}: list to wiki/creole")
609
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.creole", creole.to_doc(:creole, @opt))
610
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.text", creole.to_doc(:text, @opt))
611
- end
612
-
613
- #Line breaks will be lost.
614
- def test_creole_ul_multiple_line()
615
- $log.warn('test_creole_ul_multiple_line: latex: grosse textl�cken (wrap mit leerzeichen bereinigen?)')
616
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
617
- * vorher
618
- * text
619
- mehr text zum item
620
- * nachher und vorher
621
- * text
622
- mehr text zum item
623
- * nachher
624
- creole
625
- )
626
- assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.html", creole.to_doc(:html, @opt))
627
- assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.latex", creole.to_doc(:latex, @opt))
628
- $log.warn('test_creole_ul_multiple_line: to_context')
629
- #~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.context", creole.to_doc(:context))
630
- $log.warn('test_creole_ul_multiple_line: list to wiki/creole')
631
- #~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.creole", creole.to_doc(:creole, @opt))
632
- #~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.text", creole.to_doc(:text, @opt)) #fixme
633
- end
634
- def test_creole_ul_with_bold()
635
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
636
- You can use lists, start it at the first column for now, please...
637
-
638
- unnumbered lists are like
639
- * item a
640
- * item b
641
- * **bold item c**
642
- Text
643
- creole
644
- )
645
- assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.html", creole.to_doc(:html, @opt))
646
- assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.latex", creole.to_doc(:latex, @opt))
647
- $log.warn('test_creole_ul_with_bold: to_context')
648
- #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.context", creole.to_doc(:context))
649
- $log.warn('test_creole_ul_with_bold: list to wiki/creole')
650
- #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.creole", creole.to_doc(:creole, @opt))
651
- assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.text", creole.to_doc(:text, @opt))
652
- end
653
- def test_creole_ul_with_blank()
654
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
655
- blank space is also permitted before lists like:
656
- * item a
657
- * item b
658
- * item c
659
- ** item c.a
660
- Text
661
- creole
662
- )
663
- assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.html", creole.to_doc(:html, @opt))
664
- assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.latex", creole.to_doc(:latex, @opt))
665
- $log.warn('test_creole_ul_with_blank: to_context')
666
- #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.context", creole.to_doc(:context))
667
- $log.warn('test_creole_ul_with_blank: list to wiki/creole')
668
- #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.creole", creole.to_doc(:creole, @opt))
669
- #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.text", creole.to_doc(:text, @opt))
670
- end
671
- #Check, if the second list is really a second list.
672
- def test_creole_mix_titles_list()
673
- creole = Docgenerator::Creole::Creole.new(
674
- :name => 'mix_titles_list',
675
- :content => <<creole
676
- =Titel 1
677
- *item 1
678
- *item 2
679
- =Titel 2
680
- *item 1
681
- *item 2
682
- creole
683
- )
684
- assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.html", creole.to_doc(:html, @opt))
685
- assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.latex", creole.to_doc(:latex, @opt))
686
- $log.warn('test_creole_mix_titles_list: to_context')
687
- #~ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.context", creole.to_doc(:context))
688
- $log.warn('test_creole_mix_titles_list: to wiki/creole')
689
- #~ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.creole", creole.to_doc(:creole, @opt))
690
- assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.text", creole.to_doc(:text, @opt))
691
- end #test_creole_mix_titles_list
692
-
693
- end #Test_creole_List
694
-
695
-
696
-
697
- class Test_creole_links < Test::Unit::TestCase
698
- def setup()
699
- #Avoid warnings about missing logger in to_doc
700
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
701
- end
702
- def test_creole_links_external_explizit()
703
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
704
- Here's a external link without a description: [[http://www.wikicreole.org]].
705
-
706
- And here's a external link with a description: [[http://www.wikicreole.org|wikicreole.org]].
707
- creole
708
- )
709
- assert_equal_filecontent( "expected_creole/test_creole_links_external.html", creole.to_doc(:html, @opt))
710
- assert_equal_filecontent( "expected_creole/test_creole_links_external.latex", creole.to_doc(:latex, @opt))
711
- $log.warn('test_creole_links_external: to_context')
712
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_external.context", creole.to_doc(:context))
713
- $log.warn('test_creole_links_external: to wiki/creole')
714
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_external.creole", creole.to_doc(:creole, @opt))
715
- assert_equal_filecontent( "expected_creole/test_creole_links_external.text", creole.to_doc(:text, @opt))
716
- end #test_creole_links_external
717
-
718
- def test_creole_links_external_implicit()
719
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
720
- Free links without braces should be rendered as well, like http://www.wikicreole.org/ and [[http://www.wikicreole.org/users/~example]].
721
-
722
- See also description: http://www.wikicreole.org/wiki/Links
723
-
724
- In case of phrase ends with . you should use explicit links like
725
- [[http://www.wikicreole.org/users/~example]].
726
- creole
727
- )
728
- assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.html", creole.to_doc(:html, @opt))
729
- assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.latex", creole.to_doc(:latex, @opt))
730
- $log.warn('test_creole_links_external_implicit: to_context')
731
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.context", creole.to_doc(:context))
732
- $log.warn('test_creole_links_external_implicit: to wiki/creole')
733
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.creole", creole.to_doc(:creole, @opt))
734
- assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.text", creole.to_doc(:text, @opt))
735
- end #test_creole_links_external_implicit
736
-
737
- #
738
- #Bug 2009-10-14:
739
- # <a href = "http:" >http:</a> <em >www.wikicreole.org/users/~example</em>
740
- #If the very end of a text is a link, it is not detected correct
741
- def test_creole_links_implicit_end()
742
- creole = Docgenerator::Creole::Creole.new(
743
- :name => 'links_implicit_end',
744
- :content => "http://www.wikicreole.org/users/~example"
745
- )
746
- assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.html", creole.to_doc(:html, @opt))
747
- assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.latex", creole.to_doc(:latex, @opt))
748
- #~ $log.warn('test_creole_links_implicit_end: to_context')
749
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.context", creole.to_doc(:context))
750
- #~ $log.warn('test_creole_links_implicit_end: to wiki/creole')
751
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.creole", creole.to_doc(:creole, @opt))
752
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.text", creole.to_doc(:text, @opt))
753
- end #test_creole_links_implicit_end
754
-
755
- def test_creole_links_explicit_with_em()
756
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
757
- Be careful that italic links are rendered properly: //[[http://my.book.example/|My Book Title]]//
758
- creole
759
- )
760
- assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.html", creole.to_doc(:html, @opt))
761
- assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.latex", creole.to_doc(:latex, @opt))
762
- $log.warn('test_creole_links_explicit_with_em: to_context')
763
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.context", creole.to_doc(:context))
764
- $log.warn('test_creole_links_explicit_with_em: to wiki/creole')
765
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.creole", creole.to_doc(:creole, @opt))
766
- assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.text", creole.to_doc(:text, @opt))
767
- end #test_creole_links_explicit_with_em
768
-
769
- def test_creole_links_file()
770
-
771
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
772
- [[./#{$thisfile}]]
773
-
774
- [[./#{$thisfile}|This unittest-source]]
775
- creole
776
- )
777
- assert_equal_filecontent( "expected_creole/test_creole_links_file.html", creole.to_doc(:html, @opt))
778
- assert_equal_filecontent( "expected_creole/test_creole_links_file.latex", creole.to_doc(:latex, @opt))
779
- $log.warn('test_creole_links_file: to_context')
780
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_file.context", creole.to_doc(:context))
781
- $log.warn('test_creole_links_file: to wiki/creole')
782
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_file.creole", creole.to_doc(:creole, @opt))
783
- assert_equal_filecontent( "expected_creole/test_creole_links_file.text", creole.to_doc(:text, @opt))
784
- end #test_creole_links_file
785
-
786
- def test_creole_links_explicit_internal()
787
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
788
- [[#internal]]
789
-
790
- [[#internal|Links inside]]
791
- creole
792
- )
793
- assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.html", creole.to_doc(:html, @opt))
794
- $log.warn('test_creole_links_explicit_internal: to latex')
795
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.latex", creole.to_doc(:latex, @opt))
796
- $log.warn('test_creole_links_explicit_internal: to_context')
797
- #~ #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.context", creole.to_doc(:context))
798
- $log.warn('test_creole_links_explicit_internal: to wiki/creole')
799
- #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.creole", creole.to_doc(:creole, @opt))
800
- assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.text", creole.to_doc(:text, @opt))
801
- end #test_creole_links_explicit_internal
802
-
803
- end #Test_creole_links
804
-
805
-
806
- class Test_creole_pictures < Test::Unit::TestCase
807
- def setup()
808
- #Avoid warnings about missing logger in to_doc
809
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
810
- end
811
- def test_creole_pictures()
812
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
813
- This should be a flower with the ALT text "this is a flower" if your wiki supports ALT text on images:
814
-
815
- {{Red_Flower.jpg}}
816
-
817
- {{Red_Flower.jpg|here is a red flower}}
818
- creole
819
- )
820
- assert_equal_filecontent( "expected_creole/test_creole_pictures.html", creole.to_doc(:html, @opt))
821
- assert_equal_filecontent( "expected_creole/test_creole_pictures.latex", creole.to_doc(:latex, @opt))
822
- $log.warn('test_creole_pictures: to_context')
823
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures.context", creole.to_doc(:context))
824
- $log.warn('test_creole_pictures: to wiki/creole')
825
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures.creole", creole.to_doc(:creole, @opt))
826
- $log.warn('test_creole_pictures: to text/creole')
827
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures.text", creole.to_doc(:text, @opt))
828
- end #test_creole_pictures
829
- def test_creole_picture_link()
830
- creole = Docgenerator::Creole::Creole.new(:name => 'Creole_picture_link',
831
- :content => <<creole
832
- [[./#{$thisfile}|{{Red_Flower.jpg}}]] - if you click on the image, will goto "some link"
833
-
834
- [[http://example.com/|{{Red_Flower.jpg}}]] - same as above: picture links to url
835
- creole
836
- )
837
- assert_equal_filecontent( "expected_creole/test_creole_picture_link.html", creole.to_doc(:html, @opt))
838
- #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.latex", creole.to_doc(:latex, @opt))
839
- $log.warn('test_creole_picture_link: to_context')
840
- #~ #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.context", creole.to_doc(:context))
841
- $log.warn('test_creole_picture_link: to wiki/creole')
842
- #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.creole", creole.to_doc(:creole, @opt))
843
- #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.text", creole.to_doc(:text, @opt))
844
- end #test_creole_picture_link
845
- def test_creole_pictures_css()
846
- creole = Docgenerator::Creole::Creole.new(
847
- :name => 'pictures_css',
848
- :content => <<creole
849
- {{Red_Flower.jpg|red flower|css=width:50px}}
850
-
851
- {{Red_Flower.jpg|red flower|imgcss=width:100px}}
852
- creole
853
- )
854
- assert_equal_filecontent( "expected_creole/test_creole_pictures_css.html", creole.to_doc(:html, @opt))
855
- assert_equal_filecontent( "expected_creole/test_creole_pictures_css.latex", creole.to_doc(:latex, @opt))
856
- $log.warn('test_creole_pictures_css: to_context')
857
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.context", creole.to_doc(:context))
858
- $log.warn('test_creole_pictures_css: to wiki/creole')
859
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.creole", creole.to_doc(:creole, @opt))
860
- $log.warn('test_creole_pictures_css: to text/creole')
861
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.text", creole.to_doc(:text, @opt))
862
- end #test_creole_pictures_css
863
- def test_creole_pictures_imgclass()
864
- creole = Docgenerator::Creole::Creole.new(
865
- :name => 'pictures_imgclass',
866
- :content => <<creole
867
- {{Red_Flower.jpg||class=test}}
868
-
869
- {{Red_Flower.jpg||imgclass=test}}
870
- creole
871
- )
872
- assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.html", creole.to_doc(:html, @opt))
873
- assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.latex", creole.to_doc(:latex, @opt))
874
- $log.warn('test_creole_pictures_imgclass: to_context')
875
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.context", creole.to_doc(:context))
876
- $log.warn('test_creole_pictures_imgclass: to wiki/creole')
877
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.creole", creole.to_doc(:creole, @opt))
878
- $log.warn('test_creole_pictures_imgclass: to text/creole')
879
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.text", creole.to_doc(:text, @opt))
880
- end #test_creole_pictures_imgclass
881
-
882
- def test_creole_pictures_longdesc()
883
- creole = Docgenerator::Creole::Creole.new(
884
- :name => 'pictures_longdesc',
885
- :content => <<creole
886
- {{Red_Flower.jpg||longdesc=http://www.pixelio.de/details.php?image_id=405788}}
887
- creole
888
- )
889
- assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.html", creole.to_doc(:html, @opt))
890
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.latex", creole.to_doc(:latex, @opt))
891
- #~ $log.warn('test_creole_pictures_longdesc: to_context')
892
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.context", creole.to_doc(:context))
893
- $log.warn('test_creole_pictures_longdesc: to wiki/creole')
894
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.creole", creole.to_doc(:creole, @opt))
895
- $log.warn('test_creole_pictures_longdesc: to text/creole')
896
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.text", creole.to_doc(:text, @opt))
897
- end #test_creole_pictures_longdesc
898
-
899
- def test_creole_pictures_width()
900
- creole = Docgenerator::Creole::Creole.new(
901
- :name => 'pictures_width',
902
- :content => <<creole
903
- {{Red_Flower.jpg||width=\\textwidth|css=width:100%}}
904
- creole
905
- )
906
- assert_equal_filecontent( "expected_creole/test_creole_pictures_width.html", creole.to_doc(:html, @opt))
907
- assert_equal_filecontent( "expected_creole/test_creole_pictures_width.latex", creole.to_doc(:latex, @opt))
908
- #~ $log.warn('test_creole_pictures_width: to_context')
909
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.context", creole.to_doc(:context))
910
- $log.warn('test_creole_pictures_width: to wiki/creole')
911
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.creole", creole.to_doc(:creole, @opt))
912
- $log.warn('test_creole_pictures_width: to text/creole')
913
- #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.text", creole.to_doc(:text, @opt))
914
- end #test_creole_pictures_width
915
-
916
- end #Test_creole_pictures
917
-
918
-
919
- class Test_creole_verbatim < Test::Unit::TestCase
920
- def setup()
921
- #Avoid warnings about missing logger in to_doc
922
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
923
- end
924
- def test_creole_verbatim()
925
- creole = Docgenerator::Creole::Creole.new( :name => 'creole_verbatim',
926
- :content => <<creole
927
- You can use nowiki syntax if you would like do stuff like this:
928
-
929
- {{{
930
- Guitar Chord C:
931
-
932
- ||---|---|---|
933
- ||-0-|---|---|
934
- ||---|---|---|
935
- ||---|-0-|---|
936
- ||---|---|-0-|
937
- ||---|---|---|
938
- }}}
939
-
940
- before
941
- {{{
942
- This is some verbatim text
943
- }}}
944
- after
945
-
946
- See [[http://www.wikicreole.org/wiki/PreformattedAndNowiki]]
947
- creole
948
- )
949
- assert_equal_filecontent( "expected_creole/test_creole_verbatim.html", creole.to_doc(:html, @opt))
950
- assert_equal_filecontent( "expected_creole/test_creole_verbatim.latex", creole.to_doc(:latex, @opt))
951
- $log.warn('test_creole_verbatim: to_context')
952
- #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim.context", creole.to_doc(:context))
953
- $log.warn('test_creole_verbatim: change < to &lt; ....')
954
- $log.warn('test_creole_verbatim: to wiki/creole')
955
- #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim.creole", creole.to_doc(:creole, @opt))
956
- assert_equal_filecontent( "expected_creole/test_creole_verbatim.text", creole.to_doc(:text, @opt))
957
- end #test_creole_verbatim
958
- def test_creole_verbatim_inline()
959
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
960
-
961
- You can also use inline nowiki {{{ in a sentence }}} like this.
962
- See [[http://www.wikicreole.org/wiki/PreformattedAndNowiki]].
963
-
964
- Some examples of markup are: {{{** <i>this</i> ** }}}
965
- creole
966
- )
967
- assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.html", creole.to_doc(:html, @opt))
968
- assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.latex", creole.to_doc(:latex, @opt))
969
- $log.warn('test_creole_verbatim_inline: to_context')
970
- #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.context", creole.to_doc(:context))
971
- $log.warn('test_creole_verbatim_inline: to wiki/creole')
972
- #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.creole", creole.to_doc(:creole, @opt))
973
- #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.text", creole.to_doc(:text, @opt))
974
- end #test_creole_verbatim_inline
975
- def test_creole_verbatim_inline_at_start()
976
- creole = Docgenerator::Creole::Creole.new(
977
- :name => 'verbatim_inline_at_start',
978
- :content => <<creole
979
- Short verbatim can also be at the start:
980
- {{{this is verbatim}}}
981
-
982
- This test checks, if the differences of normal verbatim is detected.
983
- creole
984
- )
985
- assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.html", creole.to_doc(:html, @opt))
986
- assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.latex", creole.to_doc(:latex, @opt))
987
- $log.warn('test_creole_verbatim_inline_at_start: to_context')
988
- #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.context", creole.to_doc(:context))
989
- $log.warn('test_creole_verbatim_inline_at_start: to wiki/creole')
990
- #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.creole", creole.to_doc(:creole, @opt))
991
- $log.warn('test_creole_verbatim_inline_at_start: to text/creole')
992
- #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.text", creole.to_doc(:text, @opt))
993
- end #test_creole_verbatim_inline_at_start
994
-
995
- end #Test_creole_verbatim
996
-
997
-
998
- class Test_creole_footnote < Test::Unit::TestCase
999
- def setup()
1000
- #Avoid warnings about missing logger in to_doc
1001
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
1002
- end
1003
- def test_creole_footnotes()
1004
- creole = Docgenerator::Creole::Creole.new(
1005
- :name => 'footnotes',
1006
- :content => <<creole
1007
- <<footnote|This is a footnote>>
1008
- ----
1009
- <<footnotes>>
1010
- creole
1011
- )
1012
- assert_equal_filecontent( "expected_creole/test_creole_footnotes.html", creole.to_doc(:html, @opt))
1013
- assert_equal_filecontent( "expected_creole/test_creole_footnotes.latex", creole.to_doc(:latex, @opt))
1014
- $log.warn('test_creole_footnotes: to_context')
1015
- #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.context", creole.to_doc(:context))
1016
- $log.warn('test_creole_footnotes: to wiki/creole')
1017
- #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.creole", creole.to_doc(:creole, @opt))
1018
- $log.warn('test_creole_footnotes: to text/creole')
1019
- #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.text", creole.to_doc(:text, @opt))
1020
- end #test_creole_footnotes
1021
- def test_creole_footnotes_label()
1022
- creole = Docgenerator::Creole::Creole.new(
1023
- :name => 'footnotes_label',
1024
- :content => <<creole
1025
- <<footnote|This is a footnote|label=s>>
1026
- This makes only sense in HTML
1027
- ----
1028
- <<footnotes>>
1029
- creole
1030
- )
1031
- assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html, @opt))
1032
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.latex", creole.to_doc(:latex, @opt))
1033
- #~ $log.warn('test_creole_footnotes_label: to_context')
1034
- #~ #~ assert_equal_filecontent( "expected_creole/#{__method__}.context", creole.to_doc(:context))
1035
- #~ $log.warn('test_creole_footnotes_label: to wiki/creole')
1036
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.creole", creole.to_doc(:creole, @opt))
1037
- #~ $log.warn('test_creole_footnotes_label: to text/creole')
1038
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.text", creole.to_doc(:text, @opt))
1039
- end #test_creole_footnotes_label
1040
-
1041
- def test_creole_footnotes_groupid()
1042
- creole = Docgenerator::Creole::Creole.new(
1043
- :name => 'footnotes_group',
1044
- :content => <<creole
1045
- Text<<footnote|This is a footnote|>>
1046
- more text<<footnote|This is a footnote in group g1|groupid=g1>>
1047
- ----
1048
- <<footnotes>>
1049
- ----
1050
- <<footnotes|g1>>
1051
- creole
1052
- )
1053
- assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html, @opt))
1054
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.latex", creole.to_doc(:latex, @opt))
1055
- #~ $log.warn('test_creole_footnotes_label: to_context')
1056
- #~ #~ assert_equal_filecontent( "expected_creole/#{__method__}.context", creole.to_doc(:context))
1057
- #~ $log.warn('test_creole_footnotes_label: to wiki/creole')
1058
- #~ assert_equal_filecontent( "expected_creole/#{__method__}l.creole", creole.to_doc(:creole, @opt))
1059
- #~ $log.warn('test_creole_footnotes_label: to text/creole')
1060
- #~ assert_equal_filecontent( "expected_creole/#{__method__}.text", creole.to_doc(:text, @opt))
1061
- end #test_creole_footnotes_label
1062
- =begin rdoc
1063
- Footnotes in tabulars don't work.
1064
- =end
1065
- def test_creole_footnotes_in_tabular()
1066
- return
1067
- #check for warning?
1068
-
1069
- creole = Docgenerator::Creole::Creole.new(
1070
- :name => 'footnotes',
1071
- :content => <<creole
1072
- <<<tabular
1073
- |!columns=1
1074
- |<<footnote|This is a footnote>>
1075
- >>>
1076
- ----
1077
- <<footnotes>>
1078
- creole
1079
- )
1080
- $log.warn('test_creole_footnotes_in_tabular: html')
1081
- #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.html", creole.to_doc(:html, @opt))
1082
- #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.latex", creole.to_doc(:latex, @opt))
1083
- #~ $log.warn('test_creole_footnotes_in_tabular: to_context')
1084
- #~ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.context", creole.to_doc(:context))
1085
- #~ $log.warn('test_creole_footnotes_in_tabular: to wiki/creole')
1086
- #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.creole", creole.to_doc(:creole, @opt))
1087
- #~ $log.warn('test_creole_footnotes_in_tabular: to text/creole')
1088
- #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.text", creole.to_doc(:text, @opt))
1089
- end #test_creole_footnotes_in_tabular
1090
- end #Test_creole_footnote
1091
-
1092
- class Test_creole_short_html < Test::Unit::TestCase
1093
- def setup()
1094
- #Avoid warnings about missing logger in to_doc
1095
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
1096
- end
1097
- def test_creole_short_html()
1098
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
1099
- before
1100
- {{html|<em>this is only for HTML</em>}}
1101
- after
1102
- creole
1103
- )
1104
- #Really like this? Or should there be no paragraph?
1105
- assert_equal_filecontent( "expected_creole/test_creole_short_html.html", creole.to_doc(:html, @opt))
1106
- assert_equal_filecontent( "expected_creole/test_creole_short_html.latex", creole.to_doc(:latex, @opt))
1107
- $log.warn('test_creole_short_html: to_context')
1108
- #~ assert_equal_filecontent( "expected_creole/test_creole_short_html.context", creole.to_doc(:context))
1109
- $log.warn('test_creole_short_html: to wiki/creole')
1110
- #~ assert_equal_filecontent( "expected_creole/test_creole_short_html.creole", creole.to_doc(:creole, @opt))
1111
- assert_equal_filecontent( "expected_creole/test_creole_short_html.text", creole.to_doc(:text, @opt))
1112
- end #test_creole_short_html
1113
- end #Test_creole_short_html
1114
-
1115
-
1116
- class Test_creole_characters < Test::Unit::TestCase
1117
- def setup()
1118
- #Avoid warnings about missing logger in to_doc
1119
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
1120
- end
1121
- def test_creole_characters_all()
1122
- creole = Docgenerator::Creole::Creole.new(
1123
- :name => 'characters_all',
1124
- #~ :content => Creole::CHARACTERS.keys.sort.map{|char| "*#{char}" }.join("\n")
1125
- :content => Docgenerator::Creole::Creole::CHARACTERS.sort.map{|char, o| "* #{o.class}: #{char}"}.join("\n")
1126
- )
1127
- assert_equal_filecontent( "expected_creole/test_creole_characters_all.html", creole.to_doc(:html, @opt))
1128
-
1129
- $log.warn('test_creole_characters_all: to_latex Dollar Missing escape mechanism')
1130
- assert_equal_filecontent( "expected_creole/test_creole_characters_all.latex", creole.to_doc(:latex, @opt))
1131
- $log.warn('test_creole_characters_all: to_context')
1132
- #~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.context", creole.to_doc(:context))
1133
- $log.warn('test_creole_characters_all: to wiki/creole')
1134
- #~ assert_equal(creole.source.join , creole.to_doc(:creole, @opt))
1135
- #~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.creole", creole.source.join)
1136
- #~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.creole", creole.to_doc(:creole, @opt))
1137
- $log.warn('test_creole_characters_all: to text/creole')
1138
- #~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.text", creole.to_doc(:text, @opt))
1139
- end #test_creole_characters_all
1140
- def test_creole_characters_special()
1141
- creole = Docgenerator::Creole::Creole.new(
1142
- :name => 'characters_special',
1143
- :content => <<creole
1144
- Special Characters:
1145
- *$ - Dollar
1146
- *% - Percent
1147
- *=> Rightarrow
1148
- *-> rightarrow
1149
- *_ Underscore
1150
- creole
1151
- )
1152
- assert_equal_filecontent( "expected_creole/test_creole_characters_special.html", creole.to_doc(:html, @opt))
1153
- assert_equal_filecontent( "expected_creole/test_creole_characters_special.latex", creole.to_doc(:latex, @opt))
1154
- $log.warn('test_creole_characters_special: to_context')
1155
- #~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.context", creole.to_doc(:context))
1156
- $log.warn('test_creole_characters_special: to wiki/creole')
1157
- #~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.creole", creole.to_doc(:creole, @opt))
1158
- $log.warn('test_creole_characters_special: to text/creole')
1159
- #~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.text", creole.to_doc(:text, @opt))
1160
- end #test_creole_characters_special
1161
-
1162
- #This is also a test for multiple inclusions in one line.
1163
- def test_creole_shy()
1164
- creole = Docgenerator::Creole::Creole.new(
1165
- :name => 'shy',
1166
- :content => <<creole
1167
- Donau{{shy}}dampf{{shy}}schiff{{shy}}fahrt
1168
-
1169
- Donau{{-}}dampf{{-}}schiff{{-}}fahrt
1170
- creole
1171
- )
1172
- assert_equal_filecontent( "expected_creole/test_creole_shy.html", creole.to_doc(:html, @opt))
1173
- assert_equal_filecontent( "expected_creole/test_creole_shy.latex", creole.to_doc(:latex, @opt))
1174
- $log.warn('test_creole_shy: to_context')
1175
- #~ assert_equal_filecontent( "expected_creole/test_creole_shy.context", creole.to_doc(:context))
1176
- assert_equal_filecontent( "expected_creole/test_creole_shy.creole", creole.to_doc(:creole, @opt))
1177
- assert_equal_filecontent( "expected_creole/test_creole_shy.text", creole.to_doc(:text, @opt))
1178
- end #test_creole_shy
1179
-
1180
- end #Test_creole_characters
1181
-
1182
- class Test_creole_inline_ruby < Test::Unit::TestCase
1183
- def setup()
1184
- #Avoid warnings about missing logger in to_doc
1185
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
1186
- end
1187
- def self.ruby_test()
1188
- return '*hallo welt'
1189
- end
1190
- def test_creole_inline_ruby_raw()
1191
- creole = Docgenerator::Creole::Creole.new(
1192
- :name => 'inline_ruby_raw',
1193
- :content => <<creole
1194
- The following Rubycode is added as raw text.
1195
- 1 + 1 = <<ruby_raw|1+1>>
1196
-
1197
- <<ruby_raw|Test_creole_inline_ruby::ruby_test>>
1198
- creole
1199
- )
1200
- assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.html", creole.to_doc(:html, @opt))
1201
- assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.latex", creole.to_doc(:latex, @opt))
1202
- $log.warn('test_creole_inline_ruby_raw: to_context')
1203
- #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.context", creole.to_doc(:context))
1204
- $log.warn('test_creole_inline_ruby_raw: to wiki/creole')
1205
- #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.creole", creole.to_doc(:creole, @opt))
1206
- $log.warn('test_creole_inline_ruby_raw: to text/creole')
1207
- #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.text", creole.to_doc(:text, @opt))
1208
- end #test_creole_inline_ruby_raw
1209
- def test_creole_inline_ruby()
1210
- creole = Docgenerator::Creole::Creole.new(
1211
- :name => 'inline_ruby',
1212
- :content => <<creole
1213
- The following ruby code is added and parsed by the wiki.
1214
- *1 + 1 = <<ruby|1+1>>
1215
- <<ruby|Test_creole_inline_ruby::ruby_test>>
1216
- creole
1217
- )
1218
- assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.html", creole.to_doc(:html, @opt))
1219
- assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.latex", creole.to_doc(:latex, @opt))
1220
- $log.warn('test_creole_inline_ruby: to_context')
1221
- #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.context", creole.to_doc(:context))
1222
- $log.warn('test_creole_inline_ruby: to wiki/creole')
1223
- #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.creole", creole.to_doc(:creole, @opt))
1224
- $log.warn('test_creole_inline_ruby: to text/creole')
1225
- #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.text", creole.to_doc(:text, @opt))
1226
- end #test_creole_inline_ruby
1227
- def test_creole_countdown()
1228
- creole = Docgenerator::Creole::Creole.new(
1229
- :name => 'countdown',
1230
- :content => <<creole
1231
- Countdown: <<ruby_raw|(1..10).to_a.reverse.join("-")>>
1232
- creole
1233
- )
1234
- assert_equal_filecontent( "expected_creole/test_creole_countdown.html", creole.to_doc(:html, @opt))
1235
- assert_equal_filecontent( "expected_creole/test_creole_countdown.latex", creole.to_doc(:latex, @opt))
1236
- $log.warn('test_creole_countdown: to_context')
1237
- #~ assert_equal_filecontent( "expected_creole/test_creole_countdown.context", creole.to_doc(:context))
1238
- $log.warn('test_creole_countdown: to wiki/creole')
1239
- #~ assert_equal_filecontent( "expected_creole/test_creole_countdown.creole", creole.to_doc(:creole, @opt))
1240
- $log.warn('test_creole_countdown: to text/creole')
1241
- #~ assert_equal_filecontent( "expected_creole/test_creole_countdown.text", creole.to_doc(:text, @opt))
1242
- end #test_creole_countdown
1243
-
1244
- end #Test_creole_inline_ruby
1245
-
1246
- class Test_creole_ignore < Test::Unit::TestCase
1247
- def setup()
1248
- #Avoid warnings about missing logger in to_doc
1249
- @opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
1250
- end
1251
- def test_creole_ignore()
1252
- creole = Docgenerator::Creole::Creole.new(
1253
- :name => 'ignore',
1254
- :ignore => /^#~.*$/,
1255
- :log => $tmplog, #catch info about comment
1256
- :content => <<creole
1257
- Text
1258
- #~ this is a comment
1259
- more text
1260
- creole
1261
- )
1262
- assert_equal_filecontent( "expected_creole/test_creole_ignore.html", creole.to_doc(:html, @opt))
1263
- assert_equal_filecontent( "expected_creole/test_creole_ignore.latex", creole.to_doc(:latex, @opt))
1264
- $log.warn('test_creole_ignore: to_context')
1265
- #~ assert_equal_filecontent( "expected_creole/test_creole_ignore.context", creole.to_doc(:context))
1266
- $log.warn('test_creole_ignore: to wiki/creole')
1267
- #~ assert_equal_filecontent( "expected_creole/test_creole_ignore.creole", creole.to_doc(:creole, @opt))
1268
- assert_equal_filecontent( "expected_creole/test_creole_ignore.text", creole.to_doc(:text, @opt))
1269
- end #test_creole_ignore
1270
-
1271
- def test_creole_comment()
1272
- creole = Docgenerator::Creole::Creole.new(
1273
- :name => 'comment',
1274
- :content => <<creole
1275
- ==Titel 1==
1276
- Text
1277
- <<<comment
1278
- This is a comment.
1279
- It's part of the document, but not visible to readers.
1280
- >>>
1281
- Text after
1282
- creole
1283
- )
1284
- assert_equal_filecontent( "expected_creole/test_creole_comment.html", creole.to_doc(:html, @opt))
1285
- assert_equal_filecontent( "expected_creole/test_creole_comment.latex", creole.to_doc(:latex, @opt))
1286
- assert_equal_filecontent( "expected_creole/test_creole_comment.context", creole.to_doc(:context))
1287
- assert_equal_filecontent( "expected_creole/test_creole_comment.creole", creole.to_doc(:creole, @opt))
1288
- #~ assert_raise( RuntimeError ) { creole.to_doc(:text, @opt) }
1289
- $log.warn('test_creole_comment: to text')
1290
- #~ assert_equal_filecontent( "expected_creole/test_creole_comment.text", creole.to_doc(:text, @opt))
1291
- end #test_creole_comment
1292
-
1293
- end #Test_creole_ignore
1294
-
1295
-
1296
- def newtest(text, with_class = false )
1297
- code = ''
1298
- code << "class Test_creole_#{text} < Test::Unit::TestCase\n" if with_class
1299
- code << <<code
1300
- def test_creole_#{text}()
1301
- creole = Docgenerator::Creole::Creole.new(
1302
- :name => '#{text}',
1303
- :content => <<creole
1304
- ==Titel 1==
1305
- Text
1306
- creole
1307
- )
1308
- assert_equal_filecontent( "expected_creole/test_creole_#{text}.html", creole.to_doc(:html, @opt))
1309
- assert_equal_filecontent( "expected_creole/test_creole_#{text}.latex", creole.to_doc(:latex, @opt))
1310
- $log.warn('test_creole_#{text}: to_context')
1311
- #~ assert_equal_filecontent( "expected_creole/test_creole_#{text}.context", creole.to_doc(:context))
1312
- $log.warn('test_creole_#{text}: to wiki/creole')
1313
- assert_equal_filecontent( "expected_creole/test_creole_#{text}.creole", creole.to_doc(:creole, @opt))
1314
- assert_equal_filecontent( "expected_creole/test_creole_#{text}.text", creole.to_doc(:text, @opt))
1315
- end #test_creole_#{text}
1316
- code
1317
- code << "end #Test_creole_#{text}\n" if with_class
1318
- puts code
1319
- end
1320
- #~ newtest('links_implicit_end')
1321
- #~ newtest('tabular', true)
1322
- #~ newtest('comment')
1323
- #~ newtest('ignore', true)
1324
-
1325
-
1326
-
1327
- __END__
1328
- = Escapes =
1329
- Normal Link: http://wikicreole.org/ - now same link, but escaped: ~http://wikicreole.org/
1330
-
1331
- Normal asterisks: ~**not bold~**
1332
-
1333
- a tilde alone: ~
1334
-
1335
- a tilde escapes itself: ~~xxx
1336
-
1337
- --------------------------------------------
1338
- Meine Erweiterungen
1339
- --------------------------------------------
1340
-
1341
- def test_creole_amazon()
1342
- creole = Docgenerator::Creole::Creole.new(:content => <<creole
1343
- {{amazon|asin=B000AFEJAM}}
1344
-
1345
- {{amazon|asin=B000AFEJAM|right}}
1346
- creole
1347
- )
1348
- assert_equal_filecontent( "expected_creole/test_creole_amazon.html", creole.to_doc(:html, @opt))
1349
- assert_equal_filecontent( "expected_creole/test_creole_amazon.latex", creole.to_doc(:latex, @opt))
1350
- $log.warn('test_creole_amazon: to_context')
1351
- #~ assert_equal_filecontent( "expected_creole/test_creole_amazon.context", creole.to_doc(:context))
1352
- assert_equal_filecontent( "expected_creole/test_creole_amazon.creole", creole.to_doc(:creole, @opt))
1353
- assert_equal_filecontent( "expected_creole/test_creole_amazon.text", creole.to_doc(:text, @opt))
1354
- end
1355
-
1356
- Option :ignore
1357
-
1358
- ---------
1359
- neue Ideen
1360
- #~ {{{div:css=sss
1361
- #~ {{{p:css=sss