maruku 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/bin/maruku +74 -22
  2. data/bin/marutest +15 -3
  3. data/docs/{changelog-0.3.md → changelog.md} +47 -18
  4. data/docs/entity_test.html +253 -0
  5. data/docs/entity_test.md +21 -0
  6. data/docs/index.html +124 -31
  7. data/docs/markdown_syntax.html +46 -46
  8. data/docs/maruku.html +124 -31
  9. data/docs/maruku.md +47 -9
  10. data/docs/proposal.html +4 -4
  11. data/lib/maruku.rb +1 -0
  12. data/lib/maruku/defaults.rb +1 -1
  13. data/lib/maruku/helpers.rb +4 -4
  14. data/lib/maruku/input/parse_block.rb +39 -33
  15. data/lib/maruku/input/parse_doc.rb +57 -3
  16. data/lib/maruku/input/parse_span_better.rb +28 -8
  17. data/lib/maruku/input/rubypants.rb +225 -0
  18. data/lib/maruku/input/type_detection.rb +1 -0
  19. data/lib/maruku/output/to_html.rb +46 -47
  20. data/lib/maruku/output/to_latex.rb +166 -45
  21. data/lib/maruku/output/to_latex_entities.rb +75 -43
  22. data/lib/maruku/string_utils.rb +21 -19
  23. data/lib/maruku/structures.rb +21 -12
  24. data/lib/maruku/structures_inspect.rb +12 -3
  25. data/lib/maruku/tests/new_parser.rb +2 -1
  26. data/lib/maruku/version.rb +1 -1
  27. data/tests/unittest/abbreviations.md +8 -8
  28. data/tests/unittest/attributes/attributes.md +10 -10
  29. data/tests/unittest/attributes/circular.md +4 -4
  30. data/tests/unittest/attributes/default.md +3 -3
  31. data/tests/unittest/blank.md +2 -2
  32. data/tests/unittest/blanks_in_code.md +12 -12
  33. data/tests/unittest/code.md +4 -4
  34. data/tests/unittest/code2.md +7 -6
  35. data/tests/unittest/code3.md +16 -16
  36. data/tests/unittest/easy.md +4 -4
  37. data/tests/unittest/email.md +4 -4
  38. data/tests/unittest/encoding/iso-8859-1.md +2 -2
  39. data/tests/unittest/encoding/utf-8.md +2 -2
  40. data/tests/unittest/entities.md +20 -20
  41. data/tests/unittest/escaping.md +16 -16
  42. data/tests/unittest/extra_dl.md +17 -7
  43. data/tests/unittest/extra_header_id.md +11 -11
  44. data/tests/unittest/extra_table1.md +4 -4
  45. data/tests/unittest/footnotes.md +38 -28
  46. data/tests/unittest/headers.md +6 -6
  47. data/tests/unittest/hrule.md +6 -6
  48. data/tests/unittest/images.md +18 -16
  49. data/tests/unittest/inline_html.md +7 -29
  50. data/tests/unittest/inline_html2.md +3 -3
  51. data/tests/unittest/links.md +7 -27
  52. data/tests/unittest/list1.md +9 -8
  53. data/tests/unittest/list2.md +15 -12
  54. data/tests/unittest/list3.md +16 -14
  55. data/tests/unittest/list4.md +4 -4
  56. data/tests/unittest/lists.md +33 -29
  57. data/tests/unittest/lists_after_paragraph.md +36 -36
  58. data/tests/unittest/lists_ol.md +43 -38
  59. data/tests/unittest/misc_sw.md +172 -156
  60. data/tests/unittest/notyet/escape.md +8 -8
  61. data/tests/unittest/notyet/header_after_par.md +6 -6
  62. data/tests/unittest/notyet/ticks.md +4 -4
  63. data/tests/unittest/notyet/triggering.md +21 -21
  64. data/tests/unittest/olist.md +5 -5
  65. data/tests/unittest/one.md +1 -1
  66. data/tests/unittest/paragraph.md +1 -1
  67. data/tests/unittest/paragraph_rules/dont_merge_ref.md +1 -1
  68. data/tests/unittest/paragraph_rules/tab_is_blank.md +2 -2
  69. data/tests/unittest/paragraphs.md +5 -5
  70. data/tests/unittest/recover/recover_links.md +2 -2
  71. data/tests/unittest/references/long_example.md +27 -19
  72. data/tests/unittest/smartypants.md +148 -0
  73. data/tests/unittest/syntax_hl.md +14 -14
  74. data/tests/unittest/test.md +2 -2
  75. data/tests/unittest/wrapping.md +8 -8
  76. data/tests/unittest/xml_instruction.md +82 -0
  77. metadata +149 -160
  78. data/docs/TOFIX.html +0 -22
  79. data/docs/TOFIX.md +0 -3
  80. data/docs/changelog-0.2.13.html +0 -30
  81. data/docs/changelog-0.2.13.md +0 -6
  82. data/docs/changelog-0.3.html +0 -113
  83. data/docs/faq.html +0 -57
  84. data/docs/faq.md +0 -32
  85. data/docs/hidden_o_n_squared.md +0 -10
  86. data/docs/todo.html +0 -40
  87. data/docs/todo.md +0 -9
data/docs/TOFIX.html DELETED
@@ -1,22 +0,0 @@
1
- <?xml version='1.0' encoding='utf-8'?>
2
- <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
5
- <head><meta content='text/html; charset=utf-8' http-equiv='Content-type' />
6
- <title></title>
7
- </head>
8
- <body>
9
- <ul>
10
- <li>id degli header</li>
11
- </ul>
12
-
13
- <div class='footnotes'>
14
- <hr />
15
-
16
- <ol />
17
- </div>
18
-
19
- <div class='maruku_signature'>
20
- <hr />
21
- <span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a> at 20:36 on Friday, January 05th, 2007.</span></div>
22
- </body></html>
data/docs/TOFIX.md DELETED
@@ -1,3 +0,0 @@
1
-
2
- - id degli header
3
-
@@ -1,30 +0,0 @@
1
- <?xml version='1.0' encoding='utf-8'?>
2
- <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
5
- <head><meta content='text/html; charset=utf-8' http-equiv='Content-type' />
6
- <title></title>
7
- </head>
8
- <body>
9
- <p>Maruku Version 0.2.13:</p>
10
-
11
- <ul>
12
- <li>better handling of inline HTML code.</li>
13
-
14
- <li>Handle HTML comments.</li>
15
-
16
- <li>Sanitizes HR and IMG tags if you don&apos;t close them.</li>
17
-
18
- <li>documentation included in HTML format</li>
19
- </ul>
20
-
21
- <div class='footnotes'>
22
- <hr />
23
-
24
- <ol />
25
- </div>
26
-
27
- <div class='maruku_signature'>
28
- <hr />
29
- <span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a> at 20:36 on Friday, January 05th, 2007.</span></div>
30
- </body></html>
@@ -1,6 +0,0 @@
1
- Maruku Version 0.2.13:
2
-
3
- - better handling of inline HTML code.
4
- - Handle HTML comments.
5
- - Sanitizes HR and IMG tags if you don't close them.
6
- - documentation included in HTML format
@@ -1,113 +0,0 @@
1
- <?xml version='1.0' encoding='utf-8'?>
2
- <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
5
- <head><meta content='text/html; charset=utf-8' http-equiv='Content-type' />
6
- <title></title>
7
-
8
- <link href='style.css' rel='stylesheet' type='text/css' />
9
- </head>
10
- <body>
11
- <h2 id='release_notes__version_030_january_3rd_2007'>Release notes - version 0.3.0 (January 3rd, 2007)<!--{:id=>"release_notes__version_030_january_3rd_2007"}--></h2>
12
-
13
- <p>Note: Maruku seems to be very robust, nevertheless it is still beta-level software. So if you want to use it in production environments, please check back in a month or so, while we squash the remaining bugs.</p>
14
-
15
- <p>In the meantime, feel free to toy around, and please signal problems, request features, by <a href='http://www.dis.uniroma1.it/~acensi/contact.html'>contacting me</a> or using the <a href='http://rubyforge.org/tracker/?group_id=2795'>tracker</a>. For issues about the Markdown syntax itself and improvements to it, please write to the <a href='http://six.pairlist.net/mailman/listinfo/markdown-discuss'>Markdown-discuss mailing list</a>.</p>
16
-
17
- <p>Have fun!</p>
18
-
19
- <p>Changes in 0.3.0:</p>
20
-
21
- <ul>
22
- <li>
23
- <p>A real parser is used instead of a regexp-based system, also for span-level elements..</p>
24
-
25
- <p>Now Maruku is almost 2x faster than Bluecloth, while having more features.</p>
26
-
27
- <p>Here are some benchmarks:</p>
28
-
29
- <pre><code>BlueCloth (to_html): parsing 0.00 sec + rendering 1.54 sec = 1.55 sec
30
- Maruku (to_html): parsing 0.47 sec + rendering 0.38 sec = 0.85 sec
31
- Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pre>
32
-
33
- <p>This is the result of running <code>lib/maruku/tests/benchmark.rb</code> on the Markdown specification.</p>
34
- </li>
35
-
36
- <li>
37
- <p>Prettier HTML output by adding whitespace.</p>
38
- </li>
39
-
40
- <li>
41
- <p>Added a full suite of unit-tests for the span-level parser.</p>
42
- </li>
43
-
44
- <li>
45
- <p>Error management: Having a real parser, Maruku warns you about syntax issues.</p>
46
-
47
- <p>The default action is to warn and try to continue. If you do this:</p>
48
-
49
- <pre><code>Maruku.new(string, {:on_error =&gt; :raise})
50
- </code></pre>
51
-
52
- <p>then syntax errors will cause an exception to be raised (you can catch this and retry).</p>
53
- </li>
54
-
55
- <li>
56
- <p>Fixed a series of bugs in handling inline HTML code.</p>
57
- </li>
58
- </ul>
59
-
60
- <p>Immediate TODO-list:</p>
61
-
62
- <ul>
63
- <li>
64
- <p>UTF-8 input/output works OK for HTML, however I am having pain trying to export to LaTeX. I want at least Japanese characters support, so if you know how to do this you are very welcome to give me an hand.</p>
65
-
66
- <p>For example: in the HTML version, you should see accented characters in this parenthesis:</p>
67
-
68
- <blockquote>
69
- <p>(àèìòù)</p>
70
- </blockquote>
71
-
72
- <p>and Japanese text in these other parentheses:</p>
73
-
74
- <blockquote>
75
- <p>(カタカナで 私の 名前は アンドレア チェンシ です).</p>
76
-
77
- <p>(日本のガルは 大好き、でも、日本語は難しですから、そうぞ 英語話すガルを おしえてください).</p>
78
- </blockquote>
79
-
80
- <p>In the LaTeX version, these do not appear. I know how to do LaTeX with ISO-8859-1 encoding (European characters), but I&apos;m struggling with half-baked solutions for UTF-8 encoded documents.</p>
81
- </li>
82
-
83
- <li>
84
- <p>Implement the <a href='http://maruku.rubyforge.org/'>new meta-data proposal</a>.</p>
85
- </li>
86
-
87
- <li>
88
- <p>Exporting to Markdown (pretty printing).</p>
89
- </li>
90
-
91
- <li>
92
- <p>Exporting to HTML splitting in multiple files.</p>
93
- </li>
94
-
95
- <li>
96
- <p>RubyPants.</p>
97
- </li>
98
-
99
- <li>
100
- <p>Support for images in PDF.</p>
101
- </li>
102
- </ul>
103
-
104
- <div class='footnotes'>
105
- <hr />
106
-
107
- <ol />
108
- </div>
109
-
110
- <div class='maruku_signature'>
111
- <hr />
112
- <span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a> at 20:36 on Friday, January 05th, 2007.</span></div>
113
- </body></html>
data/docs/faq.html DELETED
@@ -1,57 +0,0 @@
1
- <?xml version='1.0' encoding='utf-8'?>
2
- <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
5
- <head><meta content='text/html; charset=utf-8' http-equiv='Content-type' />
6
- <title></title>
7
- </head>
8
- <body>
9
- <h2 id='frequently_asked_questions'>Frequently asked questions<!--{:id=>"frequently_asked_questions"}--></h2>
10
-
11
- <ul>
12
- <li>
13
- <p><em>Does Maruku supports internationalizations?</em></p>
14
-
15
- <p>Maruku workflow:</p>
16
-
17
- <ul>
18
- <li>input is assumed to be in UTF-8, unless an encoding is specified.</li>
19
-
20
- <li>the internal representation is UTF-8.</li>
21
-
22
- <li>the HTML output is in UTF-8.</li>
23
-
24
- <li>the LaTeX output does not work yet for arbitrary UTF-8 characters (please help me if you can).</li>
25
- </ul>
26
-
27
- <p>The following are some examples of UTF-8 special chars:</p>
28
-
29
- <blockquote>
30
- <p>Maruku in katakana: マルク<br />
31
- Māku: マーク<br />
32
- Accented italian letters: àèéìòù<br />
33
- Andrea Censi: アンドレア チェンシ</p>
34
- </blockquote>
35
-
36
- <p>The internal format is again UTF-8.</p>
37
-
38
- <p>The HTML output is encoded in UTF-8, and the <code>encoding</code> is set in the xml header:</p>
39
-
40
- <pre><code>&lt;?xml version=&apos;1.0&apos; encoding=&apos;utf-8&apos;?&gt;
41
- &lt;!DOCTYPE html PUBLIC &apos;-//W3C//DTD XHTML 1.0 Strict//EN&apos;
42
- </code></pre>
43
-
44
- <p>However, the LaTeX output does not work yet for arbitrary UTF-8 strings. I need help for this.</p>
45
- </li>
46
- </ul>
47
-
48
- <div class='footnotes'>
49
- <hr />
50
-
51
- <ol />
52
- </div>
53
-
54
- <div class='maruku_signature'>
55
- <hr />
56
- <span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a> at 20:36 on Friday, January 05th, 2007.</span></div>
57
- </body></html>
data/docs/faq.md DELETED
@@ -1,32 +0,0 @@
1
- Frequently asked questions
2
- --------------------------
3
-
4
-
5
- * *Does Maruku supports internationalizations?*
6
-
7
- Maruku workflow:
8
-
9
- * input is assumed to be in UTF-8, unless an encoding
10
- is specified.
11
- * the internal representation is UTF-8.
12
- * the HTML output is in UTF-8.
13
- * the LaTeX output does not work yet for arbitrary
14
- UTF-8 characters (please help me if you can).
15
-
16
- The following are some examples of UTF-8 special chars:
17
-
18
- > Maruku in katakana: マルク
19
- > Māku: マーク
20
- > Accented italian letters: àèéìòù
21
- > Andrea Censi: アンドレア チェンシ
22
-
23
- The internal format is again UTF-8.
24
-
25
- The HTML output is encoded in UTF-8, and
26
- the `encoding` is set in the xml header:
27
-
28
- <?xml version='1.0' encoding='utf-8'?>
29
- <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
30
-
31
- However, the LaTeX output does not work yet for arbitrary
32
- UTF-8 strings. I need help for this.
@@ -1,10 +0,0 @@
1
- Title: hidden o^n squared algorithms
2
-
3
- Premessa: I am not particularly expert in text processing, regular
4
- expressions, etc.
5
-
6
-
7
- Another example of a O(n^2) algorithm is the following:
8
-
9
-
10
-
data/docs/todo.html DELETED
@@ -1,40 +0,0 @@
1
- <?xml version='1.0' encoding='utf-8'?>
2
- <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
5
- <head><meta content='text/html; charset=utf-8' http-equiv='Content-type' />
6
- <title></title>
7
- </head>
8
- <body>
9
- <ul>
10
- <li>
11
- <p>Export to HTML</p>
12
-
13
- <ul>
14
- <li>Include RubyPants</li>
15
- </ul>
16
- </li>
17
-
18
- <li>
19
- <p>Export to PDF</p>
20
-
21
- <ul>
22
- <li>support for images</li>
23
- </ul>
24
- </li>
25
-
26
- <li>
27
- <p>Export to Markdown (pretty-printing)</p>
28
- </li>
29
- </ul>
30
-
31
- <div class='footnotes'>
32
- <hr />
33
-
34
- <ol />
35
- </div>
36
-
37
- <div class='maruku_signature'>
38
- <hr />
39
- <span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a> at 20:36 on Friday, January 05th, 2007.</span></div>
40
- </body></html>
data/docs/todo.md DELETED
@@ -1,9 +0,0 @@
1
-
2
- * Export to HTML
3
- * Include RubyPants
4
-
5
- * Export to PDF
6
- * support for images
7
-
8
- * Export to Markdown (pretty-printing)
9
-