maruku 0.2.13 → 0.3.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.
- data/bin/maruku +23 -15
- data/bin/maruku0.3 +37 -0
- data/bin/marutest +277 -0
- data/docs/changelog-0.3.html +99 -0
- data/docs/changelog-0.3.md +84 -0
- data/docs/faq.html +46 -0
- data/docs/faq.md +32 -0
- data/docs/index.html +629 -64
- data/docs/markdown_extra2.html +67 -14
- data/docs/markdown_syntax.html +631 -94
- data/docs/markdown_syntax_2.html +152 -0
- data/docs/maruku.html +629 -64
- data/docs/maruku.md +108 -105
- data/docs/proposal.html +362 -55
- data/docs/proposal.md +133 -169
- data/docs/todo.html +30 -0
- data/lib/maruku.rb +13 -3
- data/lib/maruku/errors_management.rb +75 -0
- data/lib/maruku/helpers.rb +164 -0
- data/lib/maruku/html_helper.rb +33 -13
- data/lib/maruku/parse_block.rb +89 -92
- data/lib/maruku/parse_doc.rb +43 -18
- data/lib/maruku/parse_span.rb +17 -46
- data/lib/maruku/parse_span_better.rb +681 -0
- data/lib/maruku/string_utils.rb +17 -10
- data/lib/maruku/structures.rb +62 -35
- data/lib/maruku/structures_iterators.rb +39 -0
- data/lib/maruku/tests/benchmark.rb +12 -4
- data/lib/maruku/tests/new_parser.rb +318 -0
- data/lib/maruku/to_html.rb +113 -44
- data/lib/maruku/to_latex.rb +32 -14
- data/lib/maruku/to_markdown.rb +110 -0
- data/lib/maruku/toc.rb +35 -1
- data/lib/maruku/version.rb +10 -1
- data/lib/test.rb +29 -0
- data/tests/others/escaping.md +6 -4
- data/tests/others/links.md +1 -1
- data/tests/others/lists_after_paragraph.md +44 -0
- data/tests/unittest/abbreviations.md +71 -0
- data/tests/unittest/blank.md +43 -0
- data/tests/unittest/blanks_in_code.md +131 -0
- data/tests/unittest/code.md +64 -0
- data/tests/unittest/code2.md +59 -0
- data/tests/unittest/code3.md +121 -0
- data/tests/unittest/easy.md +36 -0
- data/tests/unittest/email.md +39 -0
- data/tests/unittest/encoding/iso-8859-1.md +9 -0
- data/tests/unittest/encoding/utf-8.md +38 -0
- data/tests/unittest/entities.md +174 -0
- data/tests/unittest/escaping.md +97 -0
- data/tests/unittest/extra_dl.md +81 -0
- data/tests/unittest/extra_header_id.md +96 -0
- data/tests/unittest/extra_table1.md +78 -0
- data/tests/unittest/footnotes.md +120 -0
- data/tests/unittest/headers.md +64 -0
- data/tests/unittest/hrule.md +77 -0
- data/tests/unittest/images.md +114 -0
- data/tests/unittest/inline_html.md +185 -0
- data/tests/unittest/links.md +162 -0
- data/tests/unittest/list1.md +80 -0
- data/tests/unittest/list2.md +75 -0
- data/tests/unittest/list3.md +111 -0
- data/tests/unittest/list4.md +43 -0
- data/tests/unittest/lists.md +262 -0
- data/tests/unittest/lists_after_paragraph.md +280 -0
- data/tests/unittest/lists_ol.md +323 -0
- data/tests/unittest/misc_sw.md +751 -0
- data/tests/unittest/notyet/escape.md +46 -0
- data/tests/unittest/notyet/header_after_par.md +85 -0
- data/tests/unittest/notyet/ticks.md +67 -0
- data/tests/unittest/notyet/triggering.md +210 -0
- data/tests/unittest/one.md +33 -0
- data/tests/unittest/paragraph.md +34 -0
- data/tests/unittest/paragraph_rules/dont_merge_ref.md +60 -0
- data/tests/unittest/paragraph_rules/tab_is_blank.md +43 -0
- data/tests/unittest/paragraphs.md +84 -0
- data/tests/unittest/recover/recover_links.md +32 -0
- data/tests/unittest/references/long_example.md +87 -0
- data/tests/unittest/references/spaces_and_numbers.md +27 -0
- data/tests/unittest/syntax_hl.md +99 -0
- data/tests/unittest/test.md +36 -0
- data/tests/unittest/wrapping.md +88 -0
- data/tests/utf8-files/simple.md +1 -0
- metadata +139 -86
- data/lib/maruku/maruku.rb +0 -50
- data/tests/a.md +0 -10
@@ -0,0 +1,84 @@
|
|
1
|
+
css: style.css
|
2
|
+
|
3
|
+
Release notes - version 0.3.0 (January 3rd, 2007)
|
4
|
+
-------------------------------------------------
|
5
|
+
|
6
|
+
Note: Maruku seems to be very robust, nevertheless it is still beta-level
|
7
|
+
software. So if you want to use it in production environments, please
|
8
|
+
check back in a month or so, while we squash the remaining bugs.
|
9
|
+
|
10
|
+
In the meantime, feel free to toy around, and please signal problems,
|
11
|
+
request features, by [contacting me][contact] or using the [tracker][tracker].
|
12
|
+
For issues about the Markdown syntax itself and improvements to it,
|
13
|
+
please write to the [Markdown-discuss mailing list][markdown-discuss].
|
14
|
+
|
15
|
+
Have fun!
|
16
|
+
|
17
|
+
Changes in 0.3.0:
|
18
|
+
|
19
|
+
* A real parser is used instead of a regexp-based system, also for span-level
|
20
|
+
elements..
|
21
|
+
|
22
|
+
Now Maruku is almost 2x faster than Bluecloth, while having more features.
|
23
|
+
|
24
|
+
Here are some benchmarks:
|
25
|
+
|
26
|
+
BlueCloth (to_html): parsing 0.00 sec + rendering 1.54 sec = 1.55 sec
|
27
|
+
Maruku (to_html): parsing 0.47 sec + rendering 0.38 sec = 0.85 sec
|
28
|
+
Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec
|
29
|
+
|
30
|
+
This is the result of running `lib/maruku/tests/benchmark.rb` on the Markdown
|
31
|
+
specification.
|
32
|
+
|
33
|
+
* Prettier HTML output by adding whitespace.
|
34
|
+
|
35
|
+
* Added a full suite of unit-tests for the span-level parser.
|
36
|
+
|
37
|
+
* Error management: Having a real parser, Maruku warns you about syntax issues.
|
38
|
+
|
39
|
+
The default action is to warn and try to continue. If you do this:
|
40
|
+
|
41
|
+
Maruku.new(string, {:on_error => :raise})
|
42
|
+
|
43
|
+
then syntax errors will cause an exception to be raised (you can catch this
|
44
|
+
and retry).
|
45
|
+
|
46
|
+
* Fixed a series of bugs in handling inline HTML code.
|
47
|
+
|
48
|
+
Immediate TODO-list:
|
49
|
+
|
50
|
+
* UTF-8 input/output works OK for HTML, however I am having pain trying to export
|
51
|
+
to LaTeX. I want at least Japanese characters support, so if you know how to
|
52
|
+
do this you are very welcome to give me an hand.
|
53
|
+
|
54
|
+
For example: in the HTML version, you should see accented characters in this
|
55
|
+
parenthesis:
|
56
|
+
|
57
|
+
> (àèìòù)
|
58
|
+
|
59
|
+
and Japanese text in these other parentheses:
|
60
|
+
|
61
|
+
> (カタカナで 私の 名前は アンドレア チェンシ です).
|
62
|
+
>
|
63
|
+
> (日本のガルは 大好き、でも、日本語は難しですから、そうぞ 英語話すガルを おしえてください).
|
64
|
+
|
65
|
+
In the LaTeX version, these do not appear. I know how to do LaTeX with
|
66
|
+
ISO-8859-1 encoding (European characters), but I'm struggling with half-baked
|
67
|
+
solutions for UTF-8 encoded documents.
|
68
|
+
|
69
|
+
* Implement the [new meta-data proposal][proposal].
|
70
|
+
|
71
|
+
* Exporting to Markdown (pretty printing).
|
72
|
+
|
73
|
+
* Exporting to HTML splitting in multiple files.
|
74
|
+
|
75
|
+
* RubyPants.
|
76
|
+
|
77
|
+
* Support for images in PDF.
|
78
|
+
|
79
|
+
|
80
|
+
[proposal]: http://maruku.rubyforge.org/
|
81
|
+
[contact]: http://www.dis.uniroma1.it/~acensi/contact.html
|
82
|
+
[markdown-discuss]: http://six.pairlist.net/mailman/listinfo/markdown-discuss
|
83
|
+
[tracker]: http://rubyforge.org/tracker/?group_id=2795
|
84
|
+
|
data/docs/faq.html
ADDED
@@ -0,0 +1,46 @@
|
|
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
|
+
|
5
|
+
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'
|
6
|
+
><head
|
7
|
+
><title></title
|
8
|
+
></head
|
9
|
+
><head
|
10
|
+
><title></title
|
11
|
+
></head
|
12
|
+
><body
|
13
|
+
><h2 id='frequently_asked_questions'>Frequently asked questions</h2
|
14
|
+
><ul
|
15
|
+
><li
|
16
|
+
><p
|
17
|
+
><em>Does Maruku supports internationalizations?</em
|
18
|
+
></p
|
19
|
+
><p>Maruku assumes that documents are written in UTF-8.</p
|
20
|
+
><p>The following are some examples of UTF-8 special chars:</p
|
21
|
+
><blockquote
|
22
|
+
><p>Maruku in katakana: マルク<br /
|
23
|
+
>Māku: マーク<br /
|
24
|
+
>Accented italian letters: àèéìòù<br /
|
25
|
+
>Andrea Censi: アンドレア チェンシ</p
|
26
|
+
></blockquote
|
27
|
+
><p>The internal format is again UTF-8.</p
|
28
|
+
><p>The HTML output is encoded in UTF-8, and the <code>encoding</code
|
29
|
+
> is set in the xml header:</p
|
30
|
+
><pre
|
31
|
+
><code><?xml version='1.0' encoding='utf-8'?>
|
32
|
+
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
33
|
+
|
34
|
+
However, the LaTeX output does not work yet for arbitrary</code
|
35
|
+
></pre
|
36
|
+
><p> UTF-8 strings. I need help for this.</p
|
37
|
+
></li
|
38
|
+
></ul
|
39
|
+
><div class='maruku_signature'
|
40
|
+
><hr /
|
41
|
+
><span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a
|
42
|
+
> at 18:10 on Tuesday, January 02nd, 2007.</span
|
43
|
+
></div
|
44
|
+
></body
|
45
|
+
></html
|
46
|
+
>
|
data/docs/faq.md
ADDED
@@ -0,0 +1,32 @@
|
|
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.
|
data/docs/index.html
CHANGED
@@ -1,118 +1,683 @@
|
|
1
|
-
<?xml version='1.0' ?>
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
2
|
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
3
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
|
-
|
6
|
-
|
4
|
+
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
5
|
+
<head>
|
6
|
+
<title>Maruku: a Markdown-superset interpreter</title>
|
7
|
+
|
8
|
+
<link href='style.css' rel='stylesheet' type='text/css' />
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<h1 id='maruku_a_markdownsuperset_interpreter'>Mar<strong>u</strong>k<strong>u</strong>: a Markdown-superset interpreter</h1>
|
12
|
+
|
13
|
+
<p><a href='http://maruku.rubyforge.org/>'>Maruku</a> is a Markdown interpreter written in <a href='http://www.ruby-lang.org'>Ruby</a>.</p>
|
14
|
+
|
15
|
+
<p>Maruku allows you to write in an easy-to-read-and-write syntax, like this:</p>
|
16
|
+
|
17
|
+
<blockquote>
|
18
|
+
<p><a href='http://maruku.rubyforge.org/maruku.md'>This document in Markdown</a> </p>
|
19
|
+
</blockquote>
|
20
|
+
|
21
|
+
<p>Then it can be translated to HTML:</p>
|
22
|
+
|
23
|
+
<blockquote>
|
24
|
+
<p><a href='http://maruku.rubyforge.org/maruku.html'>This document in HTML</a></p>
|
25
|
+
</blockquote>
|
26
|
+
|
27
|
+
<p>or LaTeX, which is then converted to PDF:</p>
|
28
|
+
|
29
|
+
<blockquote>
|
30
|
+
<p><a href='http://maruku.rubyforge.org/maruku.pdf'>This document in PDF</a></p>
|
31
|
+
</blockquote>
|
32
|
+
|
33
|
+
<p>Maruku implements:</p>
|
34
|
+
|
35
|
+
<ul>
|
36
|
+
<li>
|
37
|
+
<p>the original <a href='http://maruku.rubyforge.org/markdown_syntax.html'>Markdown syntax</a> (<a href='http://maruku.rubyforge.org/markdown_syntax.html'>HTML</a> or <a href='http://maruku.rubyforge.org/markdown_syntax.pdf'>PDF</a>), translated by Maruku).</p>
|
38
|
+
</li>
|
39
|
+
|
40
|
+
<li>
|
41
|
+
<p>all the improvements in <a href='http://www.michelf.com/projects/php-markdown/extra/'>PHP Markdown Extra</a>. </p>
|
42
|
+
</li>
|
43
|
+
|
44
|
+
<li>
|
45
|
+
<p>a new <a href='#meta'>meta-data syntax</a></p>
|
46
|
+
</li>
|
47
|
+
</ul>
|
48
|
+
|
49
|
+
<p><strong>Authors</strong>: Maruku has been developed so far by <a href='http://www.dis.uniroma1.it/~acensi/'>Andrea Censi</a>. Contributors are most welcome!</p>
|
50
|
+
|
51
|
+
<p><strong>The name of the game</strong>: Maruku is the <a href='http://en.wikipedia.org/wiki/Romaji'>romaji</a> translitteration of the <a href='http://en.wikipedia.org/wiki/Katakana'>katakana</a> translitteration of "Mark", the first word in Markdown. I chose this name because Ruby is Japanese, and also the sillable "ru" appears in Maruku.</p>
|
52
|
+
|
53
|
+
<hr />
|
54
|
+
|
55
|
+
<p>Table of contents: (<strong>auto-generated by Maruku!</strong>)</p>
|
56
|
+
|
57
|
+
<div class='maruku_toc'>
|
58
|
+
<ul style='list-style: none;'>
|
59
|
+
<li><span class='maruku_section_number'>1. </span><a href='#release_notes'>Release notes - version 0.3.0 (January 3rd, 2007)</a></li>
|
60
|
+
|
61
|
+
<li><span class='maruku_section_number'>2. </span><a href='#download'>Download</a>
|
62
|
+
<ul style='list-style: none;'>
|
63
|
+
<li><span class='maruku_section_number'>2.1. </span><a href='#bugs_report'>Bugs report</a></li>
|
64
|
+
</ul>
|
65
|
+
</li>
|
66
|
+
|
67
|
+
<li><span class='maruku_section_number'>3. </span><a href='#usage'>Usage</a>
|
68
|
+
<ul style='list-style: none;'>
|
69
|
+
<li><span class='maruku_section_number'>3.1. </span><a href='#from_the_command_line'>From the command line</a></li>
|
70
|
+
</ul>
|
71
|
+
</li>
|
72
|
+
|
73
|
+
<li><span class='maruku_section_number'>4. </span><a href='#extra'>Examples of PHP Markdown Extra syntax</a></li>
|
74
|
+
|
75
|
+
<li><span class='maruku_section_number'>5. </span><a href='#maruku-and-bluecloth'>Maruku and Bluecloth</a></li>
|
76
|
+
|
77
|
+
<li><span class='maruku_section_number'>6. </span><a href='#meta'>New meta-data syntax</a>
|
78
|
+
<ul style='list-style: none;'>
|
79
|
+
<li><span class='maruku_section_number'>6.1. </span><a href='#metadata_for_the_document'>Meta-data for the document</a></li>
|
80
|
+
|
81
|
+
<li><span class='maruku_section_number'>6.2. </span><a href='#metadata_for_elements'>Meta-data for elements</a></li>
|
82
|
+
|
83
|
+
<li><span class='maruku_section_number'>6.3. </span><a href='#shortcuts'>Shortcuts</a></li>
|
84
|
+
|
85
|
+
<li><span class='maruku_section_number'>6.4. </span><a href='#metalist'>List of meta-data</a></li>
|
86
|
+
|
87
|
+
<li><span class='maruku_section_number'>6.5. </span><a href='#examples'>Examples</a></li>
|
88
|
+
</ul>
|
89
|
+
</li>
|
90
|
+
|
91
|
+
<li><span class='maruku_section_number'>7. </span><a href='#features'>Other Features</a>
|
92
|
+
<ul style='list-style: none;'>
|
93
|
+
<li><span class='maruku_section_number'>7.1. </span><a href='#automatic_generation_of_the_table_of_contents'>Automatic generation of the table of contents</a></li>
|
94
|
+
|
95
|
+
<li><span class='maruku_section_number'>7.2. </span><a href='#this_header_contains_emphasis_strong_text_and_'>This header contains <em>emphasis</em> <strong>strong text</strong> and <code>code</code></a></li>
|
96
|
+
|
97
|
+
<li><span class='maruku_section_number'>7.3. </span><a href='#use_html_entities'>Use HTML entities</a></li>
|
98
|
+
</ul>
|
99
|
+
</li>
|
100
|
+
|
101
|
+
<li><span class='maruku_section_number'>8. </span><a href='#future'>Future developments</a>
|
102
|
+
<ul style='list-style: none;'>
|
103
|
+
<li><span class='maruku_section_number'>8.1. </span><a href='#a_syntax_for_adding_math'>A syntax for adding math</a></li>
|
104
|
+
</ul>
|
105
|
+
</li>
|
106
|
+
</ul>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<hr />
|
110
|
+
|
111
|
+
<h2 id='release_notes'><span class='maruku_section_number'>1. </span>Release notes - version 0.3.0 (January 3rd, 2007)</h2>
|
112
|
+
|
113
|
+
<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>
|
114
|
+
|
115
|
+
<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>
|
116
|
+
|
117
|
+
<p>Have fun!</p>
|
118
|
+
|
119
|
+
<p>Changes in 0.3.0:</p>
|
120
|
+
|
121
|
+
<ul>
|
122
|
+
<li>
|
123
|
+
<p>A real parser is used instead of a regexp-based system, also for span-level elements.</p>
|
124
|
+
|
125
|
+
<p>Now Maruku is almost 2x faster than Bluecloth, while having more features.</p>
|
126
|
+
|
127
|
+
<p>Here are some benchmarks:</p>
|
128
|
+
|
129
|
+
<pre><code>BlueCloth (to_html): parsing 0.00 sec + rendering 1.54 sec = 1.55 sec
|
130
|
+
Maruku (to_html): parsing 0.47 sec + rendering 0.38 sec = 0.85 sec
|
131
|
+
Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pre>
|
132
|
+
|
133
|
+
<p>This is the result of running <code>lib/maruku/tests/benchmark.rb</code> on the Markdown specification.</p>
|
134
|
+
</li>
|
135
|
+
|
136
|
+
<li>
|
137
|
+
<p>Prettier HTML output by adding whitespace.</p>
|
138
|
+
</li>
|
139
|
+
|
140
|
+
<li>
|
141
|
+
<p>Added a full suite of unit-tests for the span-level parser.</p>
|
142
|
+
</li>
|
143
|
+
|
144
|
+
<li>
|
145
|
+
<p>Error management: Having a real parser, Maruku warns you about syntax issues.</p>
|
146
|
+
|
147
|
+
<p>The default action is to warn and try to continue. If you do this:</p>
|
148
|
+
|
149
|
+
<pre><code>Maruku.new(string, {:on_error => :raise})
|
150
|
+
</code></pre>
|
151
|
+
|
152
|
+
<p>then syntax errors will cause an exception to be raised (you can catch this and retry).</p>
|
153
|
+
</li>
|
154
|
+
|
155
|
+
<li>
|
156
|
+
<p>Fixed a series of bugs in handling inline HTML code.</p>
|
157
|
+
</li>
|
158
|
+
</ul>
|
159
|
+
|
160
|
+
<p>Immediate TODO-list:</p>
|
161
|
+
|
162
|
+
<ul>
|
163
|
+
<li>
|
164
|
+
<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>
|
165
|
+
|
166
|
+
<p>For example: in the HTML version, you should see accented characters in this parenthesis: </p>
|
167
|
+
|
168
|
+
<blockquote>
|
169
|
+
<p>(àèìòù)</p>
|
170
|
+
</blockquote>
|
171
|
+
|
172
|
+
<p>and Japanese text in these other parentheses: </p>
|
173
|
+
|
174
|
+
<blockquote>
|
175
|
+
<p>(カタカナで 私の 名前は アンドレア チェンシ です).</p>
|
176
|
+
|
177
|
+
<p>(日本のガルは 大好き、でも、日本語は難しですから、そうぞ 英語話すガルを おしえてください).</p>
|
178
|
+
</blockquote>
|
179
|
+
|
180
|
+
<p>In the LaTeX version, these do not appear. I know how to do LaTeX with ISO-8859-1 encoding (European characters), but I'm struggling with half-baked solutions for UTF-8 encoded documents.</p>
|
181
|
+
</li>
|
182
|
+
|
183
|
+
<li>
|
184
|
+
<p>Implement the <a href='http://maruku.rubyforge.org/proposal.html'>new meta-data proposal</a>.</p>
|
185
|
+
</li>
|
186
|
+
|
187
|
+
<li>
|
188
|
+
<p>Exporting to Markdown (pretty printing).</p>
|
189
|
+
</li>
|
190
|
+
|
191
|
+
<li>
|
192
|
+
<p>Exporting to HTML splitting in multiple files.</p>
|
193
|
+
</li>
|
194
|
+
|
195
|
+
<li>
|
196
|
+
<p>RubyPants.</p>
|
197
|
+
</li>
|
198
|
+
|
199
|
+
<li>
|
200
|
+
<p>Support for images in PDF.</p>
|
201
|
+
</li>
|
202
|
+
</ul>
|
203
|
+
|
204
|
+
<h2 id='download'><span class='maruku_section_number'>2. </span>Download</h2>
|
205
|
+
|
206
|
+
<p>The development site is <a href='http://rubyforge.org/projects/maruku/'>http://rubyforge.org/projects/maruku/</a>.</p>
|
207
|
+
|
208
|
+
<p>Install with:</p>
|
209
|
+
|
210
|
+
<pre><code>$ gem install maruku
|
211
|
+
</code></pre>
|
212
|
+
|
213
|
+
<p>Released files can also be seen at <a href='http://rubyforge.org/frs/?group_id=2795'>http://rubyforge.org/frs/?group_id=2795</a>.</p>
|
214
|
+
|
215
|
+
<p>Anonymous access to the repository is possible with:</p>
|
216
|
+
|
217
|
+
<pre><code>$ svn checkout svn://rubyforge.org/var/svn/maruku
|
218
|
+
</code></pre>
|
219
|
+
|
220
|
+
<p>If you want commit access to the repository, just create an account on Rubyforge and <a href='http://www.dis.uniroma1.it/~acensi/contact.html'>drop me a mail</a>.</p>
|
221
|
+
|
222
|
+
<h3 id='bugs_report'><span class='maruku_section_number'>2.1. </span>Bugs report</h3>
|
223
|
+
|
224
|
+
<p>Use the <a href='http://rubyforge.org/tracker/?group_id=2795'>tracker</a> or <a href='http://www.dis.uniroma1.it/~acensi/contact.html'>drop me an email</a>.</p>
|
225
|
+
|
226
|
+
<h2 id='usage'><span class='maruku_section_number'>3. </span>Usage</h2>
|
227
|
+
|
228
|
+
<p>This is the basic usage:</p>
|
229
|
+
|
230
|
+
<pre class='ruby'><span class='ident'>require</span> <span class='punct'>'</span><span class='string'>rubygems</span><span class='punct'>'</span>
|
7
231
|
<span class='ident'>require</span> <span class='punct'>'</span><span class='string'>maruku</span><span class='punct'>'</span>
|
8
232
|
|
9
233
|
<span class='ident'>doc</span> <span class='punct'>=</span> <span class='constant'>Maruku</span><span class='punct'>.</span><span class='ident'>new</span><span class='punct'>(</span><span class='ident'>markdown_string</span><span class='punct'>)</span>
|
10
|
-
<span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html</span>
|
11
|
-
|
12
|
-
|
234
|
+
<span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html</span></pre>
|
235
|
+
|
236
|
+
<p>The method <code>to_html</code> outputs only an HTML fragment, while the method <code>to_html_document</code> outputs a complete XHTML 1.0 document:</p>
|
237
|
+
|
238
|
+
<pre class='ruby'><span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html_document</span></pre>
|
239
|
+
|
240
|
+
<p>You can have the REXML document tree with:</p>
|
241
|
+
|
242
|
+
<pre class='ruby'><span class='ident'>tree</span> <span class='punct'>=</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html_document_tree</span></pre>
|
243
|
+
|
244
|
+
<h3 id='from_the_command_line'><span class='maruku_section_number'>3.1. </span>From the command line</h3>
|
245
|
+
|
246
|
+
<p>There are two command-line programs installed: <code>maruku</code> and <code>marutex</code>.</p>
|
247
|
+
|
248
|
+
<ul>
|
249
|
+
<li>
|
250
|
+
<p><code>maruku</code> converts Markdown to HTML:</p>
|
251
|
+
|
252
|
+
<pre><code>$ maruku file.md # creates file.html</code></pre>
|
253
|
+
</li>
|
254
|
+
|
255
|
+
<li>
|
256
|
+
<p><code>marutex</code> converts Markdown to LaTeX, then calls <code>pdflatex</code> to transform to PDF</p>
|
257
|
+
|
258
|
+
<pre><code>$ marutex file.md # creates file.tex and file.pdf</code></pre>
|
259
|
+
</li>
|
260
|
+
</ul>
|
261
|
+
|
262
|
+
<h2 id='extra'><span class='maruku_section_number'>4. </span>Examples of PHP Markdown Extra syntax</h2>
|
263
|
+
|
264
|
+
<ul>
|
265
|
+
<li>
|
266
|
+
<p>tables</p>
|
267
|
+
|
268
|
+
<pre><code>Col1 | Very very long head | Very very long head|
|
13
269
|
-----|:-------------------:|-------------------:|
|
14
270
|
cell | center-align | right-align |
|
15
|
-
</pre
|
271
|
+
</code></pre>
|
272
|
+
|
273
|
+
<table class='example'>
|
274
|
+
<thead>
|
275
|
+
<tr><th>Col1</th><th>Very very long head</th><th>Very very long head</th></tr>
|
276
|
+
</thead>
|
277
|
+
<tbody>
|
278
|
+
<tr>
|
279
|
+
<td style='text-align: left;'>cell</td>
|
280
|
+
|
281
|
+
<td style='text-align: center;'>center-align</td>
|
282
|
+
|
283
|
+
<td style='text-align: right;'>right-align</td>
|
284
|
+
</tr>
|
285
|
+
</tbody></table>
|
286
|
+
</li>
|
287
|
+
|
288
|
+
<li>
|
289
|
+
<p>footnotes <sup id='fnref:1'><a href='#fn:1' rel='footnote'>1</a></sup></p>
|
290
|
+
|
291
|
+
<pre><code>* footnotes [^foot]
|
292
|
+
|
293
|
+
[^foot]: I really was missing those.</code></pre>
|
294
|
+
</li>
|
295
|
+
|
296
|
+
<li>
|
297
|
+
<p>Markdown inside HTML elememnts</p>
|
298
|
+
</li>
|
299
|
+
</ul>
|
16
300
|
|
17
|
-
|
301
|
+
<pre class='xml'><span class='punct'><</span><span class='tag'>div</span> <span class='attribute'>markdown</span><span class='punct'>="</span><span class='string'>1</span><span class='punct'>"</span> <span class='attribute'>style</span><span class='punct'>="</span><span class='string'>border: solid 1px black</span><span class='punct'>"></span>
|
18
302
|
This is a div with Markdown **strong text**
|
19
|
-
<span class='punct'></</span><span class='tag'>div</span><span class='punct'>></span>
|
20
|
-
|
21
|
-
|
303
|
+
<span class='punct'></</span><span class='tag'>div</span><span class='punct'>></span></pre>
|
304
|
+
|
305
|
+
<div style='border: solid 1px black'>
|
306
|
+
<p>This is a div with Markdown <strong>strong text</strong></p>
|
307
|
+
</div>
|
308
|
+
|
309
|
+
<ul>
|
310
|
+
<li>
|
311
|
+
<p>header ids</p>
|
312
|
+
|
313
|
+
<pre><code>## Download ## {#download}
|
314
|
+
</code></pre>
|
315
|
+
|
316
|
+
<p>For example, <a href='#download'>a link to the download</a> header.</p>
|
317
|
+
|
318
|
+
<p>Note that you can use also the new <a href='#meta'>meta-data syntax</a> for the same purpose:</p>
|
319
|
+
|
320
|
+
<pre><code>@ id: download
|
321
|
+
## Header ## </code></pre>
|
322
|
+
</li>
|
323
|
+
|
324
|
+
<li>
|
325
|
+
<p>definition lists</p>
|
326
|
+
|
327
|
+
<pre><code>Definition list
|
22
328
|
: something very hard to parse
|
23
|
-
</
|
329
|
+
</code></pre>
|
330
|
+
|
331
|
+
<dl>
|
332
|
+
<dt>Definition list</dt>
|
333
|
+
|
334
|
+
<dd>something very hard to parse</dd>
|
335
|
+
</dl>
|
336
|
+
</li>
|
337
|
+
|
338
|
+
<li>
|
339
|
+
<p>abbreviations or <abbr title='Simply an abbreviation'>ABB</abbr> for short.</p>
|
340
|
+
</li>
|
341
|
+
</ul>
|
342
|
+
|
343
|
+
<h2 id='maruku-and-bluecloth'><span class='maruku_section_number'>5. </span>Maruku and Bluecloth</h2>
|
344
|
+
|
345
|
+
<p>The other Ruby implementation of Markdown is <a href='http://www.deveiate.org/projects/BlueCloth'>Bluecloth</a>. </p>
|
346
|
+
|
347
|
+
<p>Maruku is much different in philosophy from Bluecloth: the biggest difference is that <em>parsing</em> is separated from <em>rendering</em>. In Maruku, an in-memory representation of the Markdown document is created. Instead, Bluecloth mantains the document in memory as a String at all times, and does a series of <code>gsub</code> to transform to HTML.</p>
|
348
|
+
|
349
|
+
<p>The in-memory representation makes it very easy to export to various formats (at the moment HTML and LaTeX/PDF; the next is pretty-printed Markdown).</p>
|
350
|
+
|
351
|
+
<p>Other improvements over Bluecloth:</p>
|
352
|
+
|
353
|
+
<ul>
|
354
|
+
<li>
|
355
|
+
<p>the HTML output is provided also as a <code>REXML</code> document tree.</p>
|
356
|
+
</li>
|
357
|
+
|
358
|
+
<li>
|
359
|
+
<p>PHP Markdown Syntax support.</p>
|
360
|
+
</li>
|
361
|
+
</ul>
|
362
|
+
|
363
|
+
<h2 id='meta'><span class='maruku_section_number'>6. </span>New meta-data syntax</h2>
|
364
|
+
|
365
|
+
<p>Maruku implements a syntax that allows to attach "meta" information to objects.</p>
|
366
|
+
|
367
|
+
<h3 id='metadata_for_the_document'><span class='maruku_section_number'>6.1. </span>Meta-data for the document</h3>
|
368
|
+
|
369
|
+
<p>Meta-data for the document itself is specified through the use of email headers:</p>
|
370
|
+
|
371
|
+
<pre><code>Title: A simple document containing meta-headers
|
24
372
|
CSS: style.css
|
25
373
|
|
26
374
|
Content of the document
|
27
|
-
</pre
|
28
|
-
|
375
|
+
</code></pre>
|
376
|
+
|
377
|
+
<p>When creating the document through </p>
|
378
|
+
|
379
|
+
<pre class='ruby'><span class='constant'>Maruku</span><span class='punct'>.</span><span class='ident'>new</span><span class='punct'>(</span><span class='ident'>s</span><span class='punct'>).</span><span class='ident'>to_html_document</span></pre>
|
380
|
+
|
381
|
+
<p>the title and stylesheet are added as expected.</p>
|
382
|
+
|
383
|
+
<p>Meta-data keys are assumed to be case-insensitive.</p>
|
384
|
+
|
385
|
+
<h3 id='metadata_for_elements'><span class='maruku_section_number'>6.2. </span>Meta-data for elements</h3>
|
386
|
+
|
387
|
+
<p>Maruku introduces a new syntax for attaching metadata to paragraphs, tables, and so on.</p>
|
388
|
+
|
389
|
+
<p>For example, consider the creation of two paragraphs:</p>
|
390
|
+
|
391
|
+
<pre><code>Paragraph 1 is a warning.
|
29
392
|
|
30
393
|
Paragraph 2
|
31
|
-
</pre
|
394
|
+
</code></pre>
|
395
|
+
|
396
|
+
<p>Now you really want to attach a 'class' attribute to the paragraphs (for example for CSS styling). Maruku allows you to use:</p>
|
397
|
+
|
398
|
+
<pre><code>@ class: warning
|
32
399
|
Paragraph 1 is a warning
|
33
400
|
|
34
401
|
Paragraph 2
|
35
402
|
|
36
|
-
</pre
|
403
|
+
</code></pre>
|
404
|
+
|
405
|
+
<p>You can add more by separating with a <code>;</code>:</p>
|
406
|
+
|
407
|
+
<pre><code>@ class: warning; id: warning1
|
37
408
|
Paragraph 1 is a warning
|
38
|
-
</pre
|
409
|
+
</code></pre>
|
410
|
+
|
411
|
+
<p>A meta-data declaration is composed of </p>
|
412
|
+
|
413
|
+
<ol>
|
414
|
+
<li>newline</li>
|
415
|
+
|
416
|
+
<li>an at-symbol <code>@</code></li>
|
417
|
+
|
418
|
+
<li>a series of name-value pairs. Each name-value is separated by a colon <code>:</code>, pairs are separated by semi-colons <code>;</code> </li>
|
419
|
+
</ol>
|
420
|
+
|
421
|
+
<p>Many declaration can be used, and they refer to <em>the following</em> object:</p>
|
422
|
+
|
423
|
+
<pre><code>@ class: warning
|
39
424
|
@ id: warning1
|
40
425
|
Paragraph 1 is a warning
|
41
|
-
</pre
|
426
|
+
</code></pre>
|
427
|
+
|
428
|
+
<p>These can also be separated by newlines:</p>
|
429
|
+
|
430
|
+
<pre><code>@ class: warning
|
42
431
|
|
43
432
|
@ id: warning1
|
44
433
|
|
45
434
|
Paragraph 1 is a warning
|
46
435
|
|
47
|
-
</pre
|
436
|
+
</code></pre>
|
437
|
+
|
438
|
+
<h3 id='shortcuts'><span class='maruku_section_number'>6.3. </span>Shortcuts</h3>
|
439
|
+
|
440
|
+
<p>This:</p>
|
441
|
+
|
442
|
+
<pre><code>@ .xyz
|
48
443
|
Paragraph
|
49
|
-
</pre
|
444
|
+
</code></pre>
|
445
|
+
|
446
|
+
<p>is equivalent to:</p>
|
447
|
+
|
448
|
+
<pre><code>@ class: xyz
|
50
449
|
Paragraph
|
51
|
-
</pre
|
450
|
+
</code></pre>
|
451
|
+
|
452
|
+
<p>This:</p>
|
453
|
+
|
454
|
+
<pre><code>@ #xyz
|
52
455
|
Paragraph
|
53
|
-
</pre
|
456
|
+
</code></pre>
|
457
|
+
|
458
|
+
<p>is equivalent to:</p>
|
459
|
+
|
460
|
+
<pre><code>@ id: xyz
|
54
461
|
Paragraph
|
55
|
-
</pre
|
462
|
+
</code></pre>
|
463
|
+
|
464
|
+
<p>Also, if the value is not present, it defaults to <code>true</code>:</p>
|
465
|
+
|
466
|
+
<pre><code>@ test
|
56
467
|
|
57
468
|
This paragraph has the attribute `test` set to `true`.
|
58
|
-
</
|
469
|
+
</code></pre>
|
470
|
+
|
471
|
+
<hr />
|
472
|
+
|
473
|
+
<h3 id='metalist'><span class='maruku_section_number'>6.4. </span>List of meta-data</h3>
|
474
|
+
|
475
|
+
<dl>
|
476
|
+
<dt><strong><code>title</code>, <code>subject</code></strong></dt>
|
477
|
+
|
478
|
+
<dd>
|
479
|
+
<p>(document) Sets the title of the document (HTML: used in the <code>TITLE</code> element).</p>
|
480
|
+
</dd>
|
481
|
+
|
482
|
+
<dt><strong><code>use_numbered_headers</code></strong></dt>
|
483
|
+
|
484
|
+
<dd>
|
485
|
+
<p>(document) If <code>true</code>, headers are numbered (just like this document). Default is <code>false</code>.</p>
|
486
|
+
</dd>
|
487
|
+
|
488
|
+
<dt><strong><code>css</code></strong></dt>
|
489
|
+
|
490
|
+
<dd>
|
491
|
+
<p>(document, HTML) Url of stylesheet.</p>
|
492
|
+
</dd>
|
493
|
+
|
494
|
+
<dt><strong><code>html_use_syntax</code></strong></dt>
|
495
|
+
|
496
|
+
<dd>
|
497
|
+
<p>(document, HTML) If set, use the <a href='http://syntax.rubyforge.org/'>Ruby <code>syntax</code> library</a> to add source highlighting.</p>
|
498
|
+
</dd>
|
499
|
+
|
500
|
+
<dt><strong><code>latex_use_listings</code></strong></dt>
|
501
|
+
|
502
|
+
<dd>
|
503
|
+
<p>(document, LaTeX) If set, use the fancy <a href='http://www.ctan.org/tex-archive/macros/latex/contrib/listings/'><code>listings</code> package</a> for better displaying code blocks.</p>
|
504
|
+
|
505
|
+
<p> If not set, use standard <code>verbatim</code> environment.</p>
|
506
|
+
</dd>
|
507
|
+
|
508
|
+
<dt><strong><code>style</code>, <code>id</code>, <code>class</code></strong></dt>
|
509
|
+
|
510
|
+
<dd>
|
511
|
+
<p>(any block object, HTML) Standard CSS attributes are copied.</p>
|
512
|
+
</dd>
|
513
|
+
|
514
|
+
<dt><strong><code>lang</code></strong></dt>
|
515
|
+
|
516
|
+
<dd>
|
517
|
+
<p>(code blocks) Name of programming language (<code>ruby</code>) for syntax highlighting.</p>
|
518
|
+
|
519
|
+
<p> Default for this is <code>code_lang</code> in document.</p>
|
520
|
+
|
521
|
+
<p> Syntax highlighting is delegated to the <a href='http://syntax.rubyforge.org/'><code>syntax</code> library</a> for HTML output and to the <a href='http://www.ctan.org/tex-archive/macros/latex/contrib/listings/'><code>listings</code> package</a> for LaTeX output.</p>
|
522
|
+
</dd>
|
523
|
+
|
524
|
+
<dt><strong><code>code_show_spaces</code></strong></dt>
|
525
|
+
|
526
|
+
<dd>
|
527
|
+
<p>Shows tabs and newlines (default is read in the document object).</p>
|
528
|
+
</dd>
|
529
|
+
|
530
|
+
<dt><strong><code>code_background_color</code></strong></dt>
|
531
|
+
|
532
|
+
<dd>
|
533
|
+
<p>Background color for code blocks. (default is read in the document object).</p>
|
534
|
+
|
535
|
+
<p>The format is either a named color (<code>green</code>, <code>red</code>) or a CSS color of the form <code>#ff00ff</code>. </p>
|
536
|
+
|
537
|
+
<ul>
|
538
|
+
<li>
|
539
|
+
<p>for <strong>HTML output</strong>, the value is put straight in the <code>background-color</code> CSS property of the block.</p>
|
540
|
+
</li>
|
541
|
+
|
542
|
+
<li>
|
543
|
+
<p>for <strong>LaTeX output</strong>, if it is a named color, it must be a color accepted by the LaTeX <code>color</code> packages. If it is of the form <code>#ff00ff</code>, Maruku defines a color using the <code>\color[rgb]{r,g,b}</code> macro. </p>
|
544
|
+
|
545
|
+
<p>For example, for <code>#0000ff</code>, the macro is called as: <code>\color[rgb]{0,0,1}</code>.</p>
|
546
|
+
</li>
|
547
|
+
</ul>
|
548
|
+
</dd>
|
549
|
+
</dl>
|
550
|
+
|
551
|
+
<h3 id='examples'><span class='maruku_section_number'>6.5. </span>Examples</h3>
|
552
|
+
|
553
|
+
<p>An example of this is the following:</p>
|
554
|
+
|
555
|
+
<pre><code>@¬code_show_spaces;¬code_background_color:¬green
|
59
556
|
|
60
557
|
» ¬One¬space
|
61
558
|
» ¬¬Two¬spaces
|
62
559
|
» » ¬» Tab,¬space,¬tab
|
63
560
|
» » » » Tab,¬tab,¬tab¬and¬all¬is¬green!
|
64
|
-
</pre
|
561
|
+
</code></pre>
|
562
|
+
|
563
|
+
<p>That will produce:</p>
|
564
|
+
|
565
|
+
<pre style='background-color: green;'><code>¬One¬space
|
65
566
|
¬¬Two¬spaces
|
66
567
|
» ¬» Tab,¬space,¬tab
|
67
568
|
» » » Tab,¬tab,¬tab¬and¬all¬is¬green!
|
68
|
-
</pre
|
569
|
+
</code></pre>
|
570
|
+
|
571
|
+
<p>Example with css-style color:</p>
|
572
|
+
|
573
|
+
<pre><code>@ code_background_color: #455678
|
69
574
|
|
70
575
|
A strange color
|
71
|
-
</pre
|
72
|
-
|
576
|
+
</code></pre>
|
577
|
+
|
578
|
+
<p>produces:</p>
|
579
|
+
|
580
|
+
<pre style='background-color: #455678;'><code>A strange color
|
581
|
+
</code></pre>
|
582
|
+
|
583
|
+
<p>Or highlighting (does not work well yet):</p>
|
584
|
+
|
585
|
+
<pre><code>@ lang: xml
|
73
586
|
<div style="text-align:center">Div</div>
|
74
|
-
</pre
|
587
|
+
</code></pre>
|
588
|
+
|
589
|
+
<p>produces:</p>
|
590
|
+
|
591
|
+
<pre class='xml'><span class='punct'><</span><span class='tag'>div</span> <span class='attribute'>style</span><span class='punct'>="</span><span class='string'>text-align:center</span><span class='punct'>"></span>Div<span class='punct'></</span><span class='tag'>div</span><span class='punct'>></span></pre>
|
75
592
|
|
593
|
+
<hr />
|
76
594
|
|
77
|
-
|
595
|
+
<h2 id='features'><span class='maruku_section_number'>7. </span>Other Features</h2>
|
596
|
+
|
597
|
+
<h3 id='automatic_generation_of_the_table_of_contents'><span class='maruku_section_number'>7.1. </span>Automatic generation of the table of contents</h3>
|
598
|
+
|
599
|
+
<p>If you create a list, and then set the <code>toc</code> attribute, when rendering Maruku will create an auto-generated table of contents.</p>
|
600
|
+
|
601
|
+
<pre><code>@ toc
|
78
602
|
* This will become a table of contents (this text will be scraped).
|
79
|
-
</
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
603
|
+
</code></pre>
|
604
|
+
|
605
|
+
<p>You can see an example of this at the beginning of this document.</p>
|
606
|
+
|
607
|
+
<h3 id='this_header_contains_emphasis_strong_text_and_'><span class='maruku_section_number'>7.2. </span>This header contains <em>emphasis</em> <strong>strong text</strong> and <code>code</code></h3>
|
608
|
+
|
609
|
+
<p>Note that this header contains formatting and it still works, also in the table of contents.</p>
|
610
|
+
|
611
|
+
<p>And <a href='#features'>This is a <em>link</em> with <strong>all</strong> <strong><em>sort</em></strong> of <code>weird stuff</code></a> in the text.</p>
|
612
|
+
|
613
|
+
<h3 id='use_html_entities'><span class='maruku_section_number'>7.3. </span>Use HTML entities</h3>
|
614
|
+
|
615
|
+
<p>If you want to use HTML entities, go on! We will take care of the translation to LaTeX:</p>
|
616
|
+
|
617
|
+
<table>
|
618
|
+
<thead>
|
619
|
+
<tr><th>Entity</th><th>Result</th></tr>
|
620
|
+
</thead>
|
621
|
+
<tbody>
|
622
|
+
<tr>
|
623
|
+
<td style='text-align: left;'><code>&copy;</code></td>
|
624
|
+
|
625
|
+
<td style='text-align: left;'>©</td>
|
626
|
+
</tr>
|
627
|
+
|
628
|
+
<tr>
|
629
|
+
<td style='text-align: left;'><code>&pound;</code></td>
|
630
|
+
|
631
|
+
<td style='text-align: left;'>£</td>
|
632
|
+
</tr>
|
633
|
+
|
634
|
+
<tr>
|
635
|
+
<td style='text-align: left;'><code>a&nbsp;b</code></td>
|
636
|
+
|
637
|
+
<td style='text-align: left;'>a b</td>
|
638
|
+
</tr>
|
639
|
+
|
640
|
+
<tr>
|
641
|
+
<td style='text-align: left;'><code>&lambda;</code></td>
|
642
|
+
|
643
|
+
<td style='text-align: left;'>λ</td>
|
644
|
+
</tr>
|
645
|
+
|
646
|
+
<tr>
|
647
|
+
<td style='text-align: left;'><code>&mdash;</code></td>
|
648
|
+
|
649
|
+
<td style='text-align: left;'>—</td>
|
650
|
+
</tr>
|
651
|
+
</tbody></table>
|
652
|
+
|
653
|
+
<h2 id='future'><span class='maruku_section_number'>8. </span>Future developments</h2>
|
654
|
+
|
655
|
+
<p>I think that <a href='http://sophos.berkeley.edu/macfarlane/pandoc/'>Pandoc</a> and <a href='http://fletcher.freeshell.org/wiki/MultiMarkdown'>MultiMarkdown</a> are very cool projects. However, they are written in Haskell and Perl, respectively. I would love to have an equivalent in Ruby.</p>
|
656
|
+
|
657
|
+
<h3 id='a_syntax_for_adding_math'><span class='maruku_section_number'>8.1. </span>A syntax for adding math</h3>
|
658
|
+
|
659
|
+
<p>Something inspired from LaTeX should be familiar to all:</p>
|
660
|
+
|
661
|
+
<pre><code>This is inline math: $\alpha$
|
110
662
|
|
111
663
|
|
112
664
|
This is an equation with label:
|
113
665
|
|
114
666
|
$ \alpha = \beta + \gamma $ (eq:1)
|
115
667
|
|
116
|
-
This is a reference to equation: please see (eq:1)
|
668
|
+
This is a reference to equation: please see (eq:1)</code></pre>
|
669
|
+
|
670
|
+
<div class='footnotes'>
|
671
|
+
<hr />
|
672
|
+
|
673
|
+
<ol>
|
674
|
+
<li id='fn:1'>
|
675
|
+
<p>I really was missing those.<a href='#fnref:1' rev='footnote'>↩</a></p>
|
676
|
+
</li>
|
677
|
+
</ol>
|
678
|
+
</div>
|
117
679
|
|
118
|
-
|
680
|
+
<div class='maruku_signature'>
|
681
|
+
<hr />
|
682
|
+
<span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a> at 00:33 on Wednesday, January 03rd, 2007.</span></div>
|
683
|
+
</body></html>
|