remi-maruku 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +73 -0
- data/bin/marudown +29 -0
- data/bin/maruku +176 -0
- data/bin/marutest +338 -0
- data/bin/marutex +31 -0
- data/docs/changelog.md +334 -0
- data/docs/div_syntax.md +36 -0
- data/docs/entity_test.md +23 -0
- data/docs/markdown_syntax.md +899 -0
- data/docs/maruku.md +346 -0
- data/docs/math.md +194 -0
- data/docs/other_stuff.md +51 -0
- data/docs/proposal.md +309 -0
- data/lib/maruku.rb +141 -0
- data/lib/maruku/attributes.rb +227 -0
- data/lib/maruku/defaults.rb +70 -0
- data/lib/maruku/errors_management.rb +92 -0
- data/lib/maruku/ext/div.rb +100 -0
- data/lib/maruku/ext/math.rb +41 -0
- data/lib/maruku/ext/math/elements.rb +27 -0
- data/lib/maruku/ext/math/latex_fix.rb +11 -0
- data/lib/maruku/ext/math/mathml_engines/blahtex.rb +104 -0
- data/lib/maruku/ext/math/mathml_engines/itex2mml.rb +29 -0
- data/lib/maruku/ext/math/mathml_engines/none.rb +20 -0
- data/lib/maruku/ext/math/mathml_engines/ritex.rb +24 -0
- data/lib/maruku/ext/math/parsing.rb +105 -0
- data/lib/maruku/ext/math/to_html.rb +170 -0
- data/lib/maruku/ext/math/to_latex.rb +22 -0
- data/lib/maruku/helpers.rb +260 -0
- data/lib/maruku/input/charsource.rb +326 -0
- data/lib/maruku/input/extensions.rb +69 -0
- data/lib/maruku/input/html_helper.rb +189 -0
- data/lib/maruku/input/linesource.rb +111 -0
- data/lib/maruku/input/parse_block.rb +613 -0
- data/lib/maruku/input/parse_doc.rb +227 -0
- data/lib/maruku/input/parse_span_better.rb +732 -0
- data/lib/maruku/input/rubypants.rb +225 -0
- data/lib/maruku/input/type_detection.rb +144 -0
- data/lib/maruku/input_textile2/t2_parser.rb +163 -0
- data/lib/maruku/maruku.rb +33 -0
- data/lib/maruku/output/s5/fancy.rb +756 -0
- data/lib/maruku/output/s5/to_s5.rb +125 -0
- data/lib/maruku/output/to_html.rb +971 -0
- data/lib/maruku/output/to_latex.rb +563 -0
- data/lib/maruku/output/to_latex_entities.rb +367 -0
- data/lib/maruku/output/to_latex_strings.rb +64 -0
- data/lib/maruku/output/to_markdown.rb +164 -0
- data/lib/maruku/output/to_s.rb +53 -0
- data/lib/maruku/string_utils.rb +191 -0
- data/lib/maruku/structures.rb +165 -0
- data/lib/maruku/structures_inspect.rb +87 -0
- data/lib/maruku/structures_iterators.rb +61 -0
- data/lib/maruku/tests/benchmark.rb +82 -0
- data/lib/maruku/tests/new_parser.rb +370 -0
- data/lib/maruku/tests/tests.rb +136 -0
- data/lib/maruku/textile2.rb +1 -0
- data/lib/maruku/toc.rb +199 -0
- data/lib/maruku/usage/example1.rb +33 -0
- data/lib/maruku/version.rb +40 -0
- data/tests/bugs/code_in_links.md +16 -0
- data/tests/bugs/complex_escaping.md +4 -0
- data/tests/math/syntax.md +46 -0
- data/tests/math_usage/document.md +13 -0
- data/tests/others/abbreviations.md +11 -0
- data/tests/others/blank.md +4 -0
- data/tests/others/code.md +5 -0
- data/tests/others/code2.md +8 -0
- data/tests/others/code3.md +16 -0
- data/tests/others/email.md +4 -0
- data/tests/others/entities.md +19 -0
- data/tests/others/escaping.md +16 -0
- data/tests/others/extra_dl.md +101 -0
- data/tests/others/extra_header_id.md +13 -0
- data/tests/others/extra_table1.md +40 -0
- data/tests/others/footnotes.md +17 -0
- data/tests/others/headers.md +10 -0
- data/tests/others/hrule.md +10 -0
- data/tests/others/images.md +20 -0
- data/tests/others/inline_html.md +42 -0
- data/tests/others/links.md +38 -0
- data/tests/others/list1.md +4 -0
- data/tests/others/list2.md +5 -0
- data/tests/others/list3.md +8 -0
- data/tests/others/lists.md +32 -0
- data/tests/others/lists_after_paragraph.md +44 -0
- data/tests/others/lists_ol.md +39 -0
- data/tests/others/misc_sw.md +105 -0
- data/tests/others/one.md +1 -0
- data/tests/others/paragraphs.md +13 -0
- data/tests/others/sss06.md +352 -0
- data/tests/others/test.md +4 -0
- data/tests/s5/s5profiling.md +48 -0
- data/tests/unittest/abbreviations.md +72 -0
- data/tests/unittest/alt.md +30 -0
- data/tests/unittest/attributes/att2.md +34 -0
- data/tests/unittest/attributes/att3.md +45 -0
- data/tests/unittest/attributes/attributes.md +82 -0
- data/tests/unittest/attributes/circular.md +43 -0
- data/tests/unittest/attributes/default.md +38 -0
- data/tests/unittest/blank.md +39 -0
- data/tests/unittest/blanks_in_code.md +106 -0
- data/tests/unittest/bug_def.md +29 -0
- data/tests/unittest/bug_table.md +67 -0
- data/tests/unittest/code.md +53 -0
- data/tests/unittest/code2.md +46 -0
- data/tests/unittest/code3.md +102 -0
- data/tests/unittest/data_loss.md +42 -0
- data/tests/unittest/divs/div1.md +204 -0
- data/tests/unittest/divs/div2.md +34 -0
- data/tests/unittest/divs/div3_nest.md +62 -0
- data/tests/unittest/easy.md +28 -0
- data/tests/unittest/email.md +33 -0
- data/tests/unittest/encoding/iso-8859-1.md +38 -0
- data/tests/unittest/encoding/utf-8.md +33 -0
- data/tests/unittest/entities.md +124 -0
- data/tests/unittest/escaping.md +89 -0
- data/tests/unittest/extra_dl.md +72 -0
- data/tests/unittest/extra_header_id.md +86 -0
- data/tests/unittest/extra_table1.md +55 -0
- data/tests/unittest/footnotes.md +126 -0
- data/tests/unittest/headers.md +54 -0
- data/tests/unittest/hex_entities.md +50 -0
- data/tests/unittest/hrule.md +60 -0
- data/tests/unittest/html2.md +38 -0
- data/tests/unittest/html3.md +47 -0
- data/tests/unittest/html4.md +42 -0
- data/tests/unittest/html5.md +38 -0
- data/tests/unittest/ie.md +82 -0
- data/tests/unittest/images.md +114 -0
- data/tests/unittest/images2.md +46 -0
- data/tests/unittest/inline_html.md +260 -0
- data/tests/unittest/inline_html2.md +36 -0
- data/tests/unittest/links.md +197 -0
- data/tests/unittest/list1.md +66 -0
- data/tests/unittest/list2.md +76 -0
- data/tests/unittest/list3.md +88 -0
- data/tests/unittest/list4.md +116 -0
- data/tests/unittest/lists.md +241 -0
- data/tests/unittest/lists11.md +31 -0
- data/tests/unittest/lists6.md +54 -0
- data/tests/unittest/lists7.md +79 -0
- data/tests/unittest/lists7b.md +136 -0
- data/tests/unittest/lists8.md +83 -0
- data/tests/unittest/lists9.md +85 -0
- data/tests/unittest/lists_after_paragraph.md +268 -0
- data/tests/unittest/lists_ol.md +324 -0
- data/tests/unittest/loss.md +29 -0
- data/tests/unittest/math/equations.md +69 -0
- data/tests/unittest/math/inline.md +66 -0
- data/tests/unittest/math/math2.md +110 -0
- data/tests/unittest/math/notmath.md +40 -0
- data/tests/unittest/math/table.md +43 -0
- data/tests/unittest/math/table2.md +60 -0
- data/tests/unittest/misc_sw.md +615 -0
- data/tests/unittest/notyet/escape.md +36 -0
- data/tests/unittest/notyet/header_after_par.md +81 -0
- data/tests/unittest/notyet/ticks.md +31 -0
- data/tests/unittest/notyet/triggering.md +206 -0
- data/tests/unittest/olist.md +64 -0
- data/tests/unittest/one.md +28 -0
- data/tests/unittest/paragraph.md +29 -0
- data/tests/unittest/paragraph_rules/dont_merge_ref.md +57 -0
- data/tests/unittest/paragraph_rules/tab_is_blank.md +39 -0
- data/tests/unittest/paragraphs.md +66 -0
- data/tests/unittest/pending/amps.md +29 -0
- data/tests/unittest/pending/empty_cells.md +53 -0
- data/tests/unittest/pending/link.md +103 -0
- data/tests/unittest/recover/recover_links.md +28 -0
- data/tests/unittest/references/long_example.md +88 -0
- data/tests/unittest/references/spaces_and_numbers.md +28 -0
- data/tests/unittest/smartypants.md +171 -0
- data/tests/unittest/syntax_hl.md +80 -0
- data/tests/unittest/table_attributes.md +52 -0
- data/tests/unittest/test.md +32 -0
- data/tests/unittest/wrapping.md +88 -0
- data/tests/unittest/xml.md +54 -0
- data/tests/unittest/xml2.md +34 -0
- data/tests/unittest/xml3.md +44 -0
- data/tests/unittest/xml_instruction.md +72 -0
- data/tests/utf8-files/simple.md +1 -0
- data/unit_test_block.sh +5 -0
- data/unit_test_span.sh +2 -0
- metadata +243 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
css: math.css
|
2
|
+
|
3
|
+
This is an example document. Inline: $a$, $b$, $q$ and stop.
|
4
|
+
|
5
|
+
$$ \int_a^b f(x) dx $$ (1)
|
6
|
+
|
7
|
+
See for example (eq:1).
|
8
|
+
|
9
|
+
Equation inline: $ \int_a^b f(x) dx $ and that's it.
|
10
|
+
|
11
|
+
|
12
|
+
Spacing: Maruku outputs sizes and alignment for images in `ex`. An `ex` is one `x`:
|
13
|
+
x, $\textrm{x}$, $x$ should have the same height.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Maruku translates HTML entities to the equivalent in LaTeX:
|
2
|
+
|
3
|
+
Entity | Result
|
4
|
+
------------|----------
|
5
|
+
`©` | ©
|
6
|
+
`£` | £
|
7
|
+
`a b` | a b
|
8
|
+
`λ` | λ
|
9
|
+
`—` | —
|
10
|
+
|
11
|
+
|
12
|
+
Entity-substitution does not happen in code blocks or inline code.
|
13
|
+
|
14
|
+
The following should not be translated:
|
15
|
+
|
16
|
+
©
|
17
|
+
|
18
|
+
It should read just like this: `©`.
|
19
|
+
|
@@ -0,0 +1,16 @@
|
|
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 `
|
15
|
+
|
16
|
+
Exactly one space: ` ` and also here: `` ``
|
@@ -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,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,42 @@
|
|
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 on span: <img src="http://jigsaw.w3.org/css-validator/images/vcss"/>
|
10
|
+
|
11
|
+
Result alone:
|
12
|
+
|
13
|
+
<img src="http://jigsaw.w3.org/css-validator/images/vcss"/>
|
14
|
+
|
15
|
+
Without closing:
|
16
|
+
|
17
|
+
<img src="http://jigsaw.w3.org/css-validator/images/vcss">
|
18
|
+
|
19
|
+
<div markdown="1">
|
20
|
+
This is *true* markdown text (paragraph)
|
21
|
+
|
22
|
+
<p markdown="1">
|
23
|
+
This is *true* markdown text (no paragraph)
|
24
|
+
</p>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<table>
|
28
|
+
<tr>
|
29
|
+
<td markdown="1">This is *true* markdown text. (no par)</td>
|
30
|
+
<td markdown="block">This is *true* markdown text. (par)</td>
|
31
|
+
</tr>
|
32
|
+
</table>
|
33
|
+
|
34
|
+
|
35
|
+
The following is invalid HTML, and will generate an error:
|
36
|
+
|
37
|
+
<table>
|
38
|
+
<td markdown="1">This is *true* markdown text. (no par)</td>
|
39
|
+
<td markdown="block">This is *true* markdown text. (par)</td>
|
40
|
+
</tr>
|
41
|
+
</table>
|
42
|
+
|
@@ -0,0 +1,38 @@
|
|
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
|
+
Inline: [Google images](http://google.com)
|
15
|
+
|
16
|
+
Inline with title: [Google images](http://google.com "Title")
|
17
|
+
|
18
|
+
Inline with title: [Google images]( http://google.com "Title" )
|
19
|
+
|
20
|
+
|
21
|
+
Search on <http://www.gogole.com> or <http://Here.com> or ask <mailto:bill@google.com>
|
22
|
+
or you might ask bill@google.com.
|
23
|
+
|
24
|
+
If all else fails, ask [Google](http://www.google.com)
|
25
|
+
|
26
|
+
[google]: http://www.google.com
|
27
|
+
|
28
|
+
[google2]: http://www.google.com 'Single quotes'
|
29
|
+
|
30
|
+
[google3]: http://www.google.com "Double quotes"
|
31
|
+
|
32
|
+
[google4]: http://www.google.com (Parenthesis)
|
33
|
+
|
34
|
+
[Google Search]:
|
35
|
+
http://www.google.com "Google search"
|
36
|
+
|
37
|
+
[Google Images]:
|
38
|
+
http://images.google.com (Google images)
|
@@ -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.
|