docgenerator 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/examples/docgenerator_example.rb +34 -17
  2. data/examples/docgenerator_example_footnote.rb +82 -61
  3. data/examples/docgenerator_example_list.rb +24 -18
  4. data/examples/docgenerator_example_restrictions.rb +17 -27
  5. data/examples/docgenerator_example_tabular.rb +20 -20
  6. data/examples/docgenerator_example_tripfalls.rb +28 -20
  7. data/examples/results/readme +1 -0
  8. data/examples/results_expected/docgenerator_example.html +39 -0
  9. data/examples/results_expected/docgenerator_example.pdf +0 -0
  10. data/examples/results_expected/docgenerator_example.tex +56 -0
  11. data/examples/results_expected/docgenerator_example_footnote.html +40 -0
  12. data/examples/results_expected/docgenerator_example_footnote.pdf +0 -0
  13. data/examples/results_expected/docgenerator_example_footnote.tex +50 -0
  14. data/examples/results_expected/docgenerator_example_list.html +18 -0
  15. data/examples/results_expected/docgenerator_example_list.pdf +0 -0
  16. data/examples/results_expected/docgenerator_example_list.tex +46 -0
  17. data/examples/results_expected/docgenerator_example_restrictions.html +22 -0
  18. data/examples/results_expected/docgenerator_example_restrictions.pdf +0 -0
  19. data/examples/results_expected/docgenerator_example_restrictions.tex +31 -0
  20. data/examples/results_expected/docgenerator_example_tabular.html +37 -0
  21. data/examples/results_expected/docgenerator_example_tabular.pdf +0 -0
  22. data/examples/results_expected/docgenerator_example_tabular.tex +41 -0
  23. data/examples/results_expected/docgenerator_example_tripfalls.html +27 -0
  24. data/examples/results_expected/docgenerator_example_tripfalls.pdf +0 -0
  25. data/examples/results_expected/docgenerator_example_tripfalls.tex +31 -0
  26. data/lib/creole/creole2doc.rb +291 -140
  27. data/lib/creole/creole_inclusion_and_plugins.rb +142 -39
  28. data/lib/creole/creole_placeholder.rb +92 -30
  29. data/lib/creole/creole_tabular.rb +119 -20
  30. data/lib/docgenerator.rb +209 -118
  31. data/lib/{docgenerator_attribute.rb → docgenerator/attribute.rb} +2 -1
  32. data/lib/{docgenerator_characters.rb → docgenerator/characters.rb} +75 -6
  33. data/lib/{docgenerator_css.rb → docgenerator/css.rb} +0 -0
  34. data/lib/docgenerator/document.rb +588 -0
  35. data/lib/{docgenerator_element.rb → docgenerator/element.rb} +52 -80
  36. data/lib/{docgenerator_elements.rb → docgenerator/elements.rb} +43 -17
  37. data/lib/{docgenerator_environments.rb → docgenerator/environments.rb} +20 -6
  38. data/lib/{docgenerator_footnote.rb → docgenerator/footnote.rb} +22 -18
  39. data/lib/{docgenerator_lists.rb → docgenerator/lists.rb} +17 -1
  40. data/lib/{docgenerator_sections.rb → docgenerator/sections.rb} +9 -1
  41. data/lib/docgenerator/standard.rb +81 -0
  42. data/lib/{docgenerator_tabular.rb → docgenerator/tabular.rb} +9 -5
  43. data/lib/packages/docgenerator_listings.rb +9 -5
  44. data/lib/packages/docgenerator_pdfpages.rb +17 -11
  45. data/lib/packages/docgenerator_url.rb +0 -2
  46. data/lib/templates/docgenerator_template.rb +66 -29
  47. data/lib/templates/docgenerator_template.yaml +18 -0
  48. data/lib/wiki2doc/wiki2docgenerator.rb +6 -2
  49. data/readme.rd +132 -0
  50. data/unittest/expected/test_document_usepackage_undefined.log +2 -0
  51. data/unittest/expected/test_enumerate.context +4 -0
  52. data/unittest/expected/test_footnote.html +4 -4
  53. data/unittest/expected/test_footnote.latex +4 -4
  54. data/unittest/expected/test_footnote_group.html +6 -6
  55. data/unittest/expected/test_footnote_group.latex +6 -6
  56. data/unittest/expected/test_href.html +2 -2
  57. data/unittest/expected/test_href.latex +2 -2
  58. data/unittest/expected/test_href.text +2 -2
  59. data/unittest/expected/test_itemize.context +4 -0
  60. data/unittest/expected/test_runtex.stdout +3 -0
  61. data/unittest/expected/test_runtex_2.stdout +3 -0
  62. data/unittest/expected/test_section.context +20 -0
  63. data/unittest/expected/test_tabular.html +2 -2
  64. data/unittest/expected/test_verbatim.html +3 -0
  65. data/unittest/expected/test_verbatim.latex +4 -0
  66. data/unittest/expected/test_verbatim_array.html +1 -0
  67. data/unittest/expected/test_verbatim_array.latex +2 -0
  68. data/unittest/expected_creole/test_creole_characters_all.html +12 -5
  69. data/unittest/expected_creole/test_creole_characters_all.latex +20 -6
  70. data/unittest/expected_creole/test_creole_comment.context +11 -0
  71. data/unittest/expected_creole/test_creole_comment.creole +12 -0
  72. data/unittest/expected_creole/test_creole_comment.html +9 -0
  73. data/unittest/expected_creole/test_creole_comment.latex +11 -0
  74. data/unittest/expected_creole/test_creole_creole1.0test.html +3 -3
  75. data/unittest/expected_creole/test_creole_creole1.0test.latex +3 -3
  76. data/unittest/expected_creole/test_creole_creole1.0test.text +4 -4
  77. data/unittest/expected_creole/test_creole_ignore.html +3 -0
  78. data/unittest/expected_creole/test_creole_ignore.latex +4 -0
  79. data/unittest/expected_creole/test_creole_ignore.text +2 -0
  80. data/unittest/expected_creole/test_creole_input.normsource +12 -12
  81. data/unittest/expected_creole/test_creole_input_file_simple.html +15 -0
  82. data/unittest/expected_creole/test_creole_input_file_simple_readlines.html +15 -0
  83. data/unittest/expected_creole/test_creole_links_external_implicit.html +2 -2
  84. data/unittest/expected_creole/test_creole_links_external_implicit.latex +2 -2
  85. data/unittest/expected_creole/test_creole_links_external_implicit.text +2 -2
  86. data/unittest/expected_creole/test_creole_links_implicit_end.creole +4 -0
  87. data/unittest/expected_creole/test_creole_links_implicit_end.html +3 -0
  88. data/unittest/expected_creole/test_creole_links_implicit_end.latex +4 -0
  89. data/unittest/expected_creole/test_creole_list_ul.normsource +42 -42
  90. data/unittest/expected_creole/test_creole_mix_titles_list.html +10 -0
  91. data/unittest/expected_creole/test_creole_mix_titles_list.latex +18 -0
  92. data/unittest/expected_creole/test_creole_mix_titles_list.text +12 -0
  93. data/unittest/expected_creole/test_creole_paragraphs.normsource +15 -15
  94. data/unittest/expected_creole/test_creole_pictures_css.html +4 -1
  95. data/unittest/expected_creole/test_creole_pictures_css.latex +5 -1
  96. data/unittest/expected_creole/test_creole_pictures_longdesc.html +3 -0
  97. data/unittest/expected_creole/test_creole_pictures_width.html +3 -0
  98. data/unittest/expected_creole/test_creole_pictures_width.latex +4 -0
  99. data/unittest/expected_creole/test_creole_short_html.html +3 -0
  100. data/unittest/expected_creole/test_creole_short_html.latex +4 -0
  101. data/unittest/expected_creole/test_creole_short_html.text +2 -0
  102. data/unittest/expected_creole/test_creole_shy.creole +6 -0
  103. data/unittest/expected_creole/test_creole_shy.html +6 -0
  104. data/unittest/expected_creole/test_creole_shy.latex +8 -0
  105. data/unittest/expected_creole/test_creole_shy.text +4 -0
  106. data/unittest/expected_creole/test_creole_tabular_with_cell_option.html +20 -0
  107. data/unittest/expected_creole/test_creole_toc.html +3 -1
  108. data/unittest/expected_creole/test_creole_toc.latex +1 -1
  109. data/unittest/expected_creole/test_creole_toc.text +1 -1
  110. data/unittest/expected_creole/test_creole_toc_level.html +7 -0
  111. data/unittest/expected_creole/test_creole_toc_level.latex +10 -0
  112. data/unittest/expected_creole/test_creole_toc_level.text +3 -0
  113. data/unittest/expected_creole/test_creole_toc_level_text.html +8 -0
  114. data/unittest/expected_creole/test_creole_toc_level_text.latex +9 -0
  115. data/unittest/expected_creole/test_creole_verbatim.html +1 -1
  116. data/unittest/expected_creole/test_creole_verbatim.latex +1 -1
  117. data/unittest/expected_creole/test_creole_verbatim.text +1 -1
  118. data/unittest/expected_creole/test_creole_verbatim_inline.html +1 -1
  119. data/unittest/expected_creole/test_creole_verbatim_inline.latex +1 -1
  120. data/unittest/expected_wiki/test_wiki_description.html +5 -5
  121. data/unittest/expected_wiki/test_wiki_description.latex +5 -5
  122. data/unittest/expected_wiki/test_wiki_description.text +5 -5
  123. data/unittest/expected_wiki/test_wiki_description.wiki +5 -5
  124. data/unittest/test_rakefile_docgenerator.rb +43 -0
  125. data/unittest/unittest_creole2doc.rb +415 -27
  126. data/unittest/unittest_docgenerator.rb +256 -23
  127. data/unittest/unittest_docgenerator_runtex.rb +83 -0
  128. data/unittest/unittest_versions.rb +44 -0
  129. data/unittest/unittest_wiki2doc.rb +28 -27
  130. metadata +473 -106
  131. data/lib/docgenerator_document.rb +0 -525
  132. data/lib/packages/docgenerator_beamer.rb +0 -253
  133. data/lib/yaml2presentation/yaml2presentation.rb +0 -1091
  134. data/unittest/expected/beamer_01_article.tex +0 -13
  135. data/unittest/expected/beamer_01_attachment.tex +0 -15
  136. data/unittest/expected/beamer_01_doc.html +0 -13
  137. data/unittest/expected/beamer_01_doc.tex +0 -18
  138. data/unittest/expected/beamer_01_notes_only.tex +0 -13
  139. data/unittest/expected/beamer_01_notes_onlyslideswithnotes.tex +0 -13
  140. data/unittest/expected/beamer_01_notes_show.tex +0 -13
  141. data/unittest/expected/beamer_01_presentation.tex +0 -13
  142. data/unittest/expected/beamer_02_doc.html +0 -29
  143. data/unittest/expected/beamer_02_doc.tex +0 -34
  144. data/unittest/expected/beamer_block.html +0 -1
  145. data/unittest/expected/beamer_block.latex +0 -1
  146. data/unittest/expected/beamer_doc_fragile_doc.tex +0 -33
  147. data/unittest/expected/beamer_doc_html_overview_with_detailpic_and_text_doc.html +0 -34
  148. data/unittest/expected/beamer_doc_html_overview_with_detailpic_doc.html +0 -34
  149. data/unittest/expected/beamer_doc_key_doc.html +0 -20
  150. data/unittest/expected/beamer_doc_key_doc.tex +0 -29
  151. data/unittest/expected/beamer_doc_note_doc.html +0 -30
  152. data/unittest/expected/beamer_doc_note_doc.tex +0 -37
  153. data/unittest/expected/beamer_doc_pic_bottom_doc.html +0 -24
  154. data/unittest/expected/beamer_doc_pic_doc.html +0 -24
  155. data/unittest/expected/beamer_doc_pic_doc.tex +0 -28
  156. data/unittest/expected/beamer_doc_pic_left_doc.html +0 -24
  157. data/unittest/expected/beamer_doc_pic_left_doc.tex +0 -28
  158. data/unittest/expected/beamer_doc_pic_ratio_doc.tex +0 -29
  159. data/unittest/expected/beamer_doc_pic_right_doc.html +0 -24
  160. data/unittest/expected/beamer_doc_pic_right_doc.tex +0 -28
  161. data/unittest/expected/beamer_doc_pic_top_doc.html +0 -24
  162. data/unittest/expected/beamer_frame.html +0 -5
  163. data/unittest/expected/beamer_frame.tex +0 -11
  164. data/unittest/expected/beamer_frame_fragile.tex +0 -7
  165. data/unittest/expected/beamer_frame_id.html +0 -1
  166. data/unittest/expected/beamer_frame_id.tex +0 -4
  167. data/unittest/expected/beamer_framepic.html +0 -5
  168. data/unittest/expected/beamer_framepic.latex +0 -1
  169. data/unittest/expected/beamer_framepic_link.html +0 -5
  170. data/unittest/expected/beamer_framepic_link.latex +0 -1
  171. data/unittest/expected/beamer_frametitle.html +0 -1
  172. data/unittest/expected/beamer_frametitle.latex +0 -1
  173. data/unittest/expected/beamer_note.html +0 -1
  174. data/unittest/expected/beamer_note.latex +0 -1
  175. data/unittest/expected_privat/test_creole_test_document.html +0 -6
  176. data/unittest/expected_wiki/test_wiki_amazon.html +0 -10
  177. data/unittest/expected_wiki/test_wiki_link.log +0 -3
  178. data/unittest/test_docgenerator.rb +0 -107
  179. data/unittest/unittest_yaml2pres.rb +0 -336
@@ -0,0 +1,3 @@
1
+ <p >
2
+ before <em>this is only for HTML</em> after
3
+ </p>
@@ -0,0 +1,4 @@
1
+
2
+
3
+ before after
4
+
@@ -0,0 +1,2 @@
1
+
2
+ before after
@@ -0,0 +1,6 @@
1
+
2
+ Donau{{shy}}dampf{{shy}}schiff{{shy}}fahrt
3
+
4
+
5
+ Donau{{shy}}dampf{{shy}}schiff{{shy}}fahrt
6
+
@@ -0,0 +1,6 @@
1
+ <p >
2
+ Donau&shy;dampf&shy;schiff&shy;fahrt
3
+ </p>
4
+ <p >
5
+ Donau&shy;dampf&shy;schiff&shy;fahrt
6
+ </p>
@@ -0,0 +1,8 @@
1
+
2
+
3
+ Donau"-dampf"-schiff"-fahrt
4
+
5
+
6
+
7
+ Donau"-dampf"-schiff"-fahrt
8
+
@@ -0,0 +1,4 @@
1
+
2
+ Donaudampfschifffahrt
3
+
4
+ Donaudampfschifffahrt
@@ -0,0 +1,20 @@
1
+ <p >
2
+ before
3
+ </p>
4
+ <table >
5
+ <tr ><td style = "color: red" >eins</td>
6
+ <td >css = zwei</td>
7
+ <td class = "empty" ></td>
8
+ </tr>
9
+ <tr ><td >normal</td>
10
+ <td ><em >italic</em></td>
11
+ <td class = "it" ><em >italic</em></td>
12
+ </tr>
13
+ <tr ><td class = "it" >text with | nice! </td>
14
+ <td ></td>
15
+ <td ></td>
16
+ </tr>
17
+ </table>
18
+ <p >
19
+ after
20
+ </p>
@@ -1,3 +1,4 @@
1
+ <div class = 'toc'>
1
2
  <ul >
2
3
  <li ><a href = "#1" >one</a> </li>
3
4
  <li ><a href = "#2" >two</a> <ul >
@@ -5,7 +6,8 @@
5
6
  </ul>
6
7
  </li>
7
8
  <li ><a href = "#drei" >three</a> <ul >
8
- <li ><a href = "#3-1" >three-one</a></li>
9
+ <li ><a href = "#3-1" >three-one</a> </li>
9
10
  </ul>
10
11
  </li>
11
12
  </ul>
13
+ </div>
@@ -14,7 +14,7 @@
14
14
  \item \hyperlink{drei}{three}
15
15
  \begin{itemize}
16
16
 
17
- \item \hyperlink{3-1}{three-one}
17
+ \item \hyperlink{3-1}{three-one}
18
18
  \end{itemize}
19
19
 
20
20
 
@@ -1,4 +1,4 @@
1
1
  - one (#1)
2
2
  - two (#2) - two-one (#2-1)
3
- - three (#drei) - three-one (#3-1)
3
+ - three (#drei) - three-one (#3-1)
4
4
 
@@ -0,0 +1,7 @@
1
+ <div class = 'toc'>
2
+ <ul >
3
+ <li ><a href = "#1" >one</a> </li>
4
+ <li ><a href = "#2" >two</a> </li>
5
+ <li ><a href = "#drei" >three</a> </li>
6
+ </ul>
7
+ </div>
@@ -0,0 +1,10 @@
1
+
2
+ \begin{itemize}
3
+
4
+ \item \hyperlink{1}{one}
5
+
6
+ \item \hyperlink{2}{two}
7
+
8
+ \item \hyperlink{drei}{three}
9
+ \end{itemize}
10
+
@@ -0,0 +1,3 @@
1
+ - one (#1)
2
+ - two (#2)
3
+ - three (#drei)
@@ -0,0 +1,8 @@
1
+ <p >
2
+ Test for document with toc-level 1
3
+ </p>
4
+ <h1 id = "1" >one</h1>
5
+ <h1 id = "2" >two</h1>
6
+ <h2 id = "2-1" >two-one</h2>
7
+ <h1 id = "drei" >three</h1>
8
+ <h2 id = "3-1" >three-one</h2>
@@ -0,0 +1,9 @@
1
+
2
+
3
+ Test for document with toc-level 1
4
+
5
+ \section{one}\hypertarget{1}{}
6
+ \section{two}\hypertarget{2}{}
7
+ \subsection{two-one}\hypertarget{2-1}{}
8
+ \section{three}\hypertarget{drei}{}
9
+ \subsection{three-one}\hypertarget{3-1}{}
@@ -21,5 +21,5 @@ before
21
21
  after
22
22
  </p>
23
23
  <p >
24
- See <a href = "http://www.wikicreole.org/wiki/PreformattedAndNowiki" >http://www.wikicreole.org/wiki/PreformattedAndNowiki</a>
24
+ See <a href = "http://www.wikicreole.org/wiki/PreformattedAndNowiki" >http://www.wikicreole.org/wiki/PreformattedAndNowiki</a>
25
25
  </p>
@@ -29,5 +29,5 @@ after
29
29
 
30
30
 
31
31
 
32
- See \href{http://www.wikicreole.org/wiki/PreformattedAndNowiki}{http://www.wikicreole.org/wiki/PreformattedAndNowiki}
32
+ See \href{http://www.wikicreole.org/wiki/PreformattedAndNowiki}{http://www.wikicreole.org/wiki/PreformattedAndNowiki}
33
33
 
@@ -14,4 +14,4 @@ before
14
14
 
15
15
  after
16
16
 
17
- See http://www.wikicreole.org/wiki/PreformattedAndNowiki (http://www.wikicreole.org/wiki/PreformattedAndNowiki)
17
+ See http://www.wikicreole.org/wiki/PreformattedAndNowiki (http://www.wikicreole.org/wiki/PreformattedAndNowiki)
@@ -1,5 +1,5 @@
1
1
  <p >
2
- You can also use inline nowiki <span style = "display: inline;white-space:pre;font-family:monospace"> in a sentence </span> like this. See <a href = "http://www.wikicreole.org/wiki/PreformattedAndNowiki" >http://www.wikicreole.org/wiki/PreformattedAndNowiki</a>
2
+ You can also use inline nowiki <span style = "display: inline;white-space:pre;font-family:monospace"> in a sentence </span> like this. See <a href = "http://www.wikicreole.org/wiki/PreformattedAndNowiki" >http://www.wikicreole.org/wiki/PreformattedAndNowiki</a>.
3
3
  </p>
4
4
  <p >
5
5
  Some examples of markup are: <span style = "display: inline;white-space:pre;font-family:monospace">** &lt;i&gt;this&lt;/i&gt; ** </span>
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- You can also use inline nowiki \verb| in a sentence | like this. See \href{http://www.wikicreole.org/wiki/PreformattedAndNowiki}{http://www.wikicreole.org/wiki/PreformattedAndNowiki}
3
+ You can also use inline nowiki \verb| in a sentence | like this. See \href{http://www.wikicreole.org/wiki/PreformattedAndNowiki}{http://www.wikicreole.org/wiki/PreformattedAndNowiki}.
4
4
 
5
5
 
6
6
 
@@ -1,7 +1,7 @@
1
1
  <dl >
2
- <dt >Komplizierter Begriff</dt>
3
- <dd >Jetzt eine Lange Beschreibung des begriffes der auch �ber eine zweite Zeile geht</dd>
4
- <dd >Noch ein Eintrag </dd>
5
- <dt >Begriff</dt>
6
- <dd >Definition des Begriffs</dd>
2
+ <dt >Something</dt>
3
+ <dd >Now a long description of Something, continued on a second liine.</dd>
4
+ <dd >Another entry</dd>
5
+ <dt >Something Else</dt>
6
+ <dd >Definition of Something Else</dd>
7
7
  </dl>
@@ -1,11 +1,11 @@
1
1
 
2
2
  \begin{description}
3
3
 
4
- \item[Komplizierter Begriff]
5
- Jetzt eine Lange Beschreibung des begriffes der auch �ber eine zweite Zeile geht
6
- Noch ein Eintrag
4
+ \item[Something]
5
+ Now a long description of Something, continued on a second liine.
6
+ Another entry
7
7
 
8
- \item[Begriff]
9
- Definition des Begriffs
8
+ \item[Something Else]
9
+ Definition of Something Else
10
10
  \end{description}
11
11
 
@@ -1,6 +1,6 @@
1
1
 
2
- Komplizierter Begriff:
3
- Jetzt eine Lange Beschreibung des begriffes der auch �ber eine zweite Zeile geht
4
- Noch ein Eintrag
5
- Begriff:
6
- Definition des Begriffs
2
+ Something:
3
+ Now a long description of Something, continued on a second liine.
4
+ Another entry
5
+ Something Else:
6
+ Definition of Something Else
@@ -1,6 +1,6 @@
1
1
 
2
- ;Komplizierter Begriff
3
- :Jetzt eine Lange Beschreibung des begriffes der auch �ber eine zweite Zeile geht
4
- :Noch ein Eintrag
5
- ;Begriff
6
- :Definition des Begriffs
2
+ ;Something
3
+ :Now a long description of Something, continued on a second liine.
4
+ :Another entry
5
+ ;Something Else
6
+ :Definition of Something Else
@@ -0,0 +1,43 @@
1
+ # encoding: ASCII-8BIT
2
+
3
+ #
4
+ #This test rake must be in this directory.
5
+ #If not, we get a problem with
6
+ #require 'assert_equal_filecontent.rb'
7
+ #
8
+
9
+ #~ require 'ftools'
10
+ require 'rake'
11
+ require 'rake/testtask.rb'
12
+
13
+ #~ FileList['unittest_tools/unittest_yaml2pres.rb'].each{|testfile|
14
+ FileList['unittest*.rb'].each{|testfile|
15
+ #~ next unless %w{unittest_rubycode4doc.rb}.include?(testfile)
16
+ Rake::TestTask.new(testfile) do |t|
17
+ t.libs << "../lib"
18
+ t.test_files = testfile
19
+ t.verbose = true
20
+ end
21
+ task :test => testfile
22
+ #~ puts "task :default => #{testfile.inspect}"
23
+ }
24
+
25
+ Rake::TestTask.new(:testall) do |t|
26
+ t.libs << "../lib"
27
+ t.test_files = FileList['unittest*.rb']
28
+ t.verbose = true
29
+ end
30
+
31
+
32
+ if $0 == __FILE__
33
+ desc "Default: "
34
+ task :default => :testall
35
+ #~ task :default => :test
36
+ #~ task :default => "unittest_creole2doc.rb"
37
+ #~ task :default => "unittest_docgenerator.rb"
38
+ #~ task :default => "unittest_wiki2doc.rb"
39
+
40
+ app = Rake.application
41
+ app[:default].invoke
42
+
43
+ end
@@ -1,7 +1,13 @@
1
- require 'test_docgenerator.rb'
2
- Dir.chdir('../lib/creole/'){
3
- require 'creole2doc.rb'
4
- }
1
+ # encoding: ASCII-8BIT
2
+ if $0 == __FILE__
3
+ $:.unshift("../lib")
4
+ end
5
+
6
+ require 'test/unit'
7
+ require 'more_unit_test/assert_equal_filecontent.rb'
8
+
9
+ require 'creole/creole2doc.rb'
10
+
5
11
  #~ require 'creole/creole2doc.rb'
6
12
 
7
13
  <<missingtests
@@ -9,8 +15,6 @@ see Text and
9
15
  description
10
16
  labels
11
17
 
12
- amazon/affiliate -> privat
13
-
14
18
  <<ruby>>
15
19
 
16
20
  erweitern:
@@ -18,11 +22,22 @@ erweitern:
18
22
  *Creole_creoletab
19
23
  *csv-tabs
20
24
 
21
- *picture: zus. optionen (css...)
22
-
23
25
  Creole_document
26
+ *content mit level..., \tableofcontents...
27
+
28
+ placeholder mit parameter (siehe creole_rail)
29
+
30
+
31
+ Bug:
32
+ http://... am Ende ohne folgenden Text wird falsch erkannt.
33
+ --> test_creole_links_implicit_end()
24
34
  missingtests
25
35
 
36
+ #thisfile is needed to avoid different values of $thisfile
37
+ #(Running stand alone it's the filename, with require it's './<<filename>>'
38
+ $thisfile = File.basename(__FILE__)
39
+
40
+
26
41
  class Creole
27
42
  #Access to the options.
28
43
  attr_reader :options
@@ -73,10 +88,31 @@ creole
73
88
  creole << source
74
89
  assert_equal( [source, source], creole.source)
75
90
  end
76
- #
91
+ def test_creole_input_array()
92
+
93
+ creole = Creole.new(:content => [ "Text1", "Text2" ] )
94
+ assert_equal( ["Text1\nText2"], creole.source)
95
+
96
+ creole = Creole.new(:content => [ "Text1\n", "Text2" ] )
97
+ assert_equal( ["Text1\nText2"], creole.source)
98
+
99
+ #Leading spaces keep staying
100
+ creole = Creole.new(:content => [ " Text1\n", "Text2" ] )
101
+ assert_equal( [" Text1\nText2"], creole.source)
102
+
103
+ #Trailing spaces keep staying
104
+ creole = Creole.new(:content => [ "Text1 \n", "Text2" ] )
105
+ assert_equal( ["Text1 \nText2"], creole.source)
106
+
107
+ end #
108
+ def test_creole_input_undefined()
109
+ assert_nothing_raised(RuntimeError){ Creole.new(:content => 'source' ) }
110
+ #~ assert_nothing_raised(RuntimeError){ Creole.new(:content => ['source'] ) }
111
+ assert_raise(Creole::InputError){ Creole.new(:content => :source ) }
112
+ end
77
113
  #Check for open File-handles
78
114
  def test_creole_input_file()
79
- creole1 = Creole.new( :content => File.readlines('creole1.0test.txt').to_s )
115
+ creole1 = Creole.new( :content => File.read('creole1.0test.txt') )
80
116
  creole2 = nil
81
117
  File.open('creole1.0test.txt'){|filehandle|
82
118
  creole2 = Creole.new( :content => filehandle )
@@ -86,28 +122,43 @@ creole
86
122
  #
87
123
  #Test for filehandle, if the file is a Rubyscript (Take only parts after __END__)
88
124
  def test_creole_input_file_rb()
125
+ #ignore this test, if tests are loaded via require.
126
+ return unless $0 == __FILE__
127
+
89
128
  creole1 = Creole.new( :name => 'input_file_rb/DATA', :content => DATA )
90
129
  creole2 = nil
91
- File.open(__FILE__){|filehandle|
130
+ File.open($thisfile){|filehandle|
92
131
  #~ $log.warn('Test Filehandle auf ruby nicht m�glich (Test $0 == input.path)')
93
132
  #Modify $0 temporary to allow test with condition $0 == input.path
94
- $0 = "xxxx#{__FILE__}"
133
+ $0 = "xxxx#{$thisfile}"
95
134
  creole2 = Creole.new( :name => 'input_file_rb', :content => filehandle, :log => $tmplog )
96
- $0 = __FILE__
135
+ $0 = $thisfile
97
136
  }
98
137
  assert_equal( creole1.source, creole2.source)
99
- end
138
+ end
139
+ def test_creole_input_file_simple
140
+ assert_true(File.exist?('creole_testtext.creole'))
141
+ creole = Creole.new()
142
+ File.open('creole_testtext.creole'){|f| creole << f.readlines }
143
+ end
144
+ def test_creole_input_file_simple_readlines
145
+ creole = Creole.new()
146
+ File.open('creole_testtext.creole'){|f| creole << f }
147
+ assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html))
148
+ end
100
149
  #
101
150
  #This testcases are taken from http://www.wikicreole.org/wiki/Creole1.0TestCases
102
151
  def test_creole_creole1_0test()
103
152
  $log.info('Testcases uncomplete creole1.0test.txt')
104
153
  creole = Creole.new(
105
154
  :name => 'creole_creole1_0test',
106
- :content => File.readlines('creole1.0test.txt').to_s,
155
+ :content => File.readlines('creole1.0test.txt').join,
107
156
  :log => $tmplog #catch warning for [[links]]
108
157
  )
109
158
  assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.html", creole.to_doc(:html))
110
159
  assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.latex", creole.to_doc(:latex))
160
+ $log.warn('test_creole_creole1.0test: to_context')
161
+ #~ assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.context", creole.to_doc(:context))
111
162
  $log.info('test_creole_creole1_0test: uncomplete to_creole')
112
163
  #~ assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.creole", creole.to_doc(:creole))
113
164
  assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.text", creole.to_doc(:text))
@@ -130,6 +181,8 @@ creole
130
181
 
131
182
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs.html", creole.to_doc(:html))
132
183
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs.latex", creole.to_doc(:latex))
184
+ $log.warn('test_creole_paragraphs: to_context')
185
+ #~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs.context", creole.to_doc(:context))
133
186
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs.wiki", creole.to_doc(:wiki))
134
187
  $log.info('test_creole_paragraphs: uncomplete to_creole')
135
188
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs.text", creole.to_doc(:text))
@@ -144,6 +197,8 @@ creole
144
197
 
145
198
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.html", creole.to_doc(:html))
146
199
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.latex", creole.to_doc(:latex))
200
+ $log.warn('test_creole_paragraphs_wrap: to_context')
201
+ #~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.context", creole.to_doc(:context))
147
202
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.wiki", creole.to_doc(:wiki))
148
203
  $log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
149
204
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.text", creole.to_doc(:text))
@@ -157,6 +212,8 @@ creole
157
212
 
158
213
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.html", creole.to_doc(:html))
159
214
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.latex", creole.to_doc(:latex))
215
+ $log.warn('test_creole_paragraphs_wrap60: to_context')
216
+ #~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.context", creole.to_doc(:context))
160
217
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.wiki", creole.to_doc(:wiki))
161
218
  $log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
162
219
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.text", creole.to_doc(:text))
@@ -174,6 +231,8 @@ creole
174
231
 
175
232
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.html", creole.to_doc(:html))
176
233
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.latex", creole.to_doc(:latex))
234
+ $log.warn('test_creole_paragraphs_wrap0: to_context')
235
+ #~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.context", creole.to_doc(:context))
177
236
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.wiki", creole.to_doc(:wiki))
178
237
  $log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
179
238
  assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.text", creole.to_doc(:text))
@@ -206,6 +265,8 @@ creole
206
265
 
207
266
  assert_equal_filecontent( "expected_creole/test_creole_headings.html", creole.to_doc(:html))
208
267
  assert_equal_filecontent( "expected_creole/test_creole_headings.latex", creole.to_doc(:latex))
268
+ $log.warn('test_creole_headings: to_context')
269
+ #~ assert_equal_filecontent( "expected_creole/test_creole_headings.context", creole.to_doc(:context))
209
270
  assert_equal_filecontent( "expected_creole/test_creole_headings.wiki", creole.to_doc(:wiki))
210
271
  $log.info('test_creole_paragraphs: uncomplete to_creole')
211
272
  assert_equal_filecontent( "expected_creole/test_creole_headings.text", creole.to_doc(:text))
@@ -227,6 +288,8 @@ creole
227
288
  #Check the manual label
228
289
  assert_equal_filecontent( "expected_creole/test_creole_label.html", creole.to_doc(:html))
229
290
  assert_equal_filecontent( "expected_creole/test_creole_label.latex", creole.to_doc(:latex))
291
+ $log.warn('test_creole_label: to_context')
292
+ #~ assert_equal_filecontent( "expected_creole/test_creole_label.context", creole.to_doc(:context))
230
293
  $log.info('test_creole_label: uncomplete text/to_creole')
231
294
  #~ assert_equal_filecontent( "expected_creole/test_creole_label.creole", creole.to_doc(:creole))
232
295
  #~ assert_equal_filecontent( "expected_creole/test_creole_label.text", creole.to_doc(:text))
@@ -250,10 +313,36 @@ creole
250
313
  assert_equal_filecontent( "expected_creole/test_creole_toc_text.html", creole.to_doc(:html))
251
314
  assert_equal_filecontent( "expected_creole/test_creole_toc.latex", creole.toc.to_doc(:latex))
252
315
  assert_equal_filecontent( "expected_creole/test_creole_toc_text.latex", creole.to_doc(:latex))
316
+ $log.warn('test_creole_toc_text: to_context')
317
+ #~ assert_equal_filecontent( "expected_creole/test_creole_toc_text.context", creole.to_doc(:context))
253
318
  $log.warn('test_creole_toc: to wiki/creole')
254
319
  #~ assert_equal_filecontent( "expected_creole/test_creole_toc.creole", creole.to_doc(:creole))
255
320
  assert_equal_filecontent( "expected_creole/test_creole_toc.text", creole.toc.to_doc(:text))
256
321
  end #test_creole_toc
322
+ #Build the toc, but only up to level toclevel.
323
+ def test_creole_toc_level()
324
+ toclevel = 1
325
+ creole = Creole.new(
326
+ :name => 'toc',
327
+ :content => <<creole
328
+ Test for document with toc-level #{toclevel}
329
+ =one
330
+ =two
331
+ ==two-one
332
+ =[drei]three
333
+ ==three-one
334
+ creole
335
+ )
336
+ assert_equal_filecontent( "expected_creole/test_creole_toc_level.html", creole.toc(:level => toclevel).to_doc(:html))
337
+ assert_equal_filecontent( "expected_creole/test_creole_toc_level_text.html", creole.to_doc(:html))
338
+ assert_equal_filecontent( "expected_creole/test_creole_toc_level.latex", creole.toc(:level => toclevel).to_doc(:latex))
339
+ assert_equal_filecontent( "expected_creole/test_creole_toc_level_text.latex", creole.to_doc(:latex, :level => toclevel))
340
+ $log.warn('test_creole_toc_text: to_context')
341
+ #~ assert_equal_filecontent( "expected_creole/test_creole_toc_text.context", creole.to_doc(:context)
342
+ $log.warn('test_creole_toc: to wiki/creole')
343
+ #~ assert_equal_filecontent( "expected_creole/test_creole_toc_level.creole", creole.to_doc(:creole)
344
+ assert_equal_filecontent( "expected_creole/test_creole_toc_level.text", creole.toc(:level => toclevel).to_doc(:text))
345
+ end #test_creole_toc_level
257
346
  end #Test_creole_toc
258
347
 
259
348
  class Test_creole_paragraph2 < Test::Unit::TestCase
@@ -272,6 +361,8 @@ creole
272
361
  )
273
362
  assert_equal_filecontent( "expected_creole/test_creole_newline.html", creole.to_doc(:html))
274
363
  assert_equal_filecontent( "expected_creole/test_creole_newline.latex", creole.to_doc(:latex))
364
+ $log.warn('test_creole_newline: to_context')
365
+ #~ assert_equal_filecontent( "expected_creole/test_creole_newline.context", creole.to_doc(:context))
275
366
  $log.warn('test_creole_newline: to wiki/creole')
276
367
  #~ assert_equal_filecontent( "expected_creole/test_creole_newline.creole", creole.to_doc(:creole))
277
368
  assert_equal_filecontent( "expected_creole/test_creole_newline.text", creole.to_doc(:text))
@@ -288,6 +379,8 @@ creole
288
379
  )
289
380
  assert_equal_filecontent( "expected_creole/test_creole_hr.html", creole.to_doc(:html))
290
381
  assert_equal_filecontent( "expected_creole/test_creole_hr.latex", creole.to_doc(:latex))
382
+ $log.warn('test_creole_hr: to_context')
383
+ #~ assert_equal_filecontent( "expected_creole/test_creole_hr.context", creole.to_doc(:context))
291
384
  $log.warn('test_creole_hr: to wiki/creole')
292
385
  #~ assert_equal_filecontent( "expected_creole/test_creole_hr.creole", creole.to_doc(:creole))
293
386
  assert_equal_filecontent( "expected_creole/test_creole_hr.text", creole.to_doc(:text))
@@ -305,6 +398,8 @@ creole
305
398
  )
306
399
  assert_equal_filecontent( "expected_creole/test_creole_inline.html", creole.to_doc(:html))
307
400
  assert_equal_filecontent( "expected_creole/test_creole_inline.latex", creole.to_doc(:latex))
401
+ $log.warn('test_creole_inline: to_context')
402
+ #~ assert_equal_filecontent( "expected_creole/test_creole_inline.context", creole.to_doc(:context))
308
403
  $log.info('test_creole_inline_bold_em: inline to wiki/creole')
309
404
  #~ assert_equal_filecontent( "expected_creole/test_creole_inline.creole", creole.to_doc(:creole))
310
405
  $log.warn('test_creole_inline_bold_em: inline text with additional spaces')
@@ -321,6 +416,8 @@ creole
321
416
  )
322
417
  assert_equal_filecontent( "expected_creole/test_creole_line_break.html", creole.to_doc(:html))
323
418
  assert_equal_filecontent( "expected_creole/test_creole_line_break.latex", creole.to_doc(:latex))
419
+ $log.warn('test_creole_line_break: to_context')
420
+ #~ assert_equal_filecontent( "expected_creole/test_creole_line_break.context", creole.to_doc(:context))
324
421
  $log.info('test_creole_inline_bold_line_break: inline to wiki/creole')
325
422
  #~ assert_equal_filecontent( "expected_creole/test_creole_line_break.creole", creole.to_doc(:creole))
326
423
  #~ assert_equal_filecontent( "expected_creole/test_creole_line_break.text", creole.to_doc(:text))
@@ -351,6 +448,8 @@ creole
351
448
  )
352
449
  assert_equal_filecontent( "expected_creole/test_creole_list_ul.html", creole.to_doc(:html))
353
450
  assert_equal_filecontent( "expected_creole/test_creole_list_ul.latex", creole.to_doc(:latex))
451
+ $log.warn('test_creole_list_ul: to_context')
452
+ #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.context", creole.to_doc(:context))
354
453
  $log.warn('test_creole_list_ul: list to wiki/creole')
355
454
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.creole", creole.to_doc(:creole))
356
455
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.wiki", creole.to_doc(:wiki))
@@ -375,6 +474,8 @@ creole
375
474
  )
376
475
  assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.html", creole.to_doc(:html))
377
476
  assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.latex", creole.to_doc(:latex))
477
+ $log.warn('test_creole_list_ul_too_much: to_context')
478
+ #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.context", creole.to_doc(:context))
378
479
  $log.warn('test_creole_list_ul_too_much: list to wiki/creole')
379
480
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.creole", creole.to_doc(:creole))
380
481
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.text", creole.to_doc(:text))
@@ -392,6 +493,8 @@ creole
392
493
  )
393
494
  assert_equal_filecontent( "expected_creole/test_creole_list_ol.html", creole.to_doc(:html))
394
495
  assert_equal_filecontent( "expected_creole/test_creole_list_ol.latex", creole.to_doc(:latex))
496
+ $log.warn('test_creole_list_ol: to_context')
497
+ #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.context", creole.to_doc(:context))
395
498
  $log.warn('test_creole_list_ol: list to wiki/creole')
396
499
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.creole", creole.to_doc(:creole))
397
500
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.text", creole.to_doc(:text))
@@ -411,6 +514,8 @@ creole
411
514
  )
412
515
  assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.html", creole.to_doc(:html))
413
516
  assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.latex", creole.to_doc(:latex))
517
+ $log.warn('test_creole_list_ol_ul: to_context')
518
+ #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.context", creole.to_doc(:context))
414
519
  $log.warn('test_creole_list_ol_ul: list to wiki/creole')
415
520
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.creole", creole.to_doc(:creole))
416
521
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.text", creole.to_doc(:text))
@@ -427,6 +532,8 @@ creole
427
532
  )
428
533
  assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.html", creole.to_doc(:html))
429
534
  assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.latex", creole.to_doc(:latex))
535
+ $log.warn('test_creole_list_ol_after_ul: to_context')
536
+ #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.context", creole.to_doc(:context))
430
537
  $log.warn('test_creole_list_ol_after_ul: list to wiki/creole')
431
538
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.creole", creole.to_doc(:creole))
432
539
  #~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.text", creole.to_doc(:text))
@@ -447,6 +554,8 @@ creole
447
554
  )
448
555
  assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.html", creole.to_doc(:html))
449
556
  assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.latex", creole.to_doc(:latex))
557
+ $log.warn('test_creole_ul_multiple_line: to_context')
558
+ #~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.context", creole.to_doc(:context))
450
559
  $log.warn('test_creole_ul_multiple_line: list to wiki/creole')
451
560
  #~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.creole", creole.to_doc(:creole))
452
561
  #~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.text", creole.to_doc(:text)) #fixme
@@ -464,6 +573,8 @@ creole
464
573
  )
465
574
  assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.html", creole.to_doc(:html))
466
575
  assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.latex", creole.to_doc(:latex))
576
+ $log.warn('test_creole_ul_with_bold: to_context')
577
+ #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.context", creole.to_doc(:context))
467
578
  $log.warn('test_creole_ul_with_bold: list to wiki/creole')
468
579
  #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.creole", creole.to_doc(:creole))
469
580
  assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.text", creole.to_doc(:text))
@@ -480,10 +591,34 @@ creole
480
591
  )
481
592
  assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.html", creole.to_doc(:html))
482
593
  assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.latex", creole.to_doc(:latex))
594
+ $log.warn('test_creole_ul_with_blank: to_context')
595
+ #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.context", creole.to_doc(:context))
483
596
  $log.warn('test_creole_ul_with_blank: list to wiki/creole')
484
597
  #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.creole", creole.to_doc(:creole))
485
598
  #~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.text", creole.to_doc(:text))
486
599
  end
600
+ #Check, if the second list is really a second list.
601
+ def test_creole_mix_titles_list()
602
+ creole = Creole.new(
603
+ :name => 'mix_titles_list',
604
+ :content => <<creole
605
+ =Titel 1
606
+ *item 1
607
+ *item 2
608
+ =Titel 2
609
+ *item 1
610
+ *item 2
611
+ creole
612
+ )
613
+ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.html", creole.to_doc(:html))
614
+ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.latex", creole.to_doc(:latex))
615
+ $log.warn('test_creole_mix_titles_list: to_context')
616
+ #~ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.context", creole.to_doc(:context))
617
+ $log.warn('test_creole_mix_titles_list: to wiki/creole')
618
+ #~ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.creole", creole.to_doc(:creole))
619
+ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.text", creole.to_doc(:text))
620
+ end #test_creole_mix_titles_list
621
+
487
622
  end #Test_creole_List
488
623
 
489
624
 
@@ -498,6 +633,8 @@ creole
498
633
  )
499
634
  assert_equal_filecontent( "expected_creole/test_creole_links_external.html", creole.to_doc(:html))
500
635
  assert_equal_filecontent( "expected_creole/test_creole_links_external.latex", creole.to_doc(:latex))
636
+ $log.warn('test_creole_links_external: to_context')
637
+ #~ assert_equal_filecontent( "expected_creole/test_creole_links_external.context", creole.to_doc(:context))
501
638
  $log.warn('test_creole_links_external: to wiki/creole')
502
639
  #~ assert_equal_filecontent( "expected_creole/test_creole_links_external.creole", creole.to_doc(:creole))
503
640
  assert_equal_filecontent( "expected_creole/test_creole_links_external.text", creole.to_doc(:text))
@@ -505,7 +642,7 @@ creole
505
642
 
506
643
  def test_creole_links_external_implicit()
507
644
  creole = Creole.new(:content => <<creole
508
- Free links without braces should be rendered as well, like http://www.wikicreole.org/ and http://www.wikicreole.org/users/~example.
645
+ Free links without braces should be rendered as well, like http://www.wikicreole.org/ and [[http://www.wikicreole.org/users/~example]].
509
646
 
510
647
  See also description: http://www.wikicreole.org/wiki/Links
511
648
 
@@ -515,10 +652,31 @@ creole
515
652
  )
516
653
  assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.html", creole.to_doc(:html))
517
654
  assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.latex", creole.to_doc(:latex))
655
+ $log.warn('test_creole_links_external_implicit: to_context')
656
+ #~ assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.context", creole.to_doc(:context))
518
657
  $log.warn('test_creole_links_external_implicit: to wiki/creole')
519
658
  #~ assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.creole", creole.to_doc(:creole))
520
659
  assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.text", creole.to_doc(:text))
521
660
  end #test_creole_links_external_implicit
661
+
662
+ #
663
+ #Bug 2009-10-14:
664
+ # <a href = "http:" >http:</a> <em >www.wikicreole.org/users/~example</em>
665
+ #If the very end of a text is a link, it is not detected correct
666
+ def test_creole_links_implicit_end()
667
+ creole = Creole.new(
668
+ :name => 'links_implicit_end',
669
+ :content => "http://www.wikicreole.org/users/~example"
670
+ )
671
+ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.html", creole.to_doc(:html))
672
+ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.latex", creole.to_doc(:latex))
673
+ #~ $log.warn('test_creole_links_implicit_end: to_context')
674
+ #~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.context", creole.to_doc(:context))
675
+ #~ $log.warn('test_creole_links_implicit_end: to wiki/creole')
676
+ #~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.creole", creole.to_doc(:creole))
677
+ #~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.text", creole.to_doc(:text))
678
+ end #test_creole_links_implicit_end
679
+
522
680
  def test_creole_links_explicit_with_em()
523
681
  creole = Creole.new(:content => <<creole
524
682
  Be careful that italic links are rendered properly: //[[http://my.book.example/|My Book Title]]//
@@ -526,20 +684,25 @@ creole
526
684
  )
527
685
  assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.html", creole.to_doc(:html))
528
686
  assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.latex", creole.to_doc(:latex))
687
+ $log.warn('test_creole_links_explicit_with_em: to_context')
688
+ #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.context", creole.to_doc(:context))
529
689
  $log.warn('test_creole_links_explicit_with_em: to wiki/creole')
530
690
  #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.creole", creole.to_doc(:creole))
531
691
  assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.text", creole.to_doc(:text))
532
692
  end #test_creole_links_explicit_with_em
533
693
 
534
694
  def test_creole_links_file()
695
+
535
696
  creole = Creole.new(:content => <<creole
536
- [[./#{__FILE__}]]
697
+ [[./#{$thisfile}]]
537
698
 
538
- [[./#{__FILE__}|This unittest-source]]
699
+ [[./#{$thisfile}|This unittest-source]]
539
700
  creole
540
701
  )
541
702
  assert_equal_filecontent( "expected_creole/test_creole_links_file.html", creole.to_doc(:html))
542
703
  assert_equal_filecontent( "expected_creole/test_creole_links_file.latex", creole.to_doc(:latex))
704
+ $log.warn('test_creole_links_file: to_context')
705
+ #~ assert_equal_filecontent( "expected_creole/test_creole_links_file.context", creole.to_doc(:context))
543
706
  $log.warn('test_creole_links_file: to wiki/creole')
544
707
  #~ assert_equal_filecontent( "expected_creole/test_creole_links_file.creole", creole.to_doc(:creole))
545
708
  assert_equal_filecontent( "expected_creole/test_creole_links_file.text", creole.to_doc(:text))
@@ -555,6 +718,8 @@ creole
555
718
  assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.html", creole.to_doc(:html))
556
719
  $log.warn('test_creole_links_explicit_internal: to latex')
557
720
  #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.latex", creole.to_doc(:latex))
721
+ $log.warn('test_creole_links_explicit_internal: to_context')
722
+ #~ #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.context", creole.to_doc(:context))
558
723
  $log.warn('test_creole_links_explicit_internal: to wiki/creole')
559
724
  #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.creole", creole.to_doc(:creole))
560
725
  assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.text", creole.to_doc(:text))
@@ -575,6 +740,8 @@ creole
575
740
  )
576
741
  assert_equal_filecontent( "expected_creole/test_creole_pictures.html", creole.to_doc(:html))
577
742
  assert_equal_filecontent( "expected_creole/test_creole_pictures.latex", creole.to_doc(:latex))
743
+ $log.warn('test_creole_pictures: to_context')
744
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures.context", creole.to_doc(:context))
578
745
  $log.warn('test_creole_pictures: to wiki/creole')
579
746
  #~ assert_equal_filecontent( "expected_creole/test_creole_pictures.creole", creole.to_doc(:creole))
580
747
  $log.warn('test_creole_pictures: to text/creole')
@@ -583,13 +750,15 @@ creole
583
750
  def test_creole_picture_link()
584
751
  creole = Creole.new(:name => 'Creole_picture_link',
585
752
  :content => <<creole
586
- [[./#{__FILE__}|{{Red_Flower.jpg}}]] - if you click on the image, will goto "some link"
753
+ [[./#{$thisfile}|{{Red_Flower.jpg}}]] - if you click on the image, will goto "some link"
587
754
 
588
755
  [[http://example.com/|{{Red_Flower.jpg}}]] - same as above: picture links to url
589
756
  creole
590
757
  )
591
758
  assert_equal_filecontent( "expected_creole/test_creole_picture_link.html", creole.to_doc(:html))
592
759
  #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.latex", creole.to_doc(:latex))
760
+ $log.warn('test_creole_picture_link: to_context')
761
+ #~ #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.context", creole.to_doc(:context))
593
762
  $log.warn('test_creole_picture_link: to wiki/creole')
594
763
  #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.creole", creole.to_doc(:creole))
595
764
  #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.text", creole.to_doc(:text))
@@ -599,11 +768,14 @@ creole
599
768
  :name => 'pictures_css',
600
769
  :content => <<creole
601
770
  {{Red_Flower.jpg|red flower|css=width:50px}}
771
+
602
772
  {{Red_Flower.jpg|red flower|imgcss=width:100px}}
603
773
  creole
604
774
  )
605
775
  assert_equal_filecontent( "expected_creole/test_creole_pictures_css.html", creole.to_doc(:html))
606
776
  assert_equal_filecontent( "expected_creole/test_creole_pictures_css.latex", creole.to_doc(:latex))
777
+ $log.warn('test_creole_pictures_css: to_context')
778
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.context", creole.to_doc(:context))
607
779
  $log.warn('test_creole_pictures_css: to wiki/creole')
608
780
  #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.creole", creole.to_doc(:creole))
609
781
  $log.warn('test_creole_pictures_css: to text/creole')
@@ -620,12 +792,48 @@ creole
620
792
  )
621
793
  assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.html", creole.to_doc(:html))
622
794
  assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.latex", creole.to_doc(:latex))
795
+ $log.warn('test_creole_pictures_imgclass: to_context')
796
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.context", creole.to_doc(:context))
623
797
  $log.warn('test_creole_pictures_imgclass: to wiki/creole')
624
798
  #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.creole", creole.to_doc(:creole))
625
799
  $log.warn('test_creole_pictures_imgclass: to text/creole')
626
800
  #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.text", creole.to_doc(:text))
627
801
  end #test_creole_pictures_imgclass
628
802
 
803
+ def test_creole_pictures_longdesc()
804
+ creole = Creole.new(
805
+ :name => 'pictures_longdesc',
806
+ :content => <<creole
807
+ {{Red_Flower.jpg||longdesc=http://www.pixelio.de/details.php?image_id=405788}}
808
+ creole
809
+ )
810
+ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.html", creole.to_doc(:html))
811
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.latex", creole.to_doc(:latex))
812
+ #~ $log.warn('test_creole_pictures_longdesc: to_context')
813
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.context", creole.to_doc(:context))
814
+ $log.warn('test_creole_pictures_longdesc: to wiki/creole')
815
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.creole", creole.to_doc(:creole))
816
+ $log.warn('test_creole_pictures_longdesc: to text/creole')
817
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.text", creole.to_doc(:text))
818
+ end #test_creole_pictures_longdesc
819
+
820
+ def test_creole_pictures_width()
821
+ creole = Creole.new(
822
+ :name => 'pictures_width',
823
+ :content => <<creole
824
+ {{Red_Flower.jpg||width=\\textwidth|css=width:100%}}
825
+ creole
826
+ )
827
+ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.html", creole.to_doc(:html))
828
+ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.latex", creole.to_doc(:latex))
829
+ #~ $log.warn('test_creole_pictures_width: to_context')
830
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.context", creole.to_doc(:context))
831
+ $log.warn('test_creole_pictures_width: to wiki/creole')
832
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.creole", creole.to_doc(:creole))
833
+ $log.warn('test_creole_pictures_width: to text/creole')
834
+ #~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.text", creole.to_doc(:text))
835
+ end #test_creole_pictures_width
836
+
629
837
  end #Test_creole_pictures
630
838
 
631
839
 
@@ -652,11 +860,13 @@ before
652
860
  }}}
653
861
  after
654
862
 
655
- See http://www.wikicreole.org/wiki/PreformattedAndNowiki
863
+ See [[http://www.wikicreole.org/wiki/PreformattedAndNowiki]]
656
864
  creole
657
865
  )
658
866
  assert_equal_filecontent( "expected_creole/test_creole_verbatim.html", creole.to_doc(:html))
659
867
  assert_equal_filecontent( "expected_creole/test_creole_verbatim.latex", creole.to_doc(:latex))
868
+ $log.warn('test_creole_verbatim: to_context')
869
+ #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim.context", creole.to_doc(:context))
660
870
  $log.warn('test_creole_verbatim: change < to &lt; ....')
661
871
  $log.warn('test_creole_verbatim: to wiki/creole')
662
872
  #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim.creole", creole.to_doc(:creole))
@@ -666,13 +876,15 @@ creole
666
876
  creole = Creole.new(:content => <<creole
667
877
 
668
878
  You can also use inline nowiki {{{ in a sentence }}} like this.
669
- See http://www.wikicreole.org/wiki/PreformattedAndNowiki
879
+ See [[http://www.wikicreole.org/wiki/PreformattedAndNowiki]].
670
880
 
671
881
  Some examples of markup are: {{{** <i>this</i> ** }}}
672
882
  creole
673
883
  )
674
884
  assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.html", creole.to_doc(:html))
675
885
  assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.latex", creole.to_doc(:latex))
886
+ $log.warn('test_creole_verbatim_inline: to_context')
887
+ #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.context", creole.to_doc(:context))
676
888
  $log.warn('test_creole_verbatim_inline: to wiki/creole')
677
889
  #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.creole", creole.to_doc(:creole))
678
890
  #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.text", creole.to_doc(:text))
@@ -689,6 +901,8 @@ creole
689
901
  )
690
902
  assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.html", creole.to_doc(:html))
691
903
  assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.latex", creole.to_doc(:latex))
904
+ $log.warn('test_creole_verbatim_inline_at_start: to_context')
905
+ #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.context", creole.to_doc(:context))
692
906
  $log.warn('test_creole_verbatim_inline_at_start: to wiki/creole')
693
907
  #~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.creole", creole.to_doc(:creole))
694
908
  $log.warn('test_creole_verbatim_inline_at_start: to text/creole')
@@ -729,6 +943,8 @@ creole
729
943
  #Really like this? Or should there be no paragraph?
730
944
  assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.html", creole.to_doc(:html))
731
945
  assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.latex", creole.to_doc(:latex))
946
+ $log.warn('test_creole_placeholders_html: to_context')
947
+ #~ assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.context", creole.to_doc(:context))
732
948
  $log.warn('test_creole_placeholders_html: to wiki/creole')
733
949
  #~ assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.creole", creole.to_doc(:creole))
734
950
  assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.text", creole.to_doc(:text))
@@ -745,6 +961,8 @@ creole
745
961
  #Really like this? Or should there be no paragraph?
746
962
  assert_equal_filecontent( "expected_creole/test_creole_placeholders_latex.html", creole.to_doc(:html))
747
963
  assert_equal_filecontent( "expected_creole/test_creole_placeholders_latex.latex", creole.to_doc(:latex))
964
+ $log.warn('test_creole_placeholders_latex: to_context')
965
+ #~ assert_equal_filecontent( "expected_creole/test_creole_placeholders_context.context", creole.to_doc(:context))
748
966
  $log.warn('test_creole_placeholders_latex: to wiki/creole')
749
967
  #~ assert_equal_filecontent( "expected_creole/test_creole_placeholders_latex.creole", creole.to_doc(:creole))
750
968
  assert_equal_filecontent( "expected_creole/test_creole_placeholders_latex.text", creole.to_doc(:text))
@@ -769,6 +987,8 @@ creole
769
987
  $log.warn('test_creole_tabular_creole: wiki syntax inside cell ')
770
988
  assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.html", creole.to_doc(:html))
771
989
  assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.latex", creole.to_doc(:latex))
990
+ $log.warn('test_creole_tabular_creole: to_context')
991
+ #~ assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.context", creole.to_doc(:context))
772
992
  $log.warn('test_creole_tabular_creole: to wiki/creole')
773
993
  #~ assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.creole", creole.to_doc(:creole))
774
994
  $log.warn('test_creole_tabular_creole: to text/creole')
@@ -798,11 +1018,45 @@ creole
798
1018
  )
799
1019
  assert_equal_filecontent( "expected_creole/test_creole_tabular.html", creole.to_doc(:html))
800
1020
  assert_equal_filecontent( "expected_creole/test_creole_tabular.latex", creole.to_doc(:latex))
1021
+ $log.warn('test_creole_tabular: to_context')
1022
+ #~ assert_equal_filecontent( "expected_creole/test_creole_tabular.context", creole.to_doc(:context))
801
1023
  $log.warn('test_creole_tabular: to wiki/creole')
802
1024
  #~ assert_equal_filecontent( "expected_creole/test_creole_tabular.creole", creole.to_doc(:creole))
803
1025
  $log.warn('test_creole_tabular: to text/creole')
804
1026
  #~ assert_equal_filecontent( "expected_creole/test_creole_tabular.text", creole.to_doc(:text))
805
1027
  end #test_creole_tabular
1028
+
1029
+ def test_creole_tabular_with_cell_option()
1030
+ # title...
1031
+ creole = Creole.new(:content => <<creole
1032
+ before
1033
+ <<<tabular
1034
+ |!columns=3
1035
+ |eins||css=color: red
1036
+ |css = zwei
1037
+ |||class=empty
1038
+ |-
1039
+ |normal
1040
+ |//italic//
1041
+ |//italic//||class=it
1042
+ |-
1043
+ |text with | nice! ||class = it
1044
+ |||css =
1045
+ |
1046
+ >>>
1047
+ after
1048
+ creole
1049
+ )
1050
+ assert_equal_filecontent( "expected_creole/test_creole_tabular_with_cell_option.html", creole.to_doc(:html))
1051
+ #~ assert_equal_filecontent( "expected_creole/test_creole_tabular_with_option.latex", creole.to_doc(:latex))
1052
+ $log.warn('test_creole_tabular: to_context')
1053
+ #~ assert_equal_filecontent( "expected_creole/test_creole_tabular.context", creole.to_doc(:context))
1054
+ $log.warn('test_creole_tabular: to wiki/creole')
1055
+ #~ assert_equal_filecontent( "expected_creole/test_creole_tabular.creole", creole.to_doc(:creole))
1056
+ $log.warn('test_creole_tabular: to text/creole')
1057
+ #~ assert_equal_filecontent( "expected_creole/test_creole_tabular.text", creole.to_doc(:text))
1058
+ end #test_creole_tabular
1059
+
806
1060
  def test_creole_tabular_css()
807
1061
  creole = Creole.new(:content => <<creole
808
1062
  before
@@ -828,6 +1082,8 @@ creole
828
1082
  )
829
1083
  assert_equal_filecontent( "expected_creole/test_creole_tabular_css.html", creole.to_doc(:html))
830
1084
  assert_equal_filecontent( "expected_creole/test_creole_tabular_css.latex", creole.to_doc(:latex))
1085
+ $log.warn('test_creole_tabular_css: to_context')
1086
+ #~ assert_equal_filecontent( "expected_creole/test_creole_tabular_css.context", creole.to_doc(:context))
831
1087
  $log.warn('test_creole_tabular_css: to wiki/creole')
832
1088
  #~ assert_equal_filecontent( "expected_creole/test_creole_tabular_css.creole", creole.to_doc(:creole))
833
1089
  $log.warn('test_creole_tabular_css: to text/creole')
@@ -847,6 +1103,8 @@ creole
847
1103
  )
848
1104
  assert_equal_filecontent( "expected_creole/test_creole_footnotes.html", creole.to_doc(:html))
849
1105
  assert_equal_filecontent( "expected_creole/test_creole_footnotes.latex", creole.to_doc(:latex))
1106
+ $log.warn('test_creole_footnotes: to_context')
1107
+ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.context", creole.to_doc(:context))
850
1108
  $log.warn('test_creole_footnotes: to wiki/creole')
851
1109
  #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.creole", creole.to_doc(:creole))
852
1110
  $log.warn('test_creole_footnotes: to text/creole')
@@ -864,22 +1122,75 @@ creole
864
1122
  )
865
1123
  assert_equal_filecontent( "expected_creole/test_creole_footnotes_label.html", creole.to_doc(:html))
866
1124
  #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_label.latex", creole.to_doc(:latex))
1125
+ $log.warn('test_creole_footnotes_label: to_context')
1126
+ #~ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_label.context", creole.to_doc(:context))
867
1127
  #~ $log.warn('test_creole_footnotes_label: to wiki/creole')
868
1128
  #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_label.creole", creole.to_doc(:creole))
869
1129
  #~ $log.warn('test_creole_footnotes_label: to text/creole')
870
1130
  #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_label.text", creole.to_doc(:text))
871
1131
  end #test_creole_footnotes_label
872
1132
 
1133
+ =begin rdoc
1134
+ Footnotes in tabulars don't work.
1135
+ =end
1136
+ def test_creole_footnotes_in_tabular()
1137
+ return
1138
+ #check for warning?
1139
+
1140
+ creole = Creole.new(
1141
+ :name => 'footnotes',
1142
+ :content => <<creole
1143
+ <<<tabular
1144
+ |!columns=1
1145
+ |<<footnote|This is a footnote>>
1146
+ >>>
1147
+ ----
1148
+ <<footnotes>>
1149
+ creole
1150
+ )
1151
+ $log.warn('test_creole_footnotes_in_tabular: html')
1152
+ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.html", creole.to_doc(:html))
1153
+ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.latex", creole.to_doc(:latex))
1154
+ #~ $log.warn('test_creole_footnotes_in_tabular: to_context')
1155
+ #~ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.context", creole.to_doc(:context))
1156
+ #~ $log.warn('test_creole_footnotes_in_tabular: to wiki/creole')
1157
+ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.creole", creole.to_doc(:creole))
1158
+ #~ $log.warn('test_creole_footnotes_in_tabular: to text/creole')
1159
+ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.text", creole.to_doc(:text))
1160
+ end #test_creole_footnotes_in_tabular
873
1161
  end #Test_creole_footnote
874
1162
 
1163
+ class Test_creole_short_html < Test::Unit::TestCase
1164
+ def test_creole_short_html()
1165
+ creole = Creole.new(:content => <<creole
1166
+ before
1167
+ {{html|<em>this is only for HTML</em>}}
1168
+ after
1169
+ creole
1170
+ )
1171
+ #Really like this? Or should there be no paragraph?
1172
+ assert_equal_filecontent( "expected_creole/test_creole_short_html.html", creole.to_doc(:html))
1173
+ assert_equal_filecontent( "expected_creole/test_creole_short_html.latex", creole.to_doc(:latex))
1174
+ $log.warn('test_creole_short_html: to_context')
1175
+ #~ assert_equal_filecontent( "expected_creole/test_creole_short_html.context", creole.to_doc(:context))
1176
+ $log.warn('test_creole_short_html: to wiki/creole')
1177
+ #~ assert_equal_filecontent( "expected_creole/test_creole_short_html.creole", creole.to_doc(:creole))
1178
+ assert_equal_filecontent( "expected_creole/test_creole_short_html.text", creole.to_doc(:text))
1179
+ end #test_creole_short_html
1180
+ end #Test_creole_short_html
1181
+
1182
+
875
1183
  class Test_creole_characters < Test::Unit::TestCase
876
1184
  def test_creole_characters_all()
877
1185
  creole = Creole.new(
878
1186
  :name => 'characters_all',
879
- :content => Creole::CHARACTERS.keys.map{|char| "*#{char}" }.join("\n")
1187
+ :content => Creole::CHARACTERS.keys.sort.map{|char| "*#{char}" }.join("\n")
880
1188
  )
1189
+ self.readoption = 'r:utf-8'
881
1190
  assert_equal_filecontent( "expected_creole/test_creole_characters_all.html", creole.to_doc(:html))
882
1191
  assert_equal_filecontent( "expected_creole/test_creole_characters_all.latex", creole.to_doc(:latex))
1192
+ $log.warn('test_creole_characters_all: to_context')
1193
+ #~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.context", creole.to_doc(:context))
883
1194
  $log.warn('test_creole_characters_all: to wiki/creole')
884
1195
  #~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.creole", creole.to_doc(:creole))
885
1196
  $log.warn('test_creole_characters_all: to text/creole')
@@ -899,12 +1210,32 @@ creole
899
1210
  )
900
1211
  assert_equal_filecontent( "expected_creole/test_creole_characters_special.html", creole.to_doc(:html))
901
1212
  assert_equal_filecontent( "expected_creole/test_creole_characters_special.latex", creole.to_doc(:latex))
1213
+ $log.warn('test_creole_characters_special: to_context')
1214
+ #~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.context", creole.to_doc(:context))
902
1215
  $log.warn('test_creole_characters_special: to wiki/creole')
903
1216
  #~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.creole", creole.to_doc(:creole))
904
1217
  $log.warn('test_creole_characters_special: to text/creole')
905
1218
  #~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.text", creole.to_doc(:text))
906
1219
  end #test_creole_characters_special
907
-
1220
+
1221
+ #This is also a test for multiple inclusions in one line.
1222
+ def test_creole_shy()
1223
+ creole = Creole.new(
1224
+ :name => 'shy',
1225
+ :content => <<creole
1226
+ Donau{{shy}}dampf{{shy}}schiff{{shy}}fahrt
1227
+
1228
+ Donau{{-}}dampf{{-}}schiff{{-}}fahrt
1229
+ creole
1230
+ )
1231
+ assert_equal_filecontent( "expected_creole/test_creole_shy.html", creole.to_doc(:html))
1232
+ assert_equal_filecontent( "expected_creole/test_creole_shy.latex", creole.to_doc(:latex))
1233
+ $log.warn('test_creole_shy: to_context')
1234
+ #~ assert_equal_filecontent( "expected_creole/test_creole_shy.context", creole.to_doc(:context))
1235
+ assert_equal_filecontent( "expected_creole/test_creole_shy.creole", creole.to_doc(:creole))
1236
+ assert_equal_filecontent( "expected_creole/test_creole_shy.text", creole.to_doc(:text))
1237
+ end #test_creole_shy
1238
+
908
1239
  end #Test_creole_characters
909
1240
 
910
1241
  class Test_creole_inline_ruby < Test::Unit::TestCase
@@ -923,6 +1254,8 @@ creole
923
1254
  )
924
1255
  assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.html", creole.to_doc(:html))
925
1256
  assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.latex", creole.to_doc(:latex))
1257
+ $log.warn('test_creole_inline_ruby_raw: to_context')
1258
+ #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.context", creole.to_doc(:context))
926
1259
  $log.warn('test_creole_inline_ruby_raw: to wiki/creole')
927
1260
  #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.creole", creole.to_doc(:creole))
928
1261
  $log.warn('test_creole_inline_ruby_raw: to text/creole')
@@ -939,6 +1272,8 @@ creole
939
1272
  )
940
1273
  assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.html", creole.to_doc(:html))
941
1274
  assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.latex", creole.to_doc(:latex))
1275
+ $log.warn('test_creole_inline_ruby: to_context')
1276
+ #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.context", creole.to_doc(:context))
942
1277
  $log.warn('test_creole_inline_ruby: to wiki/creole')
943
1278
  #~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.creole", creole.to_doc(:creole))
944
1279
  $log.warn('test_creole_inline_ruby: to text/creole')
@@ -953,6 +1288,8 @@ creole
953
1288
  )
954
1289
  assert_equal_filecontent( "expected_creole/test_creole_countdown.html", creole.to_doc(:html))
955
1290
  assert_equal_filecontent( "expected_creole/test_creole_countdown.latex", creole.to_doc(:latex))
1291
+ $log.warn('test_creole_countdown: to_context')
1292
+ #~ assert_equal_filecontent( "expected_creole/test_creole_countdown.context", creole.to_doc(:context))
956
1293
  $log.warn('test_creole_countdown: to wiki/creole')
957
1294
  #~ assert_equal_filecontent( "expected_creole/test_creole_countdown.creole", creole.to_doc(:creole))
958
1295
  $log.warn('test_creole_countdown: to text/creole')
@@ -961,6 +1298,51 @@ creole
961
1298
 
962
1299
  end #Test_creole_inline_ruby
963
1300
 
1301
+ class Test_creole_ignore < Test::Unit::TestCase
1302
+ def test_creole_ignore()
1303
+ creole = Creole.new(
1304
+ :name => 'ignore',
1305
+ :ignore => /^#~.*$/,
1306
+ :log => $tmplog, #catch info about comment
1307
+ :content => <<creole
1308
+ Text
1309
+ #~ this is a comment
1310
+ more text
1311
+ creole
1312
+ )
1313
+ assert_equal_filecontent( "expected_creole/test_creole_ignore.html", creole.to_doc(:html))
1314
+ assert_equal_filecontent( "expected_creole/test_creole_ignore.latex", creole.to_doc(:latex))
1315
+ $log.warn('test_creole_ignore: to_context')
1316
+ #~ assert_equal_filecontent( "expected_creole/test_creole_ignore.context", creole.to_doc(:context))
1317
+ $log.warn('test_creole_ignore: to wiki/creole')
1318
+ #~ assert_equal_filecontent( "expected_creole/test_creole_ignore.creole", creole.to_doc(:creole))
1319
+ assert_equal_filecontent( "expected_creole/test_creole_ignore.text", creole.to_doc(:text))
1320
+ end #test_creole_ignore
1321
+
1322
+ def test_creole_comment()
1323
+ creole = Creole.new(
1324
+ :name => 'comment',
1325
+ :content => <<creole
1326
+ ==Titel 1==
1327
+ Text
1328
+ <<<comment
1329
+ This is a comment.
1330
+ It's part of the document, but not visible to readers.
1331
+ >>>
1332
+ Text after
1333
+ creole
1334
+ )
1335
+ assert_equal_filecontent( "expected_creole/test_creole_comment.html", creole.to_doc(:html))
1336
+ assert_equal_filecontent( "expected_creole/test_creole_comment.latex", creole.to_doc(:latex))
1337
+ assert_equal_filecontent( "expected_creole/test_creole_comment.context", creole.to_doc(:context))
1338
+ assert_equal_filecontent( "expected_creole/test_creole_comment.creole", creole.to_doc(:creole))
1339
+ #~ assert_raise( RuntimeError ) { creole.to_doc(:text) }
1340
+ $log.warn('test_creole_comment: to text')
1341
+ #~ assert_equal_filecontent( "expected_creole/test_creole_comment.text", creole.to_doc(:text))
1342
+ end #test_creole_comment
1343
+
1344
+ end #Test_creole_ignore
1345
+
964
1346
 
965
1347
  def newtest(text, with_class = false )
966
1348
  code = ''
@@ -976,18 +1358,20 @@ creole
976
1358
  )
977
1359
  assert_equal_filecontent( "expected_creole/test_creole_#{text}.html", creole.to_doc(:html))
978
1360
  assert_equal_filecontent( "expected_creole/test_creole_#{text}.latex", creole.to_doc(:latex))
1361
+ $log.warn('test_creole_#{text}: to_context')
1362
+ #~ assert_equal_filecontent( "expected_creole/test_creole_#{text}.context", creole.to_doc(:context))
979
1363
  $log.warn('test_creole_#{text}: to wiki/creole')
980
- #~ assert_equal_filecontent( "expected_creole/test_creole_#{text}.creole", creole.to_doc(:creole))
1364
+ assert_equal_filecontent( "expected_creole/test_creole_#{text}.creole", creole.to_doc(:creole))
981
1365
  assert_equal_filecontent( "expected_creole/test_creole_#{text}.text", creole.to_doc(:text))
982
1366
  end #test_creole_#{text}
983
1367
  code
984
1368
  code << "end #Test_creole_#{text}\n" if with_class
985
1369
  puts code
986
1370
  end
987
- #~ newtest('links_explicit_internal')
1371
+ #~ newtest('links_implicit_end')
988
1372
  #~ newtest('tabular', true)
989
- #~ newtest('picture_link')
990
- #~ newtest('verb')
1373
+ #~ newtest('comment')
1374
+ #~ newtest('ignore', true)
991
1375
 
992
1376
 
993
1377
 
@@ -1014,10 +1398,14 @@ creole
1014
1398
  )
1015
1399
  assert_equal_filecontent( "expected_creole/test_creole_amazon.html", creole.to_doc(:html))
1016
1400
  assert_equal_filecontent( "expected_creole/test_creole_amazon.latex", creole.to_doc(:latex))
1401
+ $log.warn('test_creole_amazon: to_context')
1402
+ #~ assert_equal_filecontent( "expected_creole/test_creole_amazon.context", creole.to_doc(:context))
1017
1403
  assert_equal_filecontent( "expected_creole/test_creole_amazon.creole", creole.to_doc(:creole))
1018
1404
  assert_equal_filecontent( "expected_creole/test_creole_amazon.text", creole.to_doc(:text))
1019
1405
  end
1020
1406
 
1407
+ Option :ignore
1408
+
1021
1409
  ---------
1022
1410
  neue Ideen
1023
1411
  #~ {{{div:css=sss