maruku 0.4.2.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/bin/maruku +66 -20
  2. data/bin/marutest +12 -2
  3. data/docs/changelog.html +188 -23
  4. data/docs/changelog.md +128 -5
  5. data/docs/entity_test.html +245 -240
  6. data/docs/entity_test.md +2 -0
  7. data/docs/exd.html +181 -23
  8. data/docs/index.html +130 -349
  9. data/docs/markdown_syntax.html +55 -51
  10. data/docs/maruku.html +130 -349
  11. data/docs/maruku.md +154 -339
  12. data/docs/math.md +143 -0
  13. data/docs/proposal.html +16 -12
  14. data/lib/maruku.rb +6 -3
  15. data/lib/maruku/attributes.rb +7 -2
  16. data/lib/maruku/defaults.rb +27 -27
  17. data/lib/maruku/errors_management.rb +10 -9
  18. data/lib/maruku/ext/diagrams/diagrams.rb +8 -0
  19. data/lib/maruku/ext/diagrams/grid.rb +78 -0
  20. data/lib/maruku/ext/diagrams/inspect.rb +11 -0
  21. data/lib/maruku/ext/diagrams/layout.rb +105 -0
  22. data/lib/maruku/ext/diagrams/parser.rb +219 -0
  23. data/lib/maruku/ext/diagrams/structures.rb +168 -0
  24. data/lib/maruku/ext/diagrams/to_html.rb +37 -0
  25. data/lib/maruku/ext/diagrams/to_latex.rb +308 -0
  26. data/lib/maruku/ext/diagrams/unittest.rb +123 -0
  27. data/lib/maruku/ext/math.rb +11 -0
  28. data/lib/maruku/ext/math/elements.rb +26 -0
  29. data/lib/maruku/ext/math/mathml_engines/blahtex.rb +108 -0
  30. data/lib/maruku/ext/math/mathml_engines/itex2mml.rb +29 -0
  31. data/lib/maruku/ext/math/mathml_engines/none.rb +20 -0
  32. data/lib/maruku/ext/math/mathml_engines/ritex.rb +24 -0
  33. data/lib/maruku/ext/math/parsing.rb +82 -0
  34. data/lib/maruku/ext/math/to_html.rb +178 -0
  35. data/lib/maruku/ext/math/to_latex.rb +21 -0
  36. data/lib/maruku/helpers.rb +11 -0
  37. data/lib/maruku/input/charsource.rb +1 -1
  38. data/lib/maruku/input/extensions.rb +68 -0
  39. data/lib/maruku/input/html_helper.rb +91 -60
  40. data/lib/maruku/input/parse_block.rb +10 -9
  41. data/lib/maruku/input/parse_doc.rb +21 -13
  42. data/lib/maruku/input/parse_span_better.rb +19 -8
  43. data/lib/maruku/input/type_detection.rb +5 -3
  44. data/lib/maruku/output/to_html.rb +236 -67
  45. data/lib/maruku/output/to_latex.rb +69 -26
  46. data/lib/maruku/output/to_latex_entities.rb +14 -2
  47. data/lib/maruku/output/to_s.rb +8 -0
  48. data/lib/maruku/structures.rb +1 -1
  49. data/lib/maruku/tests/benchmark.rb +2 -2
  50. data/lib/maruku/tests/new_parser.rb +13 -5
  51. data/lib/maruku/version.rb +1 -1
  52. data/lib/sort_prof.rb +22 -0
  53. data/tests/diagrams/diagrams.md +54 -0
  54. data/tests/math/syntax.md +46 -0
  55. data/tests/math_usage/document.md +13 -0
  56. data/tests/unittest/attributes/attributes.md +50 -6
  57. data/tests/unittest/easy.md +1 -1
  58. data/tests/unittest/email.md +3 -3
  59. data/tests/unittest/entities.md +12 -7
  60. data/tests/unittest/escaping.md +4 -4
  61. data/tests/unittest/extra_table1.md +3 -1
  62. data/tests/unittest/footnotes.md +5 -5
  63. data/tests/unittest/headers.md +3 -3
  64. data/tests/unittest/images.md +7 -7
  65. data/tests/unittest/inline_html.md +51 -5
  66. data/tests/unittest/links.md +7 -7
  67. data/tests/unittest/list2.md +1 -1
  68. data/tests/unittest/lists.md +1 -1
  69. data/tests/unittest/lists_after_paragraph.md +1 -1
  70. data/tests/unittest/lists_ol.md +1 -1
  71. data/tests/unittest/math/equations.md +82 -0
  72. data/tests/unittest/math/inline.md +80 -0
  73. data/tests/unittest/math/table.md +51 -0
  74. data/tests/unittest/math/table2.md +67 -0
  75. data/tests/unittest/misc_sw.md +24 -24
  76. data/tests/unittest/notyet/ticks.md +1 -1
  77. data/tests/unittest/references/long_example.md +2 -2
  78. data/tests/unittest/smartypants.md +4 -4
  79. data/tests/unittest/xml.md +68 -0
  80. data/tests/unittest/xml2.md +36 -0
  81. data/tests/unittest/xml3.md +52 -0
  82. data/tests/unittest/xml_instruction.md +5 -5
  83. metadata +33 -4
  84. data/docs/a.html +0 -6
  85. data/docs/char.html +0 -1924
@@ -1,7 +1,11 @@
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'><head><meta content='text/html; charset=utf-8' http-equiv='Content-type' /><title>Markdown: Syntax</title><link href='style.css' rel='stylesheet' type='text/css' /></head><body>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC
3
+ "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
4
+ "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
5
+ <html xmlns:svg='http://www.w3.org/2000/svg' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
6
+ <head><meta content='application/xhtml+xml;charset=utf-8' http-equiv='Content-type' /><title>Markdown: Syntax</title><link href='style.css' rel='stylesheet' type='text/css' />
7
+ </head>
8
+ <body>
5
9
  <h1 id='markdown_syntax'>Markdown: Syntax</h1>
6
10
  <ul id='ProjectSubmenu'>
7
11
  <li><a href='/projects/markdown/' title='Markdown Project Page'>Main</a></li>
@@ -66,21 +70,21 @@
66
70
  </li>
67
71
  </ul>
68
72
 
69
- <p><strong>Note:</strong> This document is itself written using Markdown; you can <a href='/projects/markdown/syntax.text'>see the source for it by adding &lsquo;.text&rsquo; to the URL</a>.</p>
73
+ <p><strong>Note:</strong> This document is itself written using Markdown; you can <a href='/projects/markdown/syntax.text'>see the source for it by adding &#8216;.text&#8217; to the URL</a>.</p>
70
74
  <hr /><h2 id='overview'>Overview</h2><h3 id='philosophy'>Philosophy</h3>
71
75
  <p>Markdown is intended to be as easy-to-read and easy-to-write as is feasible.</p>
72
76
 
73
- <p>Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it&rsquo;s been marked up with tags or formatting instructions. While Markdown&rsquo;s syntax has been influenced by several existing text-to-HTML filters &ndash; including <a href='http://docutils.sourceforge.net/mirror/setext.html'>Setext</a>, <a href='http://www.aaronsw.com/2002/atx/'>atx</a>, <a href='http://textism.com/tools/textile/'>Textile</a>, <a href='http://docutils.sourceforge.net/rst.html'>reStructuredText</a>, <a href='http://www.triptico.com/software/grutatxt.html'>Grutatext</a>, and <a href='http://ettext.taint.org/doc/'>EtText</a> &ndash; the single biggest source of inspiration for Markdown&rsquo;s syntax is the format of plain text email.</p>
77
+ <p>Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it&#8217;s been marked up with tags or formatting instructions. While Markdown&#8217;s syntax has been influenced by several existing text-to-HTML filters &#8211; including <a href='http://docutils.sourceforge.net/mirror/setext.html'>Setext</a>, <a href='http://www.aaronsw.com/2002/atx/'>atx</a>, <a href='http://textism.com/tools/textile/'>Textile</a>, <a href='http://docutils.sourceforge.net/rst.html'>reStructuredText</a>, <a href='http://www.triptico.com/software/grutatxt.html'>Grutatext</a>, and <a href='http://ettext.taint.org/doc/'>EtText</a> &#8211; the single biggest source of inspiration for Markdown&#8217;s syntax is the format of plain text email.</p>
74
78
 
75
- <p>To this end, Markdown&rsquo;s syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like *emphasis*. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you&rsquo;ve ever used email.</p>
79
+ <p>To this end, Markdown&#8217;s syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like *emphasis*. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you&#8217;ve ever used email.</p>
76
80
  <h3 id='html'>Inline HTML</h3>
77
- <p>Markdown&rsquo;s syntax is intended for one purpose: to be used as a format for <em>writing</em> for the web.</p>
81
+ <p>Markdown&#8217;s syntax is intended for one purpose: to be used as a format for <em>writing</em> for the web.</p>
78
82
 
79
- <p>Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is <em>not</em> to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a <em>publishing</em> format; Markdown is a <em>writing</em> format. Thus, Markdown&rsquo;s formatting syntax only addresses issues that can be conveyed in plain text.</p>
83
+ <p>Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is <em>not</em> to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a <em>publishing</em> format; Markdown is a <em>writing</em> format. Thus, Markdown&#8217;s formatting syntax only addresses issues that can be conveyed in plain text.</p>
80
84
 
81
- <p>For any markup that is not covered by Markdown&rsquo;s syntax, you simply use HTML itself. There&rsquo;s no need to preface it or delimit it to indicate that you&rsquo;re switching from Markdown to HTML; you just use the tags.</p>
85
+ <p>For any markup that is not covered by Markdown&#8217;s syntax, you simply use HTML itself. There&#8217;s no need to preface it or delimit it to indicate that you&#8217;re switching from Markdown to HTML; you just use the tags.</p>
82
86
 
83
- <p>The only restrictions are that block-level HTML elements &ndash; e.g. <code>&lt;div&gt;</code>, <code>&lt;table&gt;</code>, <code>&lt;pre&gt;</code>, <code>&lt;p&gt;</code>, etc. &ndash; must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) <code>&lt;p&gt;</code> tags around HTML block-level tags.</p>
87
+ <p>The only restrictions are that block-level HTML elements &#8211; e.g. <code>&lt;div&gt;</code>, <code>&lt;table&gt;</code>, <code>&lt;pre&gt;</code>, <code>&lt;p&gt;</code>, etc. &#8211; must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) <code>&lt;p&gt;</code> tags around HTML block-level tags.</p>
84
88
 
85
89
  <p>For example, to add an HTML table to a Markdown article:</p>
86
90
  <pre><code>This is a regular paragraph.
@@ -93,15 +97,15 @@
93
97
 
94
98
  This is another regular paragraph.
95
99
  </code></pre>
96
- <p>Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can&rsquo;t use Markdown-style <code>*emphasis*</code> inside an HTML block.</p>
100
+ <p>Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can&#8217;t use Markdown-style <code>*emphasis*</code> inside an HTML block.</p>
97
101
 
98
- <p>Span-level HTML tags &ndash; e.g. <code>&lt;span&gt;</code>, <code>&lt;cite&gt;</code>, or <code>&lt;del&gt;</code> &ndash; can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you&rsquo;d prefer to use HTML <code>&lt;a&gt;</code> or <code>&lt;img&gt;</code> tags instead of Markdown&rsquo;s link or image syntax, go right ahead.</p>
102
+ <p>Span-level HTML tags &#8211; e.g. <code>&lt;span&gt;</code>, <code>&lt;cite&gt;</code>, or <code>&lt;del&gt;</code> &#8211; can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you&#8217;d prefer to use HTML <code>&lt;a&gt;</code> or <code>&lt;img&gt;</code> tags instead of Markdown&#8217;s link or image syntax, go right ahead.</p>
99
103
 
100
104
  <p>Unlike block-level HTML tags, Markdown syntax <em>is</em> processed within span-level tags.</p>
101
105
  <h3 id='autoescape'>Automatic Escaping for Special Characters</h3>
102
106
  <p>In HTML, there are two characters that demand special treatment: <code>&lt;</code> and <code>&amp;</code>. Left angle brackets are used to start tags; ampersands are used to denote HTML entities. If you want to use them as literal characters, you must escape them as entities, e.g. <code>&amp;lt;</code>, and <code>&amp;amp;</code>.</p>
103
107
 
104
- <p>Ampersands in particular are bedeviling for web writers. If you want to write about &lsquo;AT&amp;T&rsquo;, you need to write &rsquo;<code>AT&amp;amp;T</code>&rsquo;. You even need to escape ampersands within URLs. Thus, if you want to link to:</p>
108
+ <p>Ampersands in particular are bedeviling for web writers. If you want to write about &#8216;AT&amp;T&#8217;, you need to write &#8217;<code>AT&amp;amp;T</code>&#8217;. You even need to escape ampersands within URLs. Thus, if you want to link to:</p>
105
109
  <pre><code>http://images.google.com/images?num=30&amp;q=larry+bird
106
110
  </code></pre>
107
111
  <p>you need to encode the URL as:</p>
@@ -128,24 +132,24 @@ This is another regular paragraph.
128
132
  </code></pre>
129
133
  <p>However, inside Markdown code spans and blocks, angle brackets and ampersands are <em>always</em> encoded automatically. This makes it easy to use Markdown to write about HTML code. (As opposed to raw HTML, which is a terrible format for writing about HTML syntax, because every single <code>&lt;</code> and <code>&amp;</code> in your example code needs to be escaped.)</p>
130
134
  <hr /><h2 id='block'>Block Elements</h2><h3 id='p'>Paragraphs and Line Breaks</h3>
131
- <p>A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line &ndash; a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.</p>
135
+ <p>A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line &#8211; a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.</p>
132
136
 
133
- <p>The implication of the &ldquo;one or more consecutive lines of text&rdquo; rule is that Markdown supports &ldquo;hard-wrapped&rdquo; text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type&rsquo;s &ldquo;Convert Line Breaks&rdquo; option) which translate every line break character in a paragraph into a <code>&lt;br /&gt;</code> tag.</p>
137
+ <p>The implication of the &#8220;one or more consecutive lines of text&#8221; rule is that Markdown supports &#8220;hard-wrapped&#8221; text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type&#8217;s &#8220;Convert Line Breaks&#8221; option) which translate every line break character in a paragraph into a <code>&lt;br /&gt;</code> tag.</p>
134
138
 
135
139
  <p>When you <em>do</em> want to insert a <code>&lt;br /&gt;</code> break tag using Markdown, you end a line with two or more spaces, then type return.</p>
136
140
 
137
- <p>Yes, this takes a tad more effort to create a <code>&lt;br /&gt;</code>, but a simplistic &ldquo;every line break is a <code>&lt;br /&gt;</code>&rdquo; rule wouldn&rsquo;t work for Markdown. Markdown&rsquo;s email-style <a href='#blockquote'>blockquoting</a> and multi-paragraph <a href='#list'>list items</a> work best &ndash; and look better &ndash; when you format them with hard breaks.</p>
141
+ <p>Yes, this takes a tad more effort to create a <code>&lt;br /&gt;</code>, but a simplistic &#8220;every line break is a <code>&lt;br /&gt;</code>&#8221; rule wouldn&#8217;t work for Markdown. Markdown&#8217;s email-style <a href='#blockquote'>blockquoting</a> and multi-paragraph <a href='#list'>list items</a> work best &#8211; and look better &#8211; when you format them with hard breaks.</p>
138
142
  <h3 id='header'>Headers</h3>
139
143
  <p>Markdown supports two styles of headers, <a href='http://docutils.sourceforge.net/mirror/setext.html'>Setext</a> and <a href='http://www.aaronsw.com/2002/atx/'>atx</a>.</p>
140
144
 
141
- <p>Setext-style headers are &ldquo;underlined&rdquo; using equal signs (for first-level headers) and dashes (for second-level headers). For example:</p>
145
+ <p>Setext-style headers are &#8220;underlined&#8221; using equal signs (for first-level headers) and dashes (for second-level headers). For example:</p>
142
146
  <pre><code>This is an H1
143
147
  =============
144
148
 
145
149
  This is an H2
146
150
  -------------
147
151
  </code></pre>
148
- <p>Any number of underlining <code>=</code>&rsquo;s or <code>-</code>&rsquo;s will work.</p>
152
+ <p>Any number of underlining <code>=</code>&#8217;s or <code>-</code>&#8217;s will work.</p>
149
153
 
150
154
  <p>Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. For example:</p>
151
155
  <pre><code># This is an H1
@@ -154,7 +158,7 @@ This is an H2
154
158
 
155
159
  ###### This is an H6
156
160
  </code></pre>
157
- <p>Optionally, you may &ldquo;close&rdquo; atx-style headers. This is purely cosmetic &ndash; you can use this if you think it looks better. The closing hashes don&rsquo;t even need to match the number of hashes used to open the header. (The number of opening hashes determines the header level.) :</p>
161
+ <p>Optionally, you may &#8220;close&#8221; atx-style headers. This is purely cosmetic &#8211; you can use this if you think it looks better. The closing hashes don&#8217;t even need to match the number of hashes used to open the header. (The number of opening hashes determines the header level.) :</p>
158
162
  <pre><code># This is an H1 #
159
163
 
160
164
  ## This is an H2 ##
@@ -162,7 +166,7 @@ This is an H2
162
166
  ### This is an H3 ######
163
167
 
164
168
  </code></pre><h3 id='blockquote'>Blockquotes</h3>
165
- <p>Markdown uses email-style <code>&gt;</code> characters for blockquoting. If you&rsquo;re familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a <code>&gt;</code> before every line:</p>
169
+ <p>Markdown uses email-style <code>&gt;</code> characters for blockquoting. If you&#8217;re familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a <code>&gt;</code> before every line:</p>
166
170
  <pre><code>&gt; This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
167
171
  &gt; consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
168
172
  &gt; Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
@@ -199,7 +203,7 @@ id sem consectetuer libero luctus adipiscing.
199
203
  <h3 id='list'>Lists</h3>
200
204
  <p>Markdown supports ordered (numbered) and unordered (bulleted) lists.</p>
201
205
 
202
- <p>Unordered lists use asterisks, pluses, and hyphens &ndash; interchangably &ndash; as list markers:</p>
206
+ <p>Unordered lists use asterisks, pluses, and hyphens &#8211; interchangably &#8211; as list markers:</p>
203
207
  <pre><code>* Red
204
208
  * Green
205
209
  * Blue
@@ -219,7 +223,7 @@ id sem consectetuer libero luctus adipiscing.
219
223
  2. McHale
220
224
  3. Parish
221
225
  </code></pre>
222
- <p>It&rsquo;s important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The HTML Markdown produces from the above list is:</p>
226
+ <p>It&#8217;s important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The HTML Markdown produces from the above list is:</p>
223
227
  <pre><code>&lt;ol&gt;
224
228
  &lt;li&gt;Bird&lt;/li&gt;
225
229
  &lt;li&gt;McHale&lt;/li&gt;
@@ -236,7 +240,7 @@ id sem consectetuer libero luctus adipiscing.
236
240
  1. McHale
237
241
  8. Parish
238
242
  </code></pre>
239
- <p>you&rsquo;d get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don&rsquo;t have to.</p>
243
+ <p>you&#8217;d get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don&#8217;t have to.</p>
240
244
 
241
245
  <p>If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may support starting ordered lists at an arbitrary number.</p>
242
246
 
@@ -249,7 +253,7 @@ id sem consectetuer libero luctus adipiscing.
249
253
  * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
250
254
  Suspendisse id sem consectetuer libero luctus adipiscing.
251
255
  </code></pre>
252
- <p>But if you want to be lazy, you don&rsquo;t have to:</p>
256
+ <p>But if you want to be lazy, you don&#8217;t have to:</p>
253
257
  <pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
254
258
  Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
255
259
  viverra nec, fringilla in, laoreet vitae, risus.
@@ -297,19 +301,19 @@ sit amet, consectetuer adipiscing elit.
297
301
 
298
302
  * Another item in the same list.
299
303
  </code></pre>
300
- <p>To put a blockquote within a list item, the blockquote&rsquo;s <code>&gt;</code> delimiters need to be indented:</p>
304
+ <p>To put a blockquote within a list item, the blockquote&#8217;s <code>&gt;</code> delimiters need to be indented:</p>
301
305
  <pre><code>* A list item with a blockquote:
302
306
 
303
307
  &gt; This is a blockquote
304
308
  &gt; inside a list item.
305
309
  </code></pre>
306
- <p>To put a code block within a list item, the code block needs to be indented <em>twice</em> &ndash; 8 spaces or two tabs:</p>
310
+ <p>To put a code block within a list item, the code block needs to be indented <em>twice</em> &#8211; 8 spaces or two tabs:</p>
307
311
  <pre><code>* A list item with a code block:
308
312
 
309
313
  &lt;code goes here&gt;
310
314
 
311
315
  </code></pre>
312
- <p>It&rsquo;s worth noting that it&rsquo;s possible to trigger an ordered list by accident, by writing something like this:</p>
316
+ <p>It&#8217;s worth noting that it&#8217;s possible to trigger an ordered list by accident, by writing something like this:</p>
313
317
  <pre><code>1986. What a great season.
314
318
  </code></pre>
315
319
  <p>In other words, a <em>number-period-space</em> sequence at the beginning of a line. To avoid this, you can backslash-escape the period:</p>
@@ -330,7 +334,7 @@ sit amet, consectetuer adipiscing elit.
330
334
  &lt;pre&gt;&lt;code&gt;This is a code block.
331
335
  &lt;/code&gt;&lt;/pre&gt;
332
336
  </code></pre>
333
- <p>One level of indentation &ndash; 4 spaces or 1 tab &ndash; is removed from each line of the code block. For example, this:</p>
337
+ <p>One level of indentation &#8211; 4 spaces or 1 tab &#8211; is removed from each line of the code block. For example, this:</p>
334
338
  <pre><code>Here is an example of AppleScript:
335
339
 
336
340
  tell application &quot;Foo&quot;
@@ -347,7 +351,7 @@ end tell
347
351
  </code></pre>
348
352
  <p>A code block continues until it reaches a line that is not indented (or the end of the article).</p>
349
353
 
350
- <p>Within a code block, ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> and <code>&gt;</code>) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown &ndash; just paste it and indent it, and Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this:</p>
354
+ <p>Within a code block, ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> and <code>&gt;</code>) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown &#8211; just paste it and indent it, and Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this:</p>
351
355
  <pre><code> &lt;div class=&quot;footer&quot;&gt;
352
356
  &amp;copy; 2004 Foo Corporation
353
357
  &lt;/div&gt;
@@ -358,7 +362,7 @@ end tell
358
362
  &amp;lt;/div&amp;gt;
359
363
  &lt;/code&gt;&lt;/pre&gt;
360
364
  </code></pre>
361
- <p>Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it&rsquo;s also easy to use Markdown to write about Markdown&rsquo;s own syntax.</p>
365
+ <p>Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it&#8217;s also easy to use Markdown to write about Markdown&#8217;s own syntax.</p>
362
366
  <h3 id='hr'>Horizontal Rules</h3>
363
367
  <p>You can produce a horizontal rule tag (<code>&lt;hr /&gt;</code>) by placing three or more hyphens, asterisks, or underscores on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule:</p>
364
368
  <pre><code>* * *
@@ -374,9 +378,9 @@ end tell
374
378
  </code></pre><hr /><h2 id='span'>Span Elements</h2><h3 id='link'>Links</h3>
375
379
  <p>Markdown supports two style of links: <em>inline</em> and <em>reference</em>.</p>
376
380
 
377
- <p>In both styles, the link text is delimited by square brackets.</p>
381
+ <p>In both styles, the link text is delimited by <span>square brackets</span>.</p>
378
382
 
379
- <p>To create an inline link, use a set of regular parentheses immediately after the link text&rsquo;s closing square bracket. Inside the parentheses, put the URL where you want the link to point, along with an <em>optional</em> title for the link, surrounded in quotes. For example:</p>
383
+ <p>To create an inline link, use a set of regular parentheses immediately after the link text&#8217;s closing square bracket. Inside the parentheses, put the URL where you want the link to point, along with an <em>optional</em> title for the link, surrounded in quotes. For example:</p>
380
384
  <pre><code>This is [an example](http://example.com/ &quot;Title&quot;) inline link.
381
385
 
382
386
  [This link](http://example.net/) has no title attribute.
@@ -388,7 +392,7 @@ an example&lt;/a&gt; inline link.&lt;/p&gt;
388
392
  &lt;p&gt;&lt;a href=&quot;http://example.net/&quot;&gt;This link&lt;/a&gt; has no
389
393
  title attribute.&lt;/p&gt;
390
394
  </code></pre>
391
- <p>If you&rsquo;re referring to a local resource on the same server, you can use relative paths:</p>
395
+ <p>If you&#8217;re referring to a local resource on the same server, you can use relative paths:</p>
392
396
  <pre><code>See my [About](/about/) page for details.
393
397
  </code></pre>
394
398
  <p>Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link:</p>
@@ -430,13 +434,13 @@ title attribute.&lt;/p&gt;
430
434
  </code></pre>
431
435
  <p>Link definitions are only used for creating links during Markdown processing, and are stripped from your document in the HTML output.</p>
432
436
 
433
- <p>Link definition names may constist of letters, numbers, spaces, and punctuation &ndash; but they are <em>not</em> case sensitive. E.g. these two links:</p>
437
+ <p>Link definition names may constist of letters, numbers, spaces, and punctuation &#8211; but they are <em>not</em> case sensitive. E.g. these two links:</p>
434
438
  <pre><code>[link text][a]
435
439
  [link text][A]
436
440
  </code></pre>
437
441
  <p>are equivalent.</p>
438
442
 
439
- <p>The <em>implicit link name</em> shortcut allows you to omit the name of the link, in which case the link text itself is used as the name. Just use an empty set of square brackets &ndash; e.g., to link the word &ldquo;Google&rdquo; to the google.com web site, you could simply write:</p>
443
+ <p>The <em>implicit link name</em> shortcut allows you to omit the name of the link, in which case the link text itself is used as the name. Just use an empty set of square brackets &#8211; e.g., to link the word &#8220;Google&#8221; to the google.com web site, you could simply write:</p>
440
444
  <pre><code>[Google][]
441
445
  </code></pre>
442
446
  <p>And then define the link:</p>
@@ -448,9 +452,9 @@ title attribute.&lt;/p&gt;
448
452
  <p>And then define the link:</p>
449
453
  <pre><code>[Daring Fireball]: http://daringfireball.net/
450
454
  </code></pre>
451
- <p>Link definitions can be placed anywhere in your Markdown document. I tend to put them immediately after each paragraph in which they&rsquo;re used, but if you want, you can put them all at the end of your document, sort of like footnotes.</p>
455
+ <p>Link definitions can be placed anywhere in your Markdown document. I tend to put them immediately after each paragraph in which they&#8217;re used, but if you want, you can put them all at the end of your document, sort of like footnotes.</p>
452
456
 
453
- <p>Here&rsquo;s an example of reference links in action:</p>
457
+ <p>Here&#8217;s an example of reference links in action:</p>
454
458
  <pre><code>I get 10 times more traffic from [Google] [1] than from
455
459
  [Yahoo] [2] or [MSN] [3].
456
460
 
@@ -472,16 +476,16 @@ title=&quot;Google&quot;&gt;Google&lt;/a&gt; than from
472
476
  &lt;a href=&quot;http://search.yahoo.com/&quot; title=&quot;Yahoo Search&quot;&gt;Yahoo&lt;/a&gt;
473
477
  or &lt;a href=&quot;http://search.msn.com/&quot; title=&quot;MSN Search&quot;&gt;MSN&lt;/a&gt;.&lt;/p&gt;
474
478
  </code></pre>
475
- <p>For comparison, here is the same paragraph written using Markdown&rsquo;s inline link style:</p>
479
+ <p>For comparison, here is the same paragraph written using Markdown&#8217;s inline link style:</p>
476
480
  <pre><code>I get 10 times more traffic from [Google](http://google.com/ &quot;Google&quot;)
477
481
  than from [Yahoo](http://search.yahoo.com/ &quot;Yahoo Search&quot;) or
478
482
  [MSN](http://search.msn.com/ &quot;MSN Search&quot;).
479
483
  </code></pre>
480
- <p>The point of reference-style links is not that they&rsquo;re easier to write. The point is that with reference-style links, your document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is only 81 characters long; with inline-style links, it&rsquo;s 176 characters; and as raw HTML, it&rsquo;s 234 characters. In the raw HTML, there&rsquo;s more markup than there is text.</p>
484
+ <p>The point of reference-style links is not that they&#8217;re easier to write. The point is that with reference-style links, your document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is only 81 characters long; with inline-style links, it&#8217;s 176 characters; and as raw HTML, it&#8217;s 234 characters. In the raw HTML, there&#8217;s more markup than there is text.</p>
481
485
 
482
- <p>With Markdown&rsquo;s reference-style links, a source document much more closely resembles the final output, as rendered in a browser. By allowing you to move the markup-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose.</p>
486
+ <p>With Markdown&#8217;s reference-style links, a source document much more closely resembles the final output, as rendered in a browser. By allowing you to move the markup-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose.</p>
483
487
  <h3 id='em'>Emphasis</h3>
484
- <p>Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an HTML <code>&lt;em&gt;</code> tag; double <code>*</code>&rsquo;s or <code>_</code>&rsquo;s will be wrapped with an HTML <code>&lt;strong&gt;</code> tag. E.g., this input:</p>
488
+ <p>Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an HTML <code>&lt;em&gt;</code> tag; double <code>*</code>&#8217;s or <code>_</code>&#8217;s will be wrapped with an HTML <code>&lt;strong&gt;</code> tag. E.g., this input:</p>
485
489
  <pre><code>*single asterisks*
486
490
 
487
491
  _single underscores_
@@ -504,7 +508,7 @@ __double underscores__
504
508
  <p>Emphasis can be used in the middle of a word:</p>
505
509
  <pre><code>un*fucking*believable
506
510
  </code></pre>
507
- <p>But if you surround an <code>*</code> or <code>_</code> with spaces, it&rsquo;ll be treated as a literal asterisk or underscore.</p>
511
+ <p>But if you surround an <code>*</code> or <code>_</code> with spaces, it&#8217;ll be treated as a literal asterisk or underscore.</p>
508
512
 
509
513
  <p>To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it:</p>
510
514
  <pre><code>\*this text is surrounded by literal asterisks\*
@@ -523,7 +527,7 @@ __double underscores__
523
527
  <p>which will produce this:</p>
524
528
  <pre><code>&lt;p&gt;&lt;code&gt;There is a literal backtick (`) here.&lt;/code&gt;&lt;/p&gt;
525
529
  </code></pre>
526
- <p>The backtick delimiters surrounding a code span may include spaces &ndash; one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span:</p>
530
+ <p>The backtick delimiters surrounding a code span may include spaces &#8211; one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span:</p>
527
531
  <pre><code>A single backtick in a code span: `` ` ``
528
532
 
529
533
  A backtick-delimited string in a code span: `` `foo` ``
@@ -548,7 +552,7 @@ equivalent of &lt;code&gt;&amp;amp;mdash;&lt;/code&gt;.&lt;/p&gt;
548
552
 
549
553
 
550
554
  </code></pre><h3 id='img'>Images</h3>
551
- <p>Admittedly, it&rsquo;s fairly difficult to devise a &ldquo;natural&rdquo; syntax for placing images into a plain text document format.</p>
555
+ <p>Admittedly, it&#8217;s fairly difficult to devise a &#8220;natural&#8221; syntax for placing images into a plain text document format.</p>
552
556
 
553
557
  <p>Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: <em>inline</em> and <em>reference</em>.</p>
554
558
 
@@ -570,12 +574,12 @@ equivalent of &lt;code&gt;&amp;amp;mdash;&lt;/code&gt;.&lt;/p&gt;
570
574
  <p>Reference-style image syntax looks like this:</p>
571
575
  <pre><code>![Alt text][id]
572
576
  </code></pre>
573
- <p>Where &ldquo;id&rdquo; is the name of a defined image reference. Image references are defined using syntax identical to link references:</p>
577
+ <p>Where &#8220;id&#8221; is the name of a defined image reference. Image references are defined using syntax identical to link references:</p>
574
578
  <pre><code>[id]: url/to/image &quot;Optional title attribute&quot;
575
579
  </code></pre>
576
580
  <p>As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML <code>&lt;img&gt;</code> tags.</p>
577
581
  <hr /><h2 id='misc'>Miscellaneous</h2><h3 id='autolink'>Automatic Links</h3>
578
- <p>Markdown supports a shortcut style for creating &ldquo;automatic&rdquo; links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:</p>
582
+ <p>Markdown supports a shortcut style for creating &#8220;automatic&#8221; links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:</p>
579
583
  <pre><code>&lt;http://example.com/&gt;</code></pre>
580
584
  <p>Markdown will turn this into:</p>
581
585
  <pre><code>&lt;a href=&quot;http://example.com/&quot;&gt;http://example.com/&lt;/a&gt;
@@ -589,11 +593,11 @@ equivalent of &lt;code&gt;&amp;amp;mdash;&lt;/code&gt;.&lt;/p&gt;
589
593
  &amp;#109;&quot;&gt;&amp;#x61;&amp;#x64;&amp;#x64;&amp;#x72;&amp;#x65;&amp;#115;&amp;#115;&amp;#64;&amp;#101;&amp;#120;&amp;#x61;
590
594
  &amp;#109;&amp;#x70;&amp;#x6C;e&amp;#x2E;&amp;#99;&amp;#111;&amp;#109;&lt;/a&gt;
591
595
  </code></pre>
592
- <p>which will render in a browser as a clickable link to &ldquo;address@example.com&rdquo;.</p>
596
+ <p>which will render in a browser as a clickable link to &#8220;address@example.com&#8221;.</p>
593
597
 
594
- <p>(This sort of entity-encoding trick will indeed fool many, if not most, address-harvesting bots, but it definitely won&rsquo;t fool all of them. It&rsquo;s better than nothing, but an address published in this way will probably eventually start receiving spam.)</p>
598
+ <p>(This sort of entity-encoding trick will indeed fool many, if not most, address-harvesting bots, but it definitely won&#8217;t fool all of them. It&#8217;s better than nothing, but an address published in this way will probably eventually start receiving spam.)</p>
595
599
  <h3 id='backslash'>Backslash Escapes</h3>
596
- <p>Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown&rsquo;s formatting syntax. For example, if you wanted to surround a word with literal asterisks (instead of an HTML <code>&lt;em&gt;</code> tag), you can backslashes before the asterisks, like this:</p>
600
+ <p>Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown&#8217;s formatting syntax. For example, if you wanted to surround a word with literal asterisks (instead of an HTML <code>&lt;em&gt;</code> tag), you can backslashes before the asterisks, like this:</p>
597
601
  <pre><code>\*literal asterisks\*
598
602
  </code></pre>
599
603
  <p>Markdown provides backslash escapes for the following characters:</p>
@@ -608,4 +612,4 @@ _ underscore
608
612
  + plus sign
609
613
  - minus sign (hyphen)
610
614
  . dot
611
- ! exclamation mark</code></pre><div class='maruku_signature'><hr /><span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter for Ruby'>Maruku</a> at 13:45 on Thursday, January 11st, 2007.</span></div></body></html>
615
+ ! exclamation mark</code></pre><div class='maruku_signature'><hr /><span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown-superset interpreter for Ruby'>Maruku</a> at 14:11 on Tuesday, January 23rd, 2007.</span></div></body></html>
@@ -1,15 +1,19 @@
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'><head><meta content='text/html; charset=utf-8' http-equiv='Content-type' /><title>Maruku: a Markdown-superset interpreter</title><link href='style.css' rel='stylesheet' type='text/css' /></head><body>
5
- <p><img src='logo.png' id='logo' /></p>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC
3
+ "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
4
+ "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
5
+ <html xmlns:svg='http://www.w3.org/2000/svg' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
6
+ <head><meta content='application/xhtml+xml;charset=utf-8' http-equiv='Content-type' /><title>Maruku: a Markdown-superset interpreter</title><link href='style.css' rel='stylesheet' type='text/css' />
7
+ </head>
8
+ <body>
9
+ <p><img src='logo.png' id='logo' alt='' /></p>
6
10
 
7
11
  <h1 id='maruku_a_markdownsuperset_interpreter'>Mar<strong>u</strong>k<strong>u</strong>: a Markdown-superset interpreter</h1>
8
12
 
9
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>
10
14
 
11
15
  <blockquote id='news'>
12
- <p><a href='#release_notes'>Last release</a> is version 0.4.2 &ndash; 2007-01-12.</p>
16
+ <p><a href='#release_notes'>Last release</a> is version 0.5.0 &#8211; 2007-01-23.</p>
13
17
 
14
18
  <p>Use this command to update:</p>
15
19
  <pre><code>$ gem update maruku</code></pre></blockquote>
@@ -50,10 +54,10 @@
50
54
 
51
55
  <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>
52
56
 
53
- <p><strong>The name of the game</strong>: Maruku is the <a href='http://en.wikipedia.org/wiki/Romaji'>romaji</a> transliteration of the <a href='http://en.wikipedia.org/wiki/Katakana'>katakana</a> transliteration of &ldquo;Mark&rdquo;, the first word in Markdown. I chose this name because Ruby is Japanese, and also the sillable &ldquo;ru&rdquo; appears in Maruku.</p>
57
+ <p><strong>The name of the game</strong>: Maruku is the <a href='http://en.wikipedia.org/wiki/Romaji'>romaji</a> transliteration of the <a href='http://en.wikipedia.org/wiki/Katakana'>katakana</a> transliteration of &#8220;Mark&#8221;, the first word in Markdown. I chose this name because Ruby is Japanese, and also the sillable &#8220;ru&#8221; appears in Maruku.</p>
54
58
  <hr />
55
59
  <p>Table of contents: (<strong>auto-generated by Maruku!</strong>)</p>
56
- <div class='maruku_toc'><ul style='list-style: none;'><li><span class='maruku_section_number'>1. </span><a href='#release_notes'>Release notes</a></li><li><span class='maruku_section_number'>2. </span><a href='#download'>Download</a><ul style='list-style: none;'><li><span class='maruku_section_number'>2.1. </span><a href='#bugs_report'>Bugs report</a></li></ul></li><li><span class='maruku_section_number'>3. </span><a href='#usage'>Usage</a><ul style='list-style: none;'><li><span class='maruku_section_number'>3.1. </span><a href='#from_the_command_line'>From the command line</a></li></ul></li><li><span class='maruku_section_number'>4. </span><a href='#extra'>Examples of PHP Markdown Extra syntax</a></li><li><span class='maruku_section_number'>5. </span><a href='#maruku-and-bluecloth'>Maruku and Bluecloth</a></li><li><span class='maruku_section_number'>6. </span><a href='#meta'>New meta-data syntax</a><ul style='list-style: none;'><li><span class='maruku_section_number'>6.1. </span><a href='#metadata_for_blocklevel_and_spanlevel_elements'>Meta-data for block-level and span-level elements</a></li><li><span class='maruku_section_number'>6.2. </span><a href='#metadata_for_the_document'>Meta-data for the document</a></li><li><span class='maruku_section_number'>6.3. </span><a href='#metalist'>List of meta-data</a></li><li><span class='maruku_section_number'>6.4. </span><a href='#examples'>Examples</a></li></ul></li><li><span class='maruku_section_number'>7. </span><a href='#features'>Other Features</a><ul style='list-style: none;'><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><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><li><span class='maruku_section_number'>7.3. </span><a href='#use_html_entities'>Use HTML entities</a></li></ul></li><li><span class='maruku_section_number'>8. </span><a href='#future'>Future developments</a><ul style='list-style: none;'><li><span class='maruku_section_number'>8.1. </span><a href='#a_syntax_for_adding_math'>A syntax for adding math</a></li></ul></li></ul></div><hr />
60
+ <div class='maruku_toc'><ul style='list-style: none;'><li><span class='maruku_section_number'>1. </span><a href='#release_notes'>Release notes</a></li><li><span class='maruku_section_number'>2. </span><a href='#download'>Download</a><ul style='list-style: none;'><li><span class='maruku_section_number'>2.1. </span><a href='#bugs_report'>Bugs report</a></li></ul></li><li><span class='maruku_section_number'>3. </span><a href='#usage'>Usage</a><ul style='list-style: none;'><li><span class='maruku_section_number'>3.1. </span><a href='#embedded_maruku'>Embedded Maruku</a></li><li><span class='maruku_section_number'>3.2. </span><a href='#from_the_command_line'>From the command line</a></li></ul></li><li><span class='maruku_section_number'>4. </span><a href='#maruku-and-bluecloth'>Maruku and Bluecloth</a></li><li><span class='maruku_section_number'>5. </span><a href='#maruku_summary_of_features'>Maruku summary of features</a><ul style='list-style: none;'><li><span class='maruku_section_number'>5.1. </span><a href='#meta'>New meta-data syntax</a></li><li><span class='maruku_section_number'>5.2. </span><a href='#toc-generation'>Automatic generation of the table of contents</a></li><li><span class='maruku_section_number'>5.3. </span><a href='#entities'>Use HTML entities</a></li><li><span class='maruku_section_number'>5.4. </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></ul></li><li><span class='maruku_section_number'>6. </span><a href='#extra'>Examples of PHP Markdown Extra syntax</a></li></ul></div><hr />
57
61
  <h2 id='release_notes'><span class='maruku_section_number'>1. </span>Release notes</h2>
58
62
 
59
63
  <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>
@@ -62,244 +66,186 @@
62
66
 
63
67
  <p>Have fun!</p>
64
68
 
65
- <h4 id='last'>Changes in 0.4.2</h4>
69
+ <p>See the <a href='http://maruku.rubyforge.org/changelog.html#stable'>changelog</a>.</p>
66
70
 
67
- <ul>
68
- <li>
69
- <p>Adapted syntax to the <a href='http://maruku.rubyforge.org/proposal.html'>new meta-data proposal</a>.</p>
70
- </li>
71
+ <h2 id='download'><span class='maruku_section_number'>2. </span>Download</h2>
71
72
 
72
- <li>
73
- <p>Changes in LaTeX export:</p>
73
+ <p>The development site is <a href='http://rubyforge.org/projects/maruku/'>http://rubyforge.org/projects/maruku/</a>.</p>
74
74
 
75
- <ul>
76
- <li>
77
- <p>Links to external URLs are blue by default.</p>
78
- </li>
75
+ <p>Install with:</p>
76
+ <pre><code>$ gem install maruku
77
+ </code></pre>
78
+ <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>
79
79
 
80
- <li>
81
- <p>New attributes: <code>latex_preamble</code> to add a custom preamble, and <code>latex_cjk</code> to add packages for UTF-8 Japanese characters. (<strong>support for this is still shaky</strong>). Example:</p>
82
- <pre><code>Title: my document
83
- LaTeX CJK: true
84
- LaTeX preamble: preamble.tex
80
+ <p>Anonymous access to the repository is possible with:</p>
81
+ <pre><code>$ svn checkout svn://rubyforge.org/var/svn/maruku/trunk
82
+ </code></pre>
83
+ <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>
85
84
 
86
- Content</code></pre></li>
87
- </ul>
88
- </li>
85
+ <h3 id='bugs_report'><span class='maruku_section_number'>2.1. </span>Bugs report</h3>
89
86
 
90
- <li>
91
- <p>Bug fixes</p>
87
+ <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>
92
88
 
93
- <ul>
94
- <li>
95
- <p>Images were not given <code>id</code> or <code>class</code> attributes.</p>
96
- </li>
89
+ <h2 id='usage'><span class='maruku_section_number'>3. </span>Usage</h2>
97
90
 
98
- <li>
99
- <p>Fixed bug in LaTeX export with handling of <code>&lt;</code>,<code>&gt;</code> enclosed URLs: <code>&lt;google.com&gt;</code>.</p>
100
- </li>
101
- </ul>
102
- </li>
103
- </ul>
91
+ <h3 id='embedded_maruku'><span class='maruku_section_number'>3.1. </span>Embedded Maruku</h3>
104
92
 
105
- <h4 id='changes_in_041_aka_typographer'>Changes in 0.4.1 aka &ldquo;Typographer&rdquo;</h4>
93
+ <p>This is the basic usage:</p>
94
+ <pre><code>require &#39;rubygems&#39;
95
+ require &#39;maruku&#39;
106
96
 
107
- <ul>
108
- <li>
109
- <p>Implemented SmartyPants support:</p>
110
- <pre><code>&#39;Twas a &quot;test&quot; to &#39;remember&#39; -- in the &#39;90s
111
- --- while I was &lt;&lt;ok&gt;&gt;. She was 6\&quot;12\&#39;.</code></pre>
112
- <blockquote>
113
- <p>&lsquo;Twas a &ldquo;test&rdquo; to &lsquo;remember&rsquo; &ndash; in the &rsquo;90s &mdash; while I was &laquo;ok&raquo;. She was 6&quot;12&#39;.</p>
114
- </blockquote>
97
+ doc = Maruku.new(markdown_string)
98
+ puts doc.to_html
99
+ </code></pre>
100
+ <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>
101
+ <pre><code>puts doc.to_html_document
102
+ </code></pre>
103
+ <p>You can have the REXML document tree with:</p>
104
+ <pre><code>tree = doc.to_html_document_tree
105
+ </code></pre>
106
+ <h3 id='from_the_command_line'><span class='maruku_section_number'>3.2. </span>From the command line</h3>
115
107
 
116
- <p>I adapted the code from RubyPants.</p>
117
- </li>
108
+ <p>There is one command-line program installed: <code>maruku</code>.</p>
118
109
 
119
- <li>
120
- <p>Server directives between <code>&lt;? ?&gt;</code> are properly preserved.</p>
121
- </li>
110
+ <p>Without arguments, it converts Markdown to HTML:</p>
111
+ <pre><code>$ maruku file.md # creates file.html</code></pre>
112
+ <p>With the <code>--pdf</code> arguments, it converts Markdown to LaTeX, then calls <code>pdflatex</code> to transform to PDF:</p>
113
+ <pre><code>$ maruku --pdf file.md # creates file.tex and file.pdf</code></pre>
114
+ <h2 id='maruku-and-bluecloth'><span class='maruku_section_number'>4. </span>Maruku and Bluecloth</h2>
122
115
 
123
- <li>
124
- <p>Changes in LaTeX export:</p>
116
+ <p>The other Ruby implementation of Markdown is <a href='http://www.deveiate.org/projects/BlueCloth'>Bluecloth</a>.</p>
125
117
 
126
- <ul>
127
- <li>
128
- <p>Now Japanese text rendering sort of works, using the following packages:</p>
129
- <pre><code>\usepackage[C40]{fontenc}
130
- \usepackage[cjkjis]{ucs}
131
- \usepackage[utf8x]{inputenc}
132
- </code></pre>
133
- <p>Nevertheless, I could only get bitmap fonts working &ndash; probably it&rsquo;s a problem with my setup.</p>
118
+ <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>
134
119
 
135
- <p>A quick test: 日本、中国、ひらがな、カタカナ。</p>
136
- </li>
120
+ <p>Maruku is usually faster than Bluecloth. Bluecloth is faster for very small documents. Bluecloth sometimes chokes on very big documents (it is reported that the blame should be on Ruby&#8217;s regexp implementation).</p>
137
121
 
138
- <li>
139
- <p>Fixed bugs in rendering of immediate links.</p>
140
- </li>
122
+ <p>This is the canonical benchmark (the Markdown specification), executed with Ruby 1.8.5 on a Powerbook 1.5GhZ:</p>
123
+ <pre><code>BlueCloth (to_html): parsing 0.01 sec + rendering 1.87 sec = 1.88 sec (1.00x)
124
+ Maruku (to_html): parsing 0.66 sec + rendering 0.43 sec = 1.09 sec (1.73x)
125
+ Maruku (to_latex): parsing 0.67 sec + rendering 0.23 sec = 0.90 sec (2.10x)
126
+ </code></pre>
127
+ <p>Please note that Maruku has a lot more features and therefore is looking for much more patterns in the file.</p>
141
128
 
142
- <li>
143
- <p>External packages are <code>require</code>d only if needed.</p>
144
- </li>
129
+ <h2 id='maruku_summary_of_features'><span class='maruku_section_number'>5. </span>Maruku summary of features</h2>
145
130
 
131
+ <ul>
146
132
  <li>
147
- <p>More symbols supported. See the symbol list <a href='http://maruku.rubyforge.org/entity_test.html'>in HTML</a> and <a href='http://maruku.rubyforge.org/entity_test.pdf'>in PDF</a>.</p>
148
- </li>
149
- </ul>
150
- </li>
151
- </ul>
152
-
153
- <h4 id='changes_in_04'>Changes in 0.4</h4>
133
+ <p>Supported syntax</p>
154
134
 
155
135
  <ul>
156
- <li>First implementation of <a href='http://maruku.rubyforge.org/proposal.html'>the new meta-data syntax</a>.</li>
157
-
158
- <li>General refactorization of the code and much cleaner error reporting.</li>
136
+ <li><a href='http://daringfireball.net/projects/markdown/syntax'>Basic Markdown</a></li>
159
137
 
160
- <li>Created <a href='http://maruku.rubyforge.org/rdoc/'>the RDOC documentation</a>.</li>
138
+ <li><a href='#extra'>Markdown Extra</a></li>
161
139
 
162
- <li>The <code>add_whitespace</code> method took too much time &ndash; it was O(n^2).</li>
163
-
164
- <li>Added unit-tests for block-level elements.</li>
140
+ <li><a href='#meta'>Meta-data syntax</a></li>
165
141
  </ul>
142
+ </li>
166
143
 
167
- <h4 id='changes_in_03'>Changes in 0.3</h4>
144
+ <li>
145
+ <p>Output</p>
168
146
 
169
147
  <ul>
170
148
  <li>
171
- <p>A real parser is used instead of a regexp-based system, also for span-level elements.</p>
172
-
173
- <p>Now Maruku is almost 2x faster than Bluecloth, while having more features.</p>
149
+ <p>XHTML</p>
174
150
 
175
- <p>Here are some benchmarks:</p>
176
- <pre><code>BlueCloth (to_html): parsing 0.00 sec + rendering 1.54 sec = 1.55 sec
177
- Maruku (to_html): parsing 0.47 sec + rendering 0.38 sec = 0.85 sec
178
- Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pre>
179
- <p>This is the result of running <code>lib/maruku/tests/benchmark.rb</code> on the Markdown specification.</p>
151
+ <ul>
152
+ <li>Syntax highlighting via the <a href='http://syntax.rubyforge.org/'><code>syntax</code></a> library.</li>
153
+ </ul>
180
154
  </li>
181
155
 
182
156
  <li>
183
- <p>Prettier HTML output by adding whitespace.</p>
184
- </li>
157
+ <p>LaTeX</p>
185
158
 
186
- <li>
187
- <p>Added a full suite of unit-tests for the span-level parser.</p>
159
+ <ul>
160
+ <li><a href='#entities'>Translation of HTML entities to LaTeX</a></li>
161
+
162
+ <li>Syntax highlighting via the <a href='http://www.ctan.org/tex-archive/macros/latex/contrib/listings/'><code>listings</code></a> package.</li>
163
+ </ul>
164
+ </li>
165
+ </ul>
188
166
  </li>
189
167
 
190
168
  <li>
191
- <p>Error management: Having a real parser, Maruku warns you about syntax issues.</p>
169
+ <p>Misc</p>
192
170
 
193
- <p>The default action is to warn and try to continue. If you do this:</p>
194
- <pre><code>Maruku.new(string, {:on_error =&gt; :raise})
195
- </code></pre>
196
- <p>then syntax errors will cause an exception to be raised (you can catch this and retry).</p>
171
+ <ul>
172
+ <li>
173
+ <p><a href='exd.html'>Documentation for supported attributes</a></p>
197
174
  </li>
198
175
 
199
176
  <li>
200
- <p>Fixed a series of bugs in handling inline HTML code.</p>
177
+ <p><a href='#toc-generation'>Automatic generation of the TOC</a></p>
178
+ </li>
179
+ </ul>
201
180
  </li>
202
181
  </ul>
203
182
 
204
- <p>Immediate TODO-list:</p>
183
+ <p><strong>Experimental features (not released yet)</strong></p>
205
184
 
206
185
  <ul>
207
- <li>
208
- <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>
209
-
210
- <p>For example: in the HTML version, you should see accented characters in this parenthesis:</p>
211
-
212
- <blockquote>
213
- <p>(àèìòù)</p>
214
- </blockquote>
215
-
216
- <p>and Japanese text in these other parentheses:</p>
217
-
218
- <blockquote>
219
- <p>(カタカナで 私の 名前は アンドレア チェンシ です).</p>
186
+ <li><a href='http://maruku.rubyforge.org/math.xhtml'>LaTeX Math syntax</a> (not enabled by default)</li>
220
187
 
221
- <p>(日本のガルは 大好き、でも、日本語は難しですから、そうぞ 英語話すガルを おしえてください).</p>
222
- </blockquote>
188
+ <li>An extension system for adding new syntax is available, but the API is bound to change in the future, so please don&#8217;t use it.</li>
223
189
 
224
- <p>In the LaTeX version, these do not appear. I know how to do LaTeX with ISO-8859-1 encoding (European characters), but I&rsquo;m struggling with half-baked solutions for UTF-8 encoded documents.</p>
225
- </li>
190
+ <li>LaTeX to MathML using either one of <a href='http://ritex.rubyforge.org'><code>ritex</code></a>, <a href='http://golem.ph.utexas.edu/~distler/code/itexToMML/'><code>itex2mml</code></a>, <a href='http://www.blahtex.org'><code>blahtex</code></a>.</li>
226
191
 
227
- <li>
228
- <p>Implement the <a href='http://maruku.rubyforge.org/proposal.html'>new meta-data proposal</a>.</p>
229
- </li>
192
+ <li>LaTeX to PNG using <a href='http://www.blahtex.org'><code>blahtex</code></a>.</li>
193
+ </ul>
230
194
 
231
- <li>
232
- <p>Exporting to Markdown (pretty printing).</p>
233
- </li>
195
+ <h3 id='meta'><span class='maruku_section_number'>5.1. </span>New meta-data syntax</h3>
234
196
 
235
- <li>
236
- <p>Exporting to HTML splitting in multiple files.</p>
237
- </li>
238
-
239
- <li>
240
- <p>RubyPants.</p>
241
- </li>
197
+ <p>Maruku implements a syntax that allows to attach &#8220;meta&#8221; information to objects.</p>
242
198
 
243
- <li>
244
- <p>Support for images in PDF.</p>
245
- </li>
246
- </ul>
199
+ <p>See <a href='http://maruku.rubyforge.org/proposal.html'>this proposal</a> for how to attach metadata to the elements.</p>
247
200
 
248
- <h2 id='download'><span class='maruku_section_number'>2. </span>Download</h2>
201
+ <p>See the <a href='exd.html'>documentation for supported attributes</a>.</p>
249
202
 
250
- <p>The development site is <a href='http://rubyforge.org/projects/maruku/'>http://rubyforge.org/projects/maruku/</a>.</p>
203
+ <p>Meta-data for the document itself is specified through the use of email headers:</p>
204
+ <pre><code>Title: A simple document containing meta-headers
205
+ CSS: style.css
251
206
 
252
- <p>Install with:</p>
253
- <pre><code>$ gem install maruku
207
+ Content of the document
254
208
  </code></pre>
255
- <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>
256
-
257
- <p>Anonymous access to the repository is possible with:</p>
258
- <pre><code>$ svn checkout svn://rubyforge.org/var/svn/maruku
209
+ <p>When creating the document through</p>
210
+ <pre><code>Maruku.new(s).to_html_document
259
211
  </code></pre>
260
- <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>
212
+ <p>the title and stylesheet are added as expected.</p>
261
213
 
262
- <h3 id='bugs_report'><span class='maruku_section_number'>2.1. </span>Bugs report</h3>
214
+ <p>Meta-data keys are assumed to be case-insensitive.</p>
263
215
 
264
- <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>
216
+ <h3 id='toc-generation'><span class='maruku_section_number'>5.2. </span>Automatic generation of the table of contents</h3>
265
217
 
266
- <h2 id='usage'><span class='maruku_section_number'>3. </span>Usage</h2>
218
+ <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>
219
+ <pre><code>* This will become a table of contents (this text will be scraped).
220
+ {:toc}
221
+ </code></pre>
222
+ <p>You can see an example of this at the beginning of this document.</p>
267
223
 
268
- <p>This is the basic usage:</p>
269
- <pre><code>require &#39;rubygems&#39;
270
- require &#39;maruku&#39;
224
+ <h3 id='entities'><span class='maruku_section_number'>5.3. </span>Use HTML entities</h3>
271
225
 
272
- doc = Maruku.new(markdown_string)
273
- puts doc.to_html
274
- </code></pre>
275
- <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>
276
- <pre><code>puts doc.to_html_document
277
- </code></pre>
278
- <p>You can have the REXML document tree with:</p>
279
- <pre><code>tree = doc.to_html_document_tree
280
- </code></pre>
281
- <h3 id='from_the_command_line'><span class='maruku_section_number'>3.1. </span>From the command line</h3>
226
+ <p>If you want to use HTML entities, go on! We will take care of the translation to LaTeX:</p>
227
+ <table><thead><tr><th>Entity</th><th>Result</th></tr></thead><tbody><tr><td style='text-align: left;'><code>&amp;copy;</code></td><td style='text-align: left;'>&#169;</td>
228
+ </tr><tr><td style='text-align: left;'><code>&amp;pound;</code></td><td style='text-align: left;'>&#163;</td>
229
+ </tr><tr><td style='text-align: left;'><code>&amp;lambda;</code></td><td style='text-align: left;'>&#955;</td>
230
+ </tr><tr><td style='text-align: left;'><code>&amp;mdash;</code></td><td style='text-align: left;'>&#8212;</td>
231
+ </tr></tbody></table>
232
+ <p>See the <a href='http://maruku.rubyforge.org/entity_test.html'>list of supported entities</a> (<a href='http://maruku.rubyforge.org/entity_test.pdf'>pdf</a>).</p>
282
233
 
283
- <p>There are two command-line programs installed: <code>maruku</code> and <code>marutex</code>.</p>
234
+ <h3 id='this_header_contains_emphasis_strong_text_and_'><span class='maruku_section_number'>5.4. </span>This header contains <em>emphasis</em> <strong>strong text</strong> and <code>code</code></h3>
284
235
 
285
- <ul>
286
- <li>
287
- <p><code>maruku</code> converts Markdown to HTML:</p>
288
- <pre><code>$ maruku file.md # creates file.html</code></pre></li>
236
+ <p>Note that this header contains formatting and it still works, also in the table of contents.</p>
289
237
 
290
- <li>
291
- <p><code>marutex</code> converts Markdown to LaTeX, then calls <code>pdflatex</code> to transform to PDF:</p>
292
- <pre><code>$ marutex file.md # creates file.tex and file.pdf</code></pre></li>
293
- </ul>
238
+ <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>
294
239
 
295
- <h2 id='extra'><span class='maruku_section_number'>4. </span>Examples of PHP Markdown Extra syntax</h2>
240
+ <h2 id='extra'><span class='maruku_section_number'>6. </span>Examples of PHP Markdown Extra syntax</h2>
296
241
 
297
242
  <ul>
298
243
  <li>
299
244
  <p>tables</p>
300
245
  <pre><code>Col1 | Very very long head | Very very long head|
301
246
  -----|:-------------------:|-------------------:|
302
- cell | center-align | right-align |</code></pre><table><thead><tr><th>Col1</th><th>Very very long head</th><th>Very very long head</th></tr></thead><tbody><tr><td style='text-align: left;'>cell</td><td style='text-align: center;'>center-align</td><td style='text-align: right;'>right-align</td></tr></tbody></table></li>
247
+ cell | center-align | right-align |</code></pre><table><thead><tr><th>Col1</th><th>Very very long head</th><th>Very very long head</th></tr></thead><tbody><tr><td style='text-align: left;'>cell</td><td style='text-align: center;'>center-align</td><td style='text-align: right;'>right-align</td>
248
+ </tr></tbody></table></li>
303
249
 
304
250
  <li>
305
251
  <p>footnotes <sup id='fnref:1'><a href='#fn:1' rel='footnote'>1</a></sup></p>
@@ -338,181 +284,16 @@ cell | center-align | right-align |</code></pre><table><thead><tr>
338
284
  <p>abbreviations or <abbr title='Simply an abbreviation'>ABB</abbr> for short.</p>
339
285
  </li>
340
286
  </ul>
287
+ <!--
288
+ Future developments {#future}
341
289
 
342
- <h2 id='maruku-and-bluecloth'><span class='maruku_section_number'>5. </span>Maruku and Bluecloth</h2>
343
-
344
- <p>The other Ruby implementation of Markdown is <a href='http://www.deveiate.org/projects/BlueCloth'>Bluecloth</a>.</p>
345
-
346
- <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>
347
-
348
- <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>
349
-
350
- <p>Other improvements over Bluecloth:</p>
351
-
352
- <ul>
353
- <li>
354
- <p>the HTML output is provided also as a <code>REXML</code> document tree.</p>
355
- </li>
356
-
357
- <li>
358
- <p>PHP Markdown Syntax support.</p>
359
- </li>
360
- </ul>
361
-
362
- <h2 id='meta'><span class='maruku_section_number'>6. </span>New meta-data syntax</h2>
363
-
364
- <p>Maruku implements a syntax that allows to attach &ldquo;meta&rdquo; information to objects.</p>
365
-
366
- <h3 id='metadata_for_blocklevel_and_spanlevel_elements'><span class='maruku_section_number'>6.1. </span>Meta-data for block-level and span-level elements</h3>
367
-
368
- <p>See <a href='http://maruku.rubyforge.org/proposal.html'>this proposal</a>.</p>
369
-
370
- <h3 id='metadata_for_the_document'><span class='maruku_section_number'>6.2. </span>Meta-data for the document</h3>
371
-
372
- <p>Meta-data for the document itself is specified through the use of email headers:</p>
373
- <pre><code>Title: A simple document containing meta-headers
374
- CSS: style.css
375
-
376
- Content of the document
377
- </code></pre>
378
- <p>When creating the document through</p>
379
- <pre><code>Maruku.new(s).to_html_document
380
- </code></pre>
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
- <hr />
385
- <h3 id='metalist'><span class='maruku_section_number'>6.3. </span>List of meta-data</h3>
386
-
387
- <dl>
388
- <dt><strong><code>title</code>, <code>subject</code></strong></dt>
389
-
390
- <dd>
391
- <p>(document) Sets the title of the document (HTML: used in the <code>TITLE</code> element).</p>
392
- </dd>
393
-
394
- <dt><strong><code>use_numbered_headers</code></strong></dt>
395
-
396
- <dd>
397
- <p>(document) If <code>true</code>, headers are numbered (just like this document). Default is <code>false</code>.</p>
398
- </dd>
399
-
400
- <dt><strong><code>css</code></strong></dt>
401
-
402
- <dd>
403
- <p>(document, HTML) Url of stylesheet.</p>
404
- </dd>
405
-
406
- <dt><strong><code>html_use_syntax</code></strong></dt>
407
-
408
- <dd>
409
- <p>(document, HTML) If set, use the <a href='http://syntax.rubyforge.org/'>Ruby <code>syntax</code> library</a> to add source highlighting.</p>
410
- </dd>
411
-
412
- <dt><strong><code>latex_use_listings</code></strong></dt>
413
-
414
- <dd>
415
- <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>
416
-
417
- <p>If not set, use standard <code>verbatim</code> environment.</p>
418
- </dd>
419
-
420
- <dt><strong><code>style</code>, <code>id</code>, <code>class</code></strong></dt>
421
-
422
- <dd>
423
- <p>(any block object, HTML) Standard CSS attributes are copied.</p>
424
- </dd>
425
-
426
- <dt><strong><code>lang</code></strong></dt>
427
-
428
- <dd>
429
- <p>(code blocks) Name of programming language (<code>ruby</code>) for syntax highlighting.</p>
430
-
431
- <p>Default for this is <code>code_lang</code> in document.</p>
432
-
433
- <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>
434
- </dd>
435
-
436
- <dt><strong><code>code_show_spaces</code></strong></dt>
437
-
438
- <dd>
439
- <p>Shows tabs and newlines (default is read in the document object).</p>
440
- </dd>
441
-
442
- <dt><strong><code>code_background_color</code></strong></dt>
443
-
444
- <dd>
445
- <p>Background color for code blocks. (default is read in the document object).</p>
446
-
447
- <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>
448
-
449
- <ul>
450
- <li>
451
- <p>for <strong>HTML output</strong>, the value is put straight in the <code>background-color</code> CSS property of the block.</p>
452
- </li>
453
-
454
- <li>
455
- <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>
456
-
457
- <p>For example, for <code>#0000ff</code>, the macro is called as: <code>\color[rgb]{0,0,1}</code>.</p>
458
- </li>
459
- </ul>
460
- </dd>
461
- </dl>
462
-
463
- <h3 id='examples'><span class='maruku_section_number'>6.4. </span>Examples</h3>
464
-
465
- <p>An example of this is the following:</p>
466
- <pre><code> One space
467
- Two spaces
468
- Tab, space, tab
469
- Tab, tab, tab and all is green!
470
- {:code_show_spaces code_background_color=#ffeedd}</code></pre>
471
- <p>That will produce:</p>
472
- <pre style='background-color: #ffeedd;'><code>&not;One&not;space
473
- &not;&not;Two&not;spaces
474
- &raquo;&nbsp;&nbsp;&nbsp;&not;&raquo;&nbsp;&nbsp;&nbsp;Tab,&not;space,&not;tab
475
- &raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;Tab,&not;tab,&not;tab&not;and&not;all&not;is&not;green!</code></pre>
476
- <p>Or highlighting (support depends on languages):</p>
477
- <pre><code> &lt;div style=&quot;text-align:center&quot;&gt;Div&lt;/div&gt;
478
- {:lang=html}
479
- </code></pre>
480
- <p>produces:</p>
481
- <pre class='xml'><span class='punct'>&lt;</span><span class='tag'>div</span> <span class='attribute'>style</span><span class='punct'>=&quot;</span><span class='string'>text-align:center</span><span class='punct'>&quot;&gt;</span>Div<span class='punct'>&lt;/</span><span class='tag'>div</span><span class='punct'>&gt;</span></pre><hr />
482
- <h2 id='features'><span class='maruku_section_number'>7. </span>Other Features</h2>
483
-
484
- <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>
485
-
486
- <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>
487
- <pre><code>* This will become a table of contents (this text will be scraped).
488
- {:toc}
489
- </code></pre>
490
- <p>You can see an example of this at the beginning of this document.</p>
491
-
492
- <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>
493
-
494
- <p>Note that this header contains formatting and it still works, also in the table of contents.</p>
495
-
496
- <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>
497
-
498
- <h3 id='use_html_entities'><span class='maruku_section_number'>7.3. </span>Use HTML entities</h3>
499
-
500
- <p>If you want to use HTML entities, go on! We will take care of the translation to LaTeX:</p>
501
- <table><thead><tr><th>Entity</th><th>Result</th></tr></thead><tbody><tr><td style='text-align: left;'><code>&amp;copy;</code></td><td style='text-align: left;'>&copy;</td></tr><tr><td style='text-align: left;'><code>&amp;pound;</code></td><td style='text-align: left;'>&pound;</td></tr><tr><td style='text-align: left;'><code>a&amp;nbsp;b</code></td><td style='text-align: left;'>a&nbsp;b</td></tr><tr><td style='text-align: left;'><code>&amp;lambda;</code></td><td style='text-align: left;'>&lambda;</td></tr><tr><td style='text-align: left;'><code>&amp;mdash;</code></td><td style='text-align: left;'>&mdash;</td></tr></tbody></table>
502
- <h2 id='future'><span class='maruku_section_number'>8. </span>Future developments</h2>
503
-
504
- <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>
505
-
506
- <h3 id='a_syntax_for_adding_math'><span class='maruku_section_number'>8.1. </span>A syntax for adding math</h3>
507
-
508
- <p>Something inspired from LaTeX should be familiar to all:</p>
509
- <pre><code>This is inline math: $\alpha$
510
-
511
-
512
- This is an equation with label:
290
+ I think that [Pandoc] and [MultiMarkdown] are very cool projects.
291
+ However, they are written in Haskell and Perl, respectively.
292
+ I would love to have an equivalent in Ruby.
513
293
 
514
- $ \alpha = \beta + \gamma $ (eq:1)
294
+ [Pandoc]: http://sophos.berkeley.edu/macfarlane/pandoc/
295
+ [MultiMarkdown]: http://fletcher.freeshell.org/wiki/MultiMarkdown
515
296
 
516
- This is a reference to equation: please see (eq:1)</code></pre><div class='footnotes'><hr /><ol><li id='fn:1'>
297
+ --><div class='footnotes'><hr /><ol><li id='fn:1'>
517
298
  <p>I really was missing those.</p>
518
- <a href='#fnref:1' rev='footnote'>&#8617;</a></li></ol></div></body></html>
299
+ <a href='#fnref:1' rev='footnote'>&#8617;</a></li></ol></div><div class='maruku_signature'><hr /><span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown-superset interpreter for Ruby'>Maruku</a> at 14:11 on Tuesday, January 23rd, 2007.</span></div></body></html>