patcito-maruku 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. data/AUTHORS +23 -0
  2. data/LICENSE +340 -0
  3. data/README.md +73 -0
  4. data/bin/maruku +196 -0
  5. data/bin/marutex +4 -0
  6. data/data/entities.xml +261 -0
  7. data/docs/changelog.md +334 -0
  8. data/docs/div_syntax.md +36 -0
  9. data/docs/entity_test.md +23 -0
  10. data/docs/markdown_syntax.md +899 -0
  11. data/docs/maruku.md +346 -0
  12. data/docs/math.md +194 -0
  13. data/docs/other_stuff.md +51 -0
  14. data/docs/proposal.md +309 -0
  15. data/docs/website/src/bluecloth.md +25 -0
  16. data/docs/website/src/download.md +31 -0
  17. data/docs/website/src/maruku.md +261 -0
  18. data/docs/website/src/proposal.md +271 -0
  19. data/lib/maruku.rb +132 -0
  20. data/lib/maruku/attributes.rb +138 -0
  21. data/lib/maruku/defaults.rb +69 -0
  22. data/lib/maruku/errors.rb +89 -0
  23. data/lib/maruku/ext/div.rb +121 -0
  24. data/lib/maruku/ext/fenced_code.rb +78 -0
  25. data/lib/maruku/ext/math.rb +37 -0
  26. data/lib/maruku/ext/math/elements.rb +21 -0
  27. data/lib/maruku/ext/math/latex_fix.rb +12 -0
  28. data/lib/maruku/ext/math/mathml_engines/blahtex.rb +93 -0
  29. data/lib/maruku/ext/math/mathml_engines/itex2mml.rb +39 -0
  30. data/lib/maruku/ext/math/mathml_engines/none.rb +21 -0
  31. data/lib/maruku/ext/math/mathml_engines/ritex.rb +24 -0
  32. data/lib/maruku/ext/math/parsing.rb +125 -0
  33. data/lib/maruku/ext/math/to_html.rb +237 -0
  34. data/lib/maruku/ext/math/to_latex.rb +36 -0
  35. data/lib/maruku/ext/yaml.rb +43 -0
  36. data/lib/maruku/helpers.rb +214 -0
  37. data/lib/maruku/input/charsource.rb +326 -0
  38. data/lib/maruku/input/extensions.rb +69 -0
  39. data/lib/maruku/input/html_helper.rb +189 -0
  40. data/lib/maruku/input/linesource.rb +111 -0
  41. data/lib/maruku/input/parse_block.rb +608 -0
  42. data/lib/maruku/input/parse_doc.rb +240 -0
  43. data/lib/maruku/input/parse_span_better.rb +746 -0
  44. data/lib/maruku/input/rubypants.rb +225 -0
  45. data/lib/maruku/input/type_detection.rb +147 -0
  46. data/lib/maruku/input_textile2/t2_parser.rb +163 -0
  47. data/lib/maruku/maruku.rb +31 -0
  48. data/lib/maruku/output/s5/fancy.rb +756 -0
  49. data/lib/maruku/output/s5/to_s5.rb +138 -0
  50. data/lib/maruku/output/to_html.rb +994 -0
  51. data/lib/maruku/output/to_latex.rb +580 -0
  52. data/lib/maruku/output/to_latex_entities.rb +101 -0
  53. data/lib/maruku/output/to_latex_strings.rb +64 -0
  54. data/lib/maruku/output/to_markdown.rb +164 -0
  55. data/lib/maruku/output/to_s.rb +54 -0
  56. data/lib/maruku/string_utils.rb +185 -0
  57. data/lib/maruku/structures.rb +143 -0
  58. data/lib/maruku/structures_inspect.rb +51 -0
  59. data/lib/maruku/structures_iterators.rb +48 -0
  60. data/lib/maruku/textile2.rb +1 -0
  61. data/lib/maruku/toc.rb +214 -0
  62. data/lib/maruku/usage/example1.rb +33 -0
  63. data/lib/maruku/version +0 -0
  64. data/lib/maruku/version.rb +54 -0
  65. data/spec/block_docs/abbreviations.md +52 -0
  66. data/spec/block_docs/alt.md +17 -0
  67. data/spec/block_docs/attributes/att2.md +20 -0
  68. data/spec/block_docs/attributes/att3.md +28 -0
  69. data/spec/block_docs/attributes/attributes.md +57 -0
  70. data/spec/block_docs/attributes/circular.md +26 -0
  71. data/spec/block_docs/attributes/default.md +22 -0
  72. data/spec/block_docs/blank.md +24 -0
  73. data/spec/block_docs/blanks_in_code.md +75 -0
  74. data/spec/block_docs/bug_def.md +16 -0
  75. data/spec/block_docs/bug_table.md +46 -0
  76. data/spec/block_docs/code.md +34 -0
  77. data/spec/block_docs/code2.md +28 -0
  78. data/spec/block_docs/code3.md +71 -0
  79. data/spec/block_docs/data_loss.md +25 -0
  80. data/spec/block_docs/divs/div1.md +167 -0
  81. data/spec/block_docs/divs/div2.md +21 -0
  82. data/spec/block_docs/divs/div3_nest.md +45 -0
  83. data/spec/block_docs/easy.md +15 -0
  84. data/spec/block_docs/email.md +20 -0
  85. data/spec/block_docs/encoding/iso-8859-1.md +23 -0
  86. data/spec/block_docs/encoding/utf-8.md +18 -0
  87. data/spec/block_docs/entities.md +94 -0
  88. data/spec/block_docs/escaping.md +67 -0
  89. data/spec/block_docs/extra_dl.md +52 -0
  90. data/spec/block_docs/extra_header_id.md +63 -0
  91. data/spec/block_docs/extra_table1.md +37 -0
  92. data/spec/block_docs/footnotes.md +97 -0
  93. data/spec/block_docs/headers.md +37 -0
  94. data/spec/block_docs/hex_entities.md +37 -0
  95. data/spec/block_docs/hrule.md +39 -0
  96. data/spec/block_docs/html2.md +22 -0
  97. data/spec/block_docs/html3.md +31 -0
  98. data/spec/block_docs/html4.md +25 -0
  99. data/spec/block_docs/html5.md +23 -0
  100. data/spec/block_docs/ie.md +49 -0
  101. data/spec/block_docs/images.md +90 -0
  102. data/spec/block_docs/images2.md +31 -0
  103. data/spec/block_docs/inline_html.md +152 -0
  104. data/spec/block_docs/inline_html2.md +21 -0
  105. data/spec/block_docs/links.md +152 -0
  106. data/spec/block_docs/links2.md +22 -0
  107. data/spec/block_docs/list1.md +46 -0
  108. data/spec/block_docs/list12.md +28 -0
  109. data/spec/block_docs/list2.md +56 -0
  110. data/spec/block_docs/list3.md +64 -0
  111. data/spec/block_docs/list4.md +89 -0
  112. data/spec/block_docs/lists.md +192 -0
  113. data/spec/block_docs/lists10.md +34 -0
  114. data/spec/block_docs/lists11.md +23 -0
  115. data/spec/block_docs/lists6.md +41 -0
  116. data/spec/block_docs/lists9.md +64 -0
  117. data/spec/block_docs/lists_after_paragraph.md +208 -0
  118. data/spec/block_docs/lists_ol.md +262 -0
  119. data/spec/block_docs/loss.md +16 -0
  120. data/spec/block_docs/math/equations.md +45 -0
  121. data/spec/block_docs/math/inline.md +46 -0
  122. data/spec/block_docs/math/math2.md +45 -0
  123. data/spec/block_docs/math/notmath.md +25 -0
  124. data/spec/block_docs/math/table.md +25 -0
  125. data/spec/block_docs/math/table2.md +42 -0
  126. data/spec/block_docs/misc_sw.md +525 -0
  127. data/spec/block_docs/notyet/escape.md +21 -0
  128. data/spec/block_docs/notyet/header_after_par.md +58 -0
  129. data/spec/block_docs/notyet/ticks.md +18 -0
  130. data/spec/block_docs/notyet/triggering.md +157 -0
  131. data/spec/block_docs/olist.md +45 -0
  132. data/spec/block_docs/one.md +15 -0
  133. data/spec/block_docs/paragraph.md +16 -0
  134. data/spec/block_docs/paragraph_rules/dont_merge_ref.md +42 -0
  135. data/spec/block_docs/paragraph_rules/tab_is_blank.md +24 -0
  136. data/spec/block_docs/paragraphs.md +46 -0
  137. data/spec/block_docs/pending/amps.md +15 -0
  138. data/spec/block_docs/pending/empty_cells.md +37 -0
  139. data/spec/block_docs/pending/link.md +72 -0
  140. data/spec/block_docs/pending/ref.md +21 -0
  141. data/spec/block_docs/recover/recover_links.md +15 -0
  142. data/spec/block_docs/red_tests/abbrev.md +679 -0
  143. data/spec/block_docs/red_tests/lists7.md +32 -0
  144. data/spec/block_docs/red_tests/lists7b.md +65 -0
  145. data/spec/block_docs/red_tests/lists8.md +42 -0
  146. data/spec/block_docs/red_tests/ref.md +23 -0
  147. data/spec/block_docs/red_tests/xml.md +35 -0
  148. data/spec/block_docs/references/long_example.md +71 -0
  149. data/spec/block_docs/references/spaces_and_numbers.md +15 -0
  150. data/spec/block_docs/smartypants.md +114 -0
  151. data/spec/block_docs/syntax_hl.md +52 -0
  152. data/spec/block_docs/table_attributes.md +34 -0
  153. data/spec/block_docs/test.md +19 -0
  154. data/spec/block_docs/underscore_in_words.md +15 -0
  155. data/spec/block_docs/wrapping.md +67 -0
  156. data/spec/block_docs/xml2.md +19 -0
  157. data/spec/block_docs/xml3.md +26 -0
  158. data/spec/block_docs/xml_instruction.md +52 -0
  159. data/spec/block_spec.rb +49 -0
  160. data/spec/span_spec.rb +254 -0
  161. data/spec/spec_helper.rb +6 -0
  162. metadata +247 -0
@@ -0,0 +1,34 @@
1
+ Comment
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+ Here is an example of AppleScript:
6
+
7
+ tell application "Foo"
8
+ beep
9
+ end tell
10
+ tab
11
+
12
+ *** Output of inspect ***
13
+ md_el(:document,[
14
+ md_par(["Here is an example of AppleScript:"]),
15
+ md_el(:code,[],{:raw_code=>"tell application \"Foo\"\n beep\nend tell\n\ttab"},[])
16
+ ],{},[])
17
+ *** Output of to_html ***
18
+ <p>Here is an example of AppleScript:</p>
19
+
20
+ <pre><code>tell application &quot;Foo&quot;
21
+ beep
22
+ end tell
23
+ tab</code></pre>
24
+ *** Output of to_latex ***
25
+ Here is an example of AppleScript:
26
+
27
+ \begin{verbatim}tell application "Foo"
28
+ beep
29
+ end tell
30
+ tab\end{verbatim}
31
+ *** Output of to_md ***
32
+ Here is an example of AppleScript:
33
+ *** Output of to_s ***
34
+ Here is an example of AppleScript:
@@ -0,0 +1,28 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+ > Code
6
+ >
7
+ > Ciao
8
+ *** Output of inspect ***
9
+ md_el(:document,[
10
+ md_el(:quote,[md_par(["Code"]), md_el(:code,[],{:raw_code=>"Ciao"},[])],{},[])
11
+ ],{},[])
12
+ *** Output of to_html ***
13
+ <blockquote>
14
+ <p>Code</p>
15
+
16
+ <pre><code>Ciao</code></pre>
17
+ </blockquote>
18
+ *** Output of to_latex ***
19
+ \begin{quote}%
20
+ Code
21
+
22
+ \begin{verbatim}Ciao\end{verbatim}
23
+
24
+ \end{quote}
25
+ *** Output of to_md ***
26
+ Code
27
+ *** Output of to_s ***
28
+ Code
@@ -0,0 +1,71 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+
6
+ This is code (4 spaces):
7
+
8
+ Code
9
+ This is not code
10
+
11
+ Code
12
+
13
+ This is code (1 tab):
14
+
15
+ Code
16
+ This is not code
17
+
18
+ Code
19
+
20
+
21
+
22
+ *** Output of inspect ***
23
+ md_el(:document,[
24
+ md_par(["This is code (4 spaces):"]),
25
+ md_el(:code,[],{:raw_code=>"Code"},[]),
26
+ md_par(["This is not code"]),
27
+ md_el(:code,[],{:raw_code=>"Code"},[]),
28
+ md_par(["This is code (1 tab):"]),
29
+ md_el(:code,[],{:raw_code=>"Code"},[]),
30
+ md_par(["This is not code"]),
31
+ md_el(:code,[],{:raw_code=>"Code"},[])
32
+ ],{},[])
33
+ *** Output of to_html ***
34
+ <p>This is code (4 spaces):</p>
35
+
36
+ <pre><code>Code</code></pre>
37
+
38
+ <p>This is not code</p>
39
+
40
+ <pre><code>Code</code></pre>
41
+
42
+ <p>This is code (1 tab):</p>
43
+
44
+ <pre><code>Code</code></pre>
45
+
46
+ <p>This is not code</p>
47
+
48
+ <pre><code>Code</code></pre>
49
+ *** Output of to_latex ***
50
+ This is code (4 spaces):
51
+
52
+ \begin{verbatim}Code\end{verbatim}
53
+ This is not code
54
+
55
+ \begin{verbatim}Code\end{verbatim}
56
+ This is code (1 tab):
57
+
58
+ \begin{verbatim}Code\end{verbatim}
59
+ This is not code
60
+
61
+ \begin{verbatim}Code\end{verbatim}
62
+ *** Output of to_md ***
63
+ This is code (4 spaces):
64
+
65
+ This is not code
66
+
67
+ This is code (1 tab):
68
+
69
+ This is not code
70
+ *** Output of to_s ***
71
+ This is code (4 spaces):This is not codeThis is code (1 tab):This is not code
@@ -0,0 +1,25 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ {} # params
4
+ *** Markdown input: ***
5
+ 1. abcd
6
+ efgh
7
+ ijkl
8
+
9
+ *** Output of inspect ***
10
+ md_el(:document,[
11
+ md_el(:ol,[md_el(:li_span,["abcd efgh ijkl"],{:want_my_paragraph=>false},[])],{},[])
12
+ ],{},[])
13
+ *** Output of to_html ***
14
+ <ol>
15
+ <li>abcd efgh ijkl</li>
16
+ </ol>
17
+ *** Output of to_latex ***
18
+ \begin{enumerate}%
19
+ \item abcd efgh ijkl
20
+
21
+ \end{enumerate}
22
+ *** Output of to_md ***
23
+ 1. abcd efgh ijkl
24
+ *** Output of to_s ***
25
+ abcd efgh ijkl
@@ -0,0 +1,167 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ require 'maruku/ext/div'; {} # params
4
+ *** Markdown input: ***
5
+ +---------
6
+ | text
7
+ +----------
8
+
9
+ +---------
10
+ |text
11
+
12
+ +--
13
+ text
14
+
15
+ =--
16
+
17
+
18
+ +---------
19
+ | text
20
+ +----------
21
+
22
+ +---------
23
+ |text
24
+
25
+ +--
26
+ text
27
+
28
+ =--
29
+
30
+
31
+ +---------
32
+ | text
33
+ +----------
34
+
35
+ +---------
36
+ |text
37
+
38
+ +--
39
+ text
40
+
41
+ =--
42
+
43
+ +---------
44
+ | text
45
+ +----------
46
+
47
+ +---------
48
+ |text
49
+
50
+ +--
51
+ text
52
+
53
+ =--
54
+
55
+ *** Output of inspect ***
56
+ md_el(:document,[
57
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
58
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
59
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
60
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
61
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
62
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
63
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
64
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
65
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
66
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
67
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[]),
68
+ md_el(:div,[md_par(["text"])],{:label=>nil,:num=>nil,:type=>nil},[])
69
+ ],{},[])
70
+ *** Output of to_html ***
71
+ <div>
72
+ <p>text</p>
73
+ </div>
74
+
75
+ <div>
76
+ <p>text</p>
77
+ </div>
78
+
79
+ <div>
80
+ <p>text</p>
81
+ </div>
82
+
83
+ <div>
84
+ <p>text</p>
85
+ </div>
86
+
87
+ <div>
88
+ <p>text</p>
89
+ </div>
90
+
91
+ <div>
92
+ <p>text</p>
93
+ </div>
94
+
95
+ <div>
96
+ <p>text</p>
97
+ </div>
98
+
99
+ <div>
100
+ <p>text</p>
101
+ </div>
102
+
103
+ <div>
104
+ <p>text</p>
105
+ </div>
106
+
107
+ <div>
108
+ <p>text</p>
109
+ </div>
110
+
111
+ <div>
112
+ <p>text</p>
113
+ </div>
114
+
115
+ <div>
116
+ <p>text</p>
117
+ </div>
118
+ *** Output of to_latex ***
119
+ text
120
+
121
+ text
122
+
123
+ text
124
+
125
+ text
126
+
127
+ text
128
+
129
+ text
130
+
131
+ text
132
+
133
+ text
134
+
135
+ text
136
+
137
+ text
138
+
139
+ text
140
+
141
+ text
142
+ *** Output of to_md ***
143
+ text
144
+
145
+ text
146
+
147
+ text
148
+
149
+ text
150
+
151
+ text
152
+
153
+ text
154
+
155
+ text
156
+
157
+ text
158
+
159
+ text
160
+
161
+ text
162
+
163
+ text
164
+
165
+ text
166
+ *** Output of to_s ***
167
+ texttexttexttexttexttexttexttexttexttexttexttext
@@ -0,0 +1,21 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ require 'maruku/ext/div'; {} # params
4
+ *** Markdown input: ***
5
+ +--
6
+ ciao
7
+ =--
8
+ *** Output of inspect ***
9
+ md_el(:document,[
10
+ md_el(:div,[md_par(["ciao"])],{:label=>nil,:num=>nil,:type=>nil},[])
11
+ ],{},[])
12
+ *** Output of to_html ***
13
+ <div>
14
+ <p>ciao</p>
15
+ </div>
16
+ *** Output of to_latex ***
17
+ ciao
18
+ *** Output of to_md ***
19
+ ciao
20
+ *** Output of to_s ***
21
+ ciao
@@ -0,0 +1,45 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ require 'maruku/ext/div'; {} # params
4
+ *** Markdown input: ***
5
+ +-----------------------------------{.warning}------
6
+ | this is the last warning!
7
+ |
8
+ | please, go away!
9
+ |
10
+ | +------------------------------------- {.menace} --
11
+ | | or else terrible things will happen
12
+ | +--------------------------------------------------
13
+ +---------------------------------------------------
14
+ *** Output of inspect ***
15
+ md_el(:document,[
16
+ md_el(:div,[
17
+ md_par(["this is the last warning!"]),
18
+ md_par(["please, go away!"]),
19
+ md_el(:div,[md_par(["or else terrible things will happen"])],{:label=>nil,:num=>nil,:type=>nil},[[:class, "menace"]])
20
+ ],{:label=>nil,:num=>nil,:type=>nil},[[:class, "warning"]])
21
+ ],{},[])
22
+ *** Output of to_html ***
23
+ <div class='warning'>
24
+ <p>this is the last warning!</p>
25
+
26
+ <p>please, go away!</p>
27
+
28
+ <div class='menace'>
29
+ <p>or else terrible things will happen</p>
30
+ </div>
31
+ </div>
32
+ *** Output of to_latex ***
33
+ this is the last warning!
34
+
35
+ please, go away!
36
+
37
+ or else terrible things will happen
38
+ *** Output of to_md ***
39
+ this is the last warning!
40
+
41
+ please, go away!
42
+
43
+ or else terrible things will happen
44
+ *** Output of to_s ***
45
+ this is the last warning!please, go away!or else terrible things will happen
@@ -0,0 +1,15 @@
1
+ Simple test for emphasis.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+ *Hello!* how are **you**?
6
+ *** Output of inspect ***
7
+ md_el(:document,[md_par([md_em(["Hello!"]), " how are ", md_strong(["you"]), "?"])],{},[])
8
+ *** Output of to_html ***
9
+ <p><em>Hello!</em> how are <strong>you</strong>?</p>
10
+ *** Output of to_latex ***
11
+ \emph{Hello!} how are \textbf{you}?
12
+ *** Output of to_md ***
13
+ Hello!how are you?
14
+ *** Output of to_s ***
15
+ Hello! how are you?
@@ -0,0 +1,20 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+
6
+
7
+ This is an email address: <andrea@invalid.it>
8
+
9
+ *** Output of inspect ***
10
+ md_el(:document,[
11
+ md_par(["This is an email address: ", md_email("andrea@invalid.it")])
12
+ ],{},[])
13
+ *** Output of to_html ***
14
+ <p>This is an email address: <a href='mailto:andrea@invalid.it'>&#097;&#110;&#100;&#114;&#101;&#097;&#064;&#105;&#110;&#118;&#097;&#108;&#105;&#100;&#046;&#105;&#116;</a></p>
15
+ *** Output of to_latex ***
16
+ This is an email address: \href{mailto:andrea@invalid.it}{andrea\char64invalid\char46it}
17
+ *** Output of to_md ***
18
+ This is an email address:
19
+ *** Output of to_s ***
20
+ This is an email address:
@@ -0,0 +1,23 @@
1
+ Encoding: iso-8859-1
2
+
3
+ *** Parameters: ***
4
+ {}
5
+ *** Markdown input: ***
6
+ Encoding: iso-8859-1
7
+
8
+ This is iso-8859-1: àèìàù.
9
+ *** Output of inspect ***
10
+ md_el(:document,[
11
+ md_par([
12
+ "This is iso-8859-1: \303\203\302\240\303\203\302\250\303\203\302\254\303\203\302\240\303\203\302\271."
13
+ ])
14
+ ],{},[])
15
+ *** Output of to_html ***
16
+ <p>This is iso-8859-1: àèìàù.</p>
17
+ *** Output of to_latex ***
18
+ This is iso-8859-1: àèìàù.
19
+ *** Output of to_md ***
20
+ This is iso-8859-1:
21
+ àèìàù.
22
+ *** Output of to_s ***
23
+ This is iso-8859-1: àèìàù.