maruku 0.2

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 (60) hide show
  1. data/bin/maruku +25 -0
  2. data/bin/marutex +29 -0
  3. data/docs/Makefile +25 -0
  4. data/docs/char_codes.xml +884 -0
  5. data/docs/color-package-demo.aux +1 -0
  6. data/docs/color-package-demo.log +127 -0
  7. data/docs/color-package-demo.tex +149 -0
  8. data/docs/index.html +74 -0
  9. data/docs/markdown_syntax.aux +13 -0
  10. data/docs/markdown_syntax.html +266 -0
  11. data/docs/markdown_syntax.log +287 -0
  12. data/docs/markdown_syntax.md +920 -0
  13. data/docs/markdown_syntax.out +0 -0
  14. data/docs/markdown_syntax.pdf +0 -0
  15. data/docs/markdown_syntax.tex +1203 -0
  16. data/docs/maruku.aux +13 -0
  17. data/docs/maruku.html +74 -0
  18. data/docs/maruku.log +294 -0
  19. data/docs/maruku.md +394 -0
  20. data/docs/maruku.out +0 -0
  21. data/docs/maruku.pdf +0 -0
  22. data/docs/maruku.tex +548 -0
  23. data/docs/style.css +65 -0
  24. data/docs/todo.md +12 -0
  25. data/lib/maruku.rb +20 -0
  26. data/lib/maruku/parse_block.rb +577 -0
  27. data/lib/maruku/parse_span.rb +336 -0
  28. data/lib/maruku/string_utils.rb +270 -0
  29. data/lib/maruku/structures.rb +31 -0
  30. data/lib/maruku/to_html.rb +430 -0
  31. data/lib/maruku/to_latex.rb +345 -0
  32. data/lib/maruku/to_latex_strings.rb +330 -0
  33. data/tests/abbreviations.md +11 -0
  34. data/tests/blank.md +4 -0
  35. data/tests/code.md +5 -0
  36. data/tests/code2.md +8 -0
  37. data/tests/code3.md +16 -0
  38. data/tests/email.md +4 -0
  39. data/tests/entities.md +19 -0
  40. data/tests/escaping.md +14 -0
  41. data/tests/extra_dl.md +101 -0
  42. data/tests/extra_header_id.md +13 -0
  43. data/tests/extra_table1.md +40 -0
  44. data/tests/footnotes.md +17 -0
  45. data/tests/headers.md +10 -0
  46. data/tests/hrule.md +10 -0
  47. data/tests/images.md +20 -0
  48. data/tests/inline_html.md +35 -0
  49. data/tests/links.md +31 -0
  50. data/tests/list1.md +4 -0
  51. data/tests/list2.md +5 -0
  52. data/tests/list3.md +8 -0
  53. data/tests/lists.md +32 -0
  54. data/tests/lists_ol.md +39 -0
  55. data/tests/misc_sw.md +105 -0
  56. data/tests/one.md +1 -0
  57. data/tests/paragraphs.md +13 -0
  58. data/tests/sss06.md +352 -0
  59. data/tests/test.md +4 -0
  60. metadata +113 -0
@@ -0,0 +1,11 @@
1
+
2
+ The HTML specification is maintained by the W3C.
3
+
4
+ *[HTML]: Hyper Text Markup Language
5
+ *[W3C]: World Wide Web Consortium
6
+
7
+
8
+
9
+ Operation Tigra Genesis is going well.
10
+
11
+ *[Tigra Genesis]:
@@ -0,0 +1,4 @@
1
+
2
+ Linea 1
3
+
4
+ Linea 2
@@ -0,0 +1,5 @@
1
+ Here is an example of AppleScript:
2
+
3
+ tell application "Foo"
4
+ beep
5
+ end tell
@@ -0,0 +1,8 @@
1
+ > ## This is a header.
2
+ >
3
+ > 1. This is the first list item.
4
+ > 2. This is the second list item.
5
+ >
6
+ > Here's some example code:
7
+ >
8
+ > return shell_exec("echo $input | $markdown_script");
@@ -0,0 +1,16 @@
1
+
2
+ This is code (4 spaces):
3
+
4
+ Code
5
+ This is not code
6
+
7
+ Code
8
+
9
+ This is code (1 tab):
10
+
11
+ Code
12
+ This is not code
13
+
14
+ Code
15
+
16
+
@@ -0,0 +1,4 @@
1
+
2
+
3
+ This is an email address: <andrea@invalid.it>
4
+
@@ -0,0 +1,19 @@
1
+ Maruku translates HTML entities to the equivalent in LaTeX:
2
+
3
+ Entity | Result
4
+ ------------|----------
5
+ `&copy;` | &copy;
6
+ `&pound;` | &pound;
7
+ `a&nbsp;b` | a&nbsp;b
8
+ `&lambda;` | &lambda;
9
+ `&mdash;` | &mdash;
10
+
11
+
12
+ Entity-substitution does not happen in code blocks or inline code.
13
+
14
+ The following should not be translated:
15
+
16
+ &copy;
17
+
18
+ It should read just like this: `&copy;`.
19
+
@@ -0,0 +1,14 @@
1
+ Hello: ! \! \` \{ \} \[ \] \( \) \# \. \! * \* *
2
+
3
+
4
+ Ora, *emphasis*, **bold**, * <- due asterischi-> * , un underscore-> _ , _emphasis_,
5
+ incre*dible*e!
6
+
7
+
8
+ This is `Code with an escape: -> \` <- ` (after)
9
+
10
+ This is ``Code with a special: -> ` <- ``(after)
11
+
12
+ `Start ` of paragraph
13
+
14
+ End of `paragraph `
@@ -0,0 +1,101 @@
1
+ CSS: style.css
2
+
3
+
4
+ Apple
5
+ : Pomaceous fruit of plants of the genus Malus in
6
+ the family Rosaceae.
7
+
8
+ Orange
9
+ : The fruit of an evergreen tree of the genus Citrus.
10
+
11
+ ***
12
+
13
+ Apple
14
+ : Pomaceous fruit of plants of the genus Malus in
15
+ the family Rosaceae.
16
+
17
+ Orange
18
+ : The fruit of an evergreen tree of the genus Citrus.
19
+
20
+
21
+ ***
22
+
23
+ Apple
24
+ : Pomaceous fruit of plants of the genus Malus in
25
+ the family Rosaceae.
26
+ : An american computer company.
27
+
28
+ Orange
29
+ : The fruit of an evergreen tree of the genus Citrus.
30
+
31
+ ***
32
+
33
+ Term 1
34
+ Term 2
35
+ : Definition a
36
+
37
+ Term 3
38
+ : Definition b
39
+
40
+ ***
41
+
42
+
43
+ Term 1
44
+ Term 2
45
+ Term 2a
46
+ Term 2b
47
+ : Definition a
48
+
49
+ Term 3
50
+ : Definition b
51
+
52
+ ***
53
+
54
+ Apple
55
+
56
+ : Pomaceous fruit of plants of the genus Malus in
57
+ the family Rosaceae.
58
+
59
+ Orange
60
+
61
+ : The fruit of an evergreen tree of the genus Citrus.
62
+
63
+ ***
64
+
65
+ Term 1
66
+
67
+ : This is a definition with two paragraphs. Lorem ipsum
68
+ dolor sit amet, consectetuer adipiscing elit. Aliquam
69
+ hendrerit mi posuere lectus.
70
+
71
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet
72
+ vitae, risus.
73
+
74
+ : Second definition for term 1, also wrapped in a paragraph
75
+ because of the blank line preceding it.
76
+
77
+ Term 2
78
+
79
+ : This definition has a code block, a blockquote and a list.
80
+
81
+ code block.
82
+
83
+ > block quote
84
+ > on two lines.
85
+
86
+ 1. first list item
87
+ 2. second list item
88
+
89
+ ***
90
+
91
+ Term 1
92
+ Term 2
93
+ Term 2a
94
+ Term 2b
95
+ : Definition a
96
+
97
+ This is a paragraph
98
+
99
+ This is a term
100
+
101
+ : definition
@@ -0,0 +1,13 @@
1
+ Header 1 {#header1}
2
+ ========
3
+
4
+ Header 2 {#header2}
5
+ --------
6
+
7
+ ### Header 3 ### {#header3}
8
+
9
+ Then you can create links to different parts of the same document like this:
10
+
11
+ [Link back to header 1](#header1),
12
+ [Link back to header 2](#header2),
13
+ [Link back to header 3](#header3)
@@ -0,0 +1,40 @@
1
+ CSS: style.css
2
+
3
+ First Header | Second Header
4
+ ------------- | -------------
5
+ Content Cell | Content Cell
6
+ Content Cell | Content Cell
7
+
8
+ ***
9
+
10
+ | Item | Value |
11
+ | --------- | -----:|
12
+ | Computer | $1600 |
13
+ | Phone | $12 |
14
+ | Pipe | $1 |
15
+
16
+ ***
17
+
18
+ | Function name | Description |
19
+ | ------------- | ------------------------------ |
20
+ | `help()` | Display the help window. |
21
+ | `destroy()` | **Destroy your computer!** |
22
+
23
+
24
+ ***
25
+
26
+ | Very long long head |
27
+ | :------------ |
28
+ | left |
29
+
30
+ ***
31
+
32
+ | Very long long head |
33
+ | -------------------: |
34
+ | right |
35
+
36
+ ***
37
+
38
+ | Very long long head |
39
+ | :------------------: |
40
+ | center |
@@ -0,0 +1,17 @@
1
+ That's some text with a footnote [^b] and another [^c] and another [^a].
2
+
3
+ [^a]: And that's the footnote.
4
+
5
+ That's the second paragraph of the footnote.
6
+
7
+
8
+ [^b]: And that's the footnote.
9
+ This is second sentence (same paragraph).
10
+
11
+ [^c]:
12
+ This is the very long one.
13
+
14
+ That's the second paragraph.
15
+
16
+
17
+ This is not a footnote.
@@ -0,0 +1,10 @@
1
+ A title with *emphasis*
2
+ =======================
3
+
4
+ A title with *emphasis*
5
+ -----------------------
6
+
7
+
8
+ #### A title with *emphasis* ####
9
+
10
+
@@ -0,0 +1,10 @@
1
+ * * *
2
+
3
+ ***
4
+
5
+ *****
6
+
7
+ - - -
8
+
9
+ ---------------------------------------
10
+
@@ -0,0 +1,20 @@
1
+
2
+ This page does not utilizes ![Cascading Style Sheets](http://jigsaw.w3.org/css-validator/images/vcss)
3
+
4
+
5
+ Please mouseover to see the title: ![Cascading Style Sheets](http://jigsaw.w3.org/css-validator/images/vcss "Title ok!")
6
+
7
+ Please mouseover to see the title: ![Cascading Style Sheets](http://jigsaw.w3.org/css-validator/images/vcss 'Title ok!')
8
+
9
+
10
+ I'll say it one more time: this page does not use ![Cascading Style Sheets] [css]
11
+
12
+ This is double size: ![Cascading Style Sheets] [css2]
13
+
14
+
15
+
16
+ [css]: http://jigsaw.w3.org/css-validator/images/vcss "Optional title attribute"
17
+
18
+ [css2]: http://jigsaw.w3.org/css-validator/images/vcss "Optional title attribute" class=external
19
+ style="border:0;width:188px;height:131px"
20
+
@@ -0,0 +1,35 @@
1
+ CSS: style.css
2
+
3
+ Input:
4
+ <em>Emphasis</em>
5
+ Result: <em>Emphasis</em>
6
+
7
+ Input:
8
+ <img src="http://jigsaw.w3.org/css-validator/images/vcss"/>
9
+ Result: <img src="http://jigsaw.w3.org/css-validator/images/vcss"/>
10
+
11
+
12
+ <div markdown="1">
13
+ This is *true* markdown text (paragraph)
14
+
15
+ <p markdown="1">
16
+ This is *true* markdown text (no paragraph)
17
+ </p>
18
+ </div>
19
+
20
+ <table>
21
+ <tr>
22
+ <td markdown="1">This is *true* markdown text. (no par)</td>
23
+ <td markdown="block">This is *true* markdown text. (par)</td>
24
+ </tr>
25
+ </table>
26
+
27
+
28
+ The following is invalid HTML, and will generate an error:
29
+
30
+ <table>
31
+ <td markdown="1">This is *true* markdown text. (no par)</td>
32
+ <td markdown="block">This is *true* markdown text. (par)</td>
33
+ </tr>
34
+ </table>
35
+
@@ -0,0 +1,31 @@
1
+
2
+ Search on [Google][]
3
+
4
+ Search on [Google] []
5
+
6
+ Search on [Google] [google]
7
+
8
+ Search on [Google] [Google]
9
+
10
+ Search on [Google images][]
11
+
12
+ Search on [Google images][ GoOgle search ]
13
+
14
+ Search on <http://www.gogole.com> or <http://Here.com> or ask <mailto:bill@google.com>
15
+ or you might ask bill@google.com.
16
+
17
+ If all else fails, ask [Google](http://www.google.com)
18
+
19
+ [google]: http://www.google.com
20
+
21
+ [google2]: http://www.google.com 'Single quotes'
22
+
23
+ [google3]: http://www.google.com "Double quotes"
24
+
25
+ [google4]: http://www.google.com (Parenthesis)
26
+
27
+ [Google Search]:
28
+ http://www.google.com "Google search"
29
+
30
+ [Google Images]:
31
+ http://images.google.com (Google images)
@@ -0,0 +1,4 @@
1
+ * A list item with a blockquote:
2
+
3
+ > This is a blockquote
4
+ > inside a list item.
@@ -0,0 +1,5 @@
1
+ * This is a list item with two paragraphs.
2
+
3
+ This is the second paragraph in the list item. You're
4
+ only required to indent the first line. Lorem ipsum dolor
5
+ sit amet, consectetuer adipiscing elit.
@@ -0,0 +1,8 @@
1
+ * A list item with a blockquote:
2
+
3
+ > This is a blockquote
4
+ > inside a list item.
5
+
6
+ * A list item with a code block:
7
+
8
+ <code goes here>
@@ -0,0 +1,32 @@
1
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
2
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
3
+ viverra nec, fringilla in, laoreet vitae, risus.
4
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
5
+ Suspendisse id sem consectetuer libero luctus adipiscing.
6
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
7
+ Suspendisse id sem consectetuer libero luctus adipiscing.
8
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
9
+ Suspendisse id sem consectetuer libero luctus adipiscing.
10
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
11
+ Suspendisse id sem consectetuer libero luctus adipiscing.
12
+
13
+ Ancora
14
+
15
+ * This is a list item with two paragraphs. Lorem ipsum dolor
16
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
17
+ mi posuere lectus.
18
+
19
+ ATTENZIONE!
20
+
21
+ * Suspendisse id sem consectetuer libero luctus adipiscing.
22
+
23
+
24
+ Ancora
25
+
26
+ * This is a list item with two paragraphs.
27
+
28
+ This is the second paragraph in the list item. You're
29
+ only required to indent the first line. Lorem ipsum dolor
30
+ sit amet, consectetuer adipiscing elit.
31
+
32
+ * Another item in the same list.
@@ -0,0 +1,39 @@
1
+ 1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
2
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
3
+ viverra nec, fringilla in, laoreet vitae, risus.
4
+ 2. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
5
+ Suspendisse id sem consectetuer libero luctus adipiscing.
6
+ 3. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
7
+ Suspendisse id sem consectetuer libero luctus adipiscing.
8
+ 3. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
9
+ Suspendisse id sem consectetuer libero luctus adipiscing.
10
+ 4. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
11
+ Suspendisse id sem consectetuer libero luctus adipiscing.
12
+
13
+ Ancora
14
+
15
+ 1. This is a list item with two paragraphs. Lorem ipsum dolor
16
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
17
+ mi posuere lectus.
18
+
19
+ ATTENZIONE!
20
+
21
+ - Uno
22
+ - Due
23
+ 1. tre
24
+ 1. tre
25
+ 1. tre
26
+ - Due
27
+
28
+ 2. Suspendisse id sem consectetuer libero luctus adipiscing.
29
+
30
+
31
+ Ancora
32
+
33
+ * This is a list item with two paragraphs.
34
+
35
+ This is the second paragraph in the list item. You're
36
+ only required to indent the first line. Lorem ipsum dolor
37
+ sit amet, consectetuer adipiscing elit.
38
+
39
+ * Another item in the same list.