maruku 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -108,7 +108,7 @@
108
108
  &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;sigmaf;</code> &sigmaf; (<code style='background-color: #ffe;'>$\varsigma$</code>)
109
109
  &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;weierp;</code> &weierp; (<code style='background-color: #ffe;'>$\wp$</code>)
110
110
  &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;Auml;</code> &Auml; (<code style='background-color: #ffe;'>\&quot;A</code>)
111
- &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;apos;</code> &apos; (<code style='background-color: #ffe;'>&apos;</code>)
111
+ &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;apos;</code> &#39; (<code style='background-color: #ffe;'>&apos;</code>)
112
112
  &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;micro;</code> &micro; (<code style='background-color: #ffe;'>$\mu$</code>)
113
113
  &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;Icirc;</code> &Icirc; (<code style='background-color: #ffe;'>\^I</code>)
114
114
  &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;xi;</code> &xi; (<code style='background-color: #ffe;'>$\xi$</code>)
@@ -250,4 +250,4 @@
250
250
  &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;mu;</code> &mu; (<code style='background-color: #ffe;'>$\mu$</code>)
251
251
  &nbsp;&nbsp;&nbsp;<code style='background-color: #eef;'>&amp;hellip;</code> &hellip; (<code style='background-color: #ffe;'>\ldots</code>)
252
252
  &nbsp;&nbsp;&nbsp;</p>
253
- <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 23:18 on Monday, January 08th, 2007.</span></div></body></html>
253
+ <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>
@@ -0,0 +1,92 @@
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></title><link href='style.css' rel='stylesheet' type='text/css' /></head><body>
5
+ <h1>Auto-extracted documentation</h1>
6
+
7
+ <p>This documentation is auto-generated by reading from the Ruby source for <code>maruku</code> by the program <code>docs/exd/exd.rb</code>.</p>
8
+
9
+ <p>It is important to have documentation near the code!</p>
10
+
11
+ <p>Each block is delimited by <code>=begin</code> and <code>=end</code> blocks and is a Markdown document:</p>
12
+ <pre><code>...
13
+ =begin maruku_doc
14
+ Attribute: att1
15
+ Summary: summary for attribute
16
+
17
+ Expanded documentation (Markdown format)
18
+ =end
19
+ ...</code></pre>
20
+ <h2>Attribute documentation</h2>
21
+
22
+ <h3 id='encoding'>Attribute <code>encoding</code></h3>
23
+
24
+ <p>Read from file <code>input/parse_doc.rb</code>, line 35:</p>
25
+
26
+ <p>If the <code>encoding</code> attribute is specified, then the content will be converted from the specified encoding to UTF-8.</p>
27
+
28
+ <p>Conversion happens using the <code>iconv</code> library.</p>
29
+
30
+ <h3 id='exec'>Attribute <code>exec</code></h3>
31
+
32
+ <p>Read from file <code>input/parse_doc.rb</code>, line 86:</p>
33
+
34
+ <p>Disabled by default because of security concerns.</p>
35
+
36
+ <h3 id='latex_cjk'>Attribute <code>latex_cjk</code></h3>
37
+
38
+ <p>Read from file <code>output/to_latex.rb</code>, line 56:</p>
39
+
40
+ <p>If the <code>latex_cjk</code> attribute is specified, then appropriate headers are added to the LaTeX preamble to support Japanese fonts. You have to have these fonts installed &ndash; and this can be a pain.</p>
41
+
42
+ <p>If <code>latex_cjk</code> is specified, this is added to the preamble:</p>
43
+ <?mrk md_codeblock(Maruku::MDDocument::Latex_preamble_enc_cjk)?>
44
+ <p>while the default is to add this:</p>
45
+ <?mrk md_codeblock(Maruku::MDDocument::Latex_preamble_enc_utf8)?>
46
+ <h3 id='latex_preamble'>Attribute <code>latex_preamble</code></h3>
47
+
48
+ <p>Read from file <code>output/to_latex.rb</code>, line 78:</p>
49
+
50
+ <p>If the <code>latex_preamble</code> attribute is specified, then its value will be used as a custom preamble.</p>
51
+
52
+ <p>For example:</p>
53
+ <pre><code>Title: My document
54
+ Latex preamble: preamble.tex
55
+ </code></pre>
56
+ <p>will produce:</p>
57
+ <pre><code>...
58
+ \input{preamble.tex}
59
+ ...</code></pre>
60
+ <h3 id='latex_use_listings'>Attribute <code>latex_use_listings</code></h3>
61
+
62
+ <p>Read from file <code>output/to_latex.rb</code>, line 181:</p>
63
+
64
+ <p>If the <code>latex_use_listings</code> attribute is specified, then code block are rendered using the <code>listings</code> package. Otherwise, a standard <code>verbatim</code> environment is used.</p>
65
+
66
+ <ul>
67
+ <li>
68
+ <p>If the <code>lang</code> attribute for the code block has been specified, it gets passed to the <code>listings</code> package using the <code>lstset</code> macro. The default lang for code blocks is specified through the <code>code_lang</code> attribute.</p>
69
+ <pre><code>\lstset{language=ruby}
70
+ </code></pre>
71
+ <p>Please refer to the documentation of the <code>listings</code> package for supported languages.</p>
72
+
73
+ <p>If a language is not supported, the <code>listings</code> package will emit a warning during the compilation. Just press enter and nothing wrong will happen.</p>
74
+ </li>
75
+
76
+ <li>
77
+ <p>If the <code>code_show_spaces</code> is specified, than spaces and tabs will be shown using the macro:</p>
78
+ <pre><code>\lstset{showspaces=true,showtabs=true}</code></pre></li>
79
+
80
+ <li>
81
+ <p>The background color is given by <code>code_background_color</code>.</p>
82
+ </li>
83
+ </ul>
84
+
85
+ <h2>Other misc. documentation</h2>
86
+
87
+ <p>This other documentation are other bits and pieces found in the code that are not related to attributes.</p>
88
+
89
+ <p>Admissible formats:</p>
90
+ <pre><code>green
91
+ #abc
92
+ #aabbcc</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 10:34 on Tuesday, January 09th, 2007.</span></div></body></html>
@@ -2,10 +2,18 @@
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
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>
6
+
5
7
  <h1 id='maruku_a_markdownsuperset_interpreter'>Mar<strong>u</strong>k<strong>u</strong>: a Markdown-superset interpreter</h1>
6
8
 
7
9
  <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>
8
10
 
11
+ <blockquote id='news'>
12
+ <p><a href='#release_notes'>Last release</a> is version 0.4.2 &ndash; 2007-01-12.</p>
13
+
14
+ <p>Use this command to update:</p>
15
+ <pre><code>$ gem update maruku</code></pre></blockquote>
16
+ <hr />
9
17
  <p>Maruku allows you to write in an easy-to-read-and-write syntax, like this:</p>
10
18
 
11
19
  <blockquote>
@@ -54,13 +62,53 @@
54
62
 
55
63
  <p>Have fun!</p>
56
64
 
65
+ <h4 id='last'>Changes in 0.4.2</h4>
66
+
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
+
72
+ <li>
73
+ <p>Changes in LaTeX export:</p>
74
+
75
+ <ul>
76
+ <li>
77
+ <p>Links to external URLs are blue by default.</p>
78
+ </li>
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
85
+
86
+ Content</code></pre></li>
87
+ </ul>
88
+ </li>
89
+
90
+ <li>
91
+ <p>Bug fixes</p>
92
+
93
+ <ul>
94
+ <li>
95
+ <p>Images were not given <code>id</code> or <code>class</code> attributes.</p>
96
+ </li>
97
+
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>
104
+
57
105
  <h4 id='changes_in_041_aka_typographer'>Changes in 0.4.1 aka &ldquo;Typographer&rdquo;</h4>
58
106
 
59
107
  <ul>
60
108
  <li>
61
109
  <p>Implemented SmartyPants support:</p>
62
- <pre><code>&apos;Twas a &quot;test&quot; to &apos;remember&apos; -- in the &apos;90s
63
- --- while I was &lt;&lt;ok&gt;&gt;. She was 6\&quot;12\&apos;.</code></pre>
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>
64
112
  <blockquote>
65
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>
66
114
  </blockquote>
@@ -202,11 +250,13 @@ Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pr
202
250
  <p>The development site is <a href='http://rubyforge.org/projects/maruku/'>http://rubyforge.org/projects/maruku/</a>.</p>
203
251
 
204
252
  <p>Install with:</p>
205
- <pre class='sh' style='background-color: #efefff;'>$ gem install maruku</pre>
253
+ <pre><code>$ gem install maruku
254
+ </code></pre>
206
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>
207
256
 
208
257
  <p>Anonymous access to the repository is possible with:</p>
209
- <pre class='sh' style='background-color: #efefff;'>$ svn checkout svn://rubyforge.org/var/svn/maruku</pre>
258
+ <pre><code>$ svn checkout svn://rubyforge.org/var/svn/maruku
259
+ </code></pre>
210
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>
211
261
 
212
262
  <h3 id='bugs_report'><span class='maruku_section_number'>2.1. </span>Bugs report</h3>
@@ -216,15 +266,18 @@ Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pr
216
266
  <h2 id='usage'><span class='maruku_section_number'>3. </span>Usage</h2>
217
267
 
218
268
  <p>This is the basic usage:</p>
219
- <pre class='ruby' style='background-color: #efffef;'><span class='ident'>require</span> <span class='punct'>'</span><span class='string'>rubygems</span><span class='punct'>'</span>
220
- <span class='ident'>require</span> <span class='punct'>'</span><span class='string'>maruku</span><span class='punct'>'</span>
269
+ <pre><code>require &#39;rubygems&#39;
270
+ require &#39;maruku&#39;
221
271
 
222
- <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>
223
- <span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html</span></pre>
272
+ doc = Maruku.new(markdown_string)
273
+ puts doc.to_html
274
+ </code></pre>
224
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>
225
- <pre class='ruby' style='background-color: #efffef;'><span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html_document</span></pre>
276
+ <pre><code>puts doc.to_html_document
277
+ </code></pre>
226
278
  <p>You can have the REXML document tree with:</p>
227
- <pre class='ruby' style='background-color: #efffef;'><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>
279
+ <pre><code>tree = doc.to_html_document_tree
280
+ </code></pre>
228
281
  <h3 id='from_the_command_line'><span class='maruku_section_number'>3.1. </span>From the command line</h3>
229
282
 
230
283
  <p>There are two command-line programs installed: <code>maruku</code> and <code>marutex</code>.</p>
@@ -232,11 +285,11 @@ Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pr
232
285
  <ul>
233
286
  <li>
234
287
  <p><code>maruku</code> converts Markdown to HTML:</p>
235
- <pre class='sh' style='background-color: #efefff;'>$ maruku file.md # creates file.html</pre></li>
288
+ <pre><code>$ maruku file.md # creates file.html</code></pre></li>
236
289
 
237
290
  <li>
238
291
  <p><code>marutex</code> converts Markdown to LaTeX, then calls <code>pdflatex</code> to transform to PDF:</p>
239
- <pre class='sh' style='background-color: #efefff;'>$ marutex file.md # creates file.tex and file.pdf</pre></li>
292
+ <pre><code>$ marutex file.md # creates file.tex and file.pdf</code></pre></li>
240
293
  </ul>
241
294
 
242
295
  <h2 id='extra'><span class='maruku_section_number'>4. </span>Examples of PHP Markdown Extra syntax</h2>
@@ -244,13 +297,13 @@ Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pr
244
297
  <ul>
245
298
  <li>
246
299
  <p>tables</p>
247
- <pre style='background-color: #ffefef;'><code>Col1 | Very very long head | Very very long head|
300
+ <pre><code>Col1 | Very very long head | Very very long head|
248
301
  -----|:-------------------:|-------------------:|
249
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>
250
303
 
251
304
  <li>
252
305
  <p>footnotes <sup id='fnref:1'><a href='#fn:1' rel='footnote'>1</a></sup></p>
253
- <pre style='background-color: #ffefef;'><code>* footnotes [^foot]
306
+ <pre><code>* footnotes [^foot]
254
307
 
255
308
  [^foot]: I really was missing those.</code></pre></li>
256
309
  </ul>
@@ -266,13 +319,13 @@ cell | center-align | right-align |</code></pre><table><thead><tr>
266
319
 
267
320
  <li>
268
321
  <p>header ids</p>
269
- <pre style='background-color: #ffefef;'><code>## Download ## {#download}</code></pre>
322
+ <pre><code>## Download ## {#download}</code></pre>
270
323
  <p>For example, <a href='#download'>a link to the download</a> header.</p>
271
324
  </li>
272
325
 
273
326
  <li>
274
327
  <p>definition lists</p>
275
- <pre style='background-color: #ffefef;'><code>Definition list
328
+ <pre><code>Definition list
276
329
  : something very hard to parse</code></pre>
277
330
  <dl>
278
331
  <dt>Definition list</dt>
@@ -317,13 +370,14 @@ cell | center-align | right-align |</code></pre><table><thead><tr>
317
370
  <h3 id='metadata_for_the_document'><span class='maruku_section_number'>6.2. </span>Meta-data for the document</h3>
318
371
 
319
372
  <p>Meta-data for the document itself is specified through the use of email headers:</p>
320
- <pre style='background-color: #ffefef;'><code>Title: A simple document containing meta-headers
373
+ <pre><code>Title: A simple document containing meta-headers
321
374
  CSS: style.css
322
375
 
323
376
  Content of the document
324
377
  </code></pre>
325
378
  <p>When creating the document through</p>
326
- <pre class='ruby' style='background-color: #efffef;'><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>
379
+ <pre><code>Maruku.new(s).to_html_document
380
+ </code></pre>
327
381
  <p>the title and stylesheet are added as expected.</p>
328
382
 
329
383
  <p>Meta-data keys are assumed to be case-insensitive.</p>
@@ -409,11 +463,11 @@ Content of the document
409
463
  <h3 id='examples'><span class='maruku_section_number'>6.4. </span>Examples</h3>
410
464
 
411
465
  <p>An example of this is the following:</p>
412
- <pre style='background-color: #ffefef;'><code> One space
466
+ <pre><code> One space
413
467
  Two spaces
414
468
  Tab, space, tab
415
469
  Tab, tab, tab and all is green!
416
- {code_show_spaces code_background_color=#ffeedd}</code></pre>
470
+ {:code_show_spaces code_background_color=#ffeedd}</code></pre>
417
471
  <p>That will produce:</p>
418
472
  <pre style='background-color: #ffeedd;'><code>&not;One&not;space
419
473
  &not;&not;Two&not;spaces
@@ -421,7 +475,7 @@ Content of the document
421
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>
422
476
  <p>Or highlighting (support depends on languages):</p>
423
477
  <pre><code> &lt;div style=&quot;text-align:center&quot;&gt;Div&lt;/div&gt;
424
- {lang=html}
478
+ {:lang=html}
425
479
  </code></pre>
426
480
  <p>produces:</p>
427
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 />
@@ -431,7 +485,7 @@ Content of the document
431
485
 
432
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>
433
487
  <pre><code>* This will become a table of contents (this text will be scraped).
434
- {toc}
488
+ {:toc}
435
489
  </code></pre>
436
490
  <p>You can see an example of this at the beginning of this document.</p>
437
491
 
@@ -461,4 +515,4 @@ $ \alpha = \beta + \gamma $ (eq:1)
461
515
 
462
516
  This is a reference to equation: please see (eq:1)</code></pre><div class='footnotes'><hr /><ol><li id='fn:1'>
463
517
  <p>I really was missing those.</p>
464
- <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 interpreter for Ruby'>Maruku</a> at 23:43 on Monday, January 08th, 2007.</span></div></body></html>
518
+ <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 interpreter for Ruby'>Maruku</a> at 13:45 on Thursday, January 11st, 2007.</span></div></body></html>
@@ -191,7 +191,7 @@ id sem consectetuer libero luctus adipiscing.
191
191
  &gt; 1. This is the first list item.
192
192
  &gt; 2. This is the second list item.
193
193
  &gt;
194
- &gt; Here&apos;s some example code:
194
+ &gt; Here&#39;s some example code:
195
195
  &gt;
196
196
  &gt; return shell_exec(&quot;echo $input | $markdown_script&quot;);
197
197
  </code></pre>
@@ -291,7 +291,7 @@ Suspendisse id sem consectetuer libero luctus adipiscing.
291
291
  <p>It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy:</p>
292
292
  <pre><code>* This is a list item with two paragraphs.
293
293
 
294
- This is the second paragraph in the list item. You&apos;re
294
+ This is the second paragraph in the list item. You&#39;re
295
295
  only required to indent the first line. Lorem ipsum dolor
296
296
  sit amet, consectetuer adipiscing elit.
297
297
 
@@ -416,7 +416,7 @@ title attribute.&lt;/p&gt;
416
416
 
417
417
  <p>The following three link definitions are equivalent:</p>
418
418
  <pre><code>[foo]: http://example.com/ &quot;Optional Title Here&quot;
419
- [foo]: http://example.com/ &apos;Optional Title Here&apos;
419
+ [foo]: http://example.com/ &#39;Optional Title Here&#39;
420
420
  [foo]: http://example.com/ (Optional Title Here)
421
421
  </code></pre>
422
422
  <p><strong>Note:</strong> There is a known bug in Markdown.pl 1.0.1 which prevents single quotes from being used to delimit link titles.</p>
@@ -534,10 +534,10 @@ A backtick-delimited string in a code span: `` `foo` ``
534
534
  &lt;p&gt;A backtick-delimited string in a code span: &lt;code&gt;`foo`&lt;/code&gt;&lt;/p&gt;
535
535
  </code></pre>
536
536
  <p>With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to include example HTML tags. Markdown will turn this:</p>
537
- <pre><code>Please don&apos;t use any `&lt;blink&gt;` tags.
537
+ <pre><code>Please don&#39;t use any `&lt;blink&gt;` tags.
538
538
  </code></pre>
539
539
  <p>into:</p>
540
- <pre><code>&lt;p&gt;Please don&apos;t use any &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
540
+ <pre><code>&lt;p&gt;Please don&#39;t use any &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
541
541
  </code></pre>
542
542
  <p>You can write this:</p>
543
543
  <pre><code>`&amp;#8212;` is the decimal-encoded equivalent of `&amp;mdash;`.
@@ -608,4 +608,4 @@ _ underscore
608
608
  + plus sign
609
609
  - minus sign (hyphen)
610
610
  . 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 23:18 on Monday, January 08th, 2007.</span></div></body></html>
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>
@@ -2,10 +2,18 @@
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
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>
6
+
5
7
  <h1 id='maruku_a_markdownsuperset_interpreter'>Mar<strong>u</strong>k<strong>u</strong>: a Markdown-superset interpreter</h1>
6
8
 
7
9
  <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>
8
10
 
11
+ <blockquote id='news'>
12
+ <p><a href='#release_notes'>Last release</a> is version 0.4.2 &ndash; 2007-01-12.</p>
13
+
14
+ <p>Use this command to update:</p>
15
+ <pre><code>$ gem update maruku</code></pre></blockquote>
16
+ <hr />
9
17
  <p>Maruku allows you to write in an easy-to-read-and-write syntax, like this:</p>
10
18
 
11
19
  <blockquote>
@@ -54,6 +62,46 @@
54
62
 
55
63
  <p>Have fun!</p>
56
64
 
65
+ <h4 id='last'>Changes in 0.4.2</h4>
66
+
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
+
72
+ <li>
73
+ <p>Changes in LaTeX export:</p>
74
+
75
+ <ul>
76
+ <li>
77
+ <p>Links to external URLs are blue by default.</p>
78
+ </li>
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
85
+
86
+ Content</code></pre></li>
87
+ </ul>
88
+ </li>
89
+
90
+ <li>
91
+ <p>Bug fixes</p>
92
+
93
+ <ul>
94
+ <li>
95
+ <p>Images were not given <code>id</code> or <code>class</code> attributes.</p>
96
+ </li>
97
+
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>
104
+
57
105
  <h4 id='changes_in_041_aka_typographer'>Changes in 0.4.1 aka &ldquo;Typographer&rdquo;</h4>
58
106
 
59
107
  <ul>
@@ -202,11 +250,13 @@ Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pr
202
250
  <p>The development site is <a href='http://rubyforge.org/projects/maruku/'>http://rubyforge.org/projects/maruku/</a>.</p>
203
251
 
204
252
  <p>Install with:</p>
205
- <pre class='sh' style='background-color: #efefff;'>$ gem install maruku</pre>
253
+ <pre><code>$ gem install maruku
254
+ </code></pre>
206
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>
207
256
 
208
257
  <p>Anonymous access to the repository is possible with:</p>
209
- <pre class='sh' style='background-color: #efefff;'>$ svn checkout svn://rubyforge.org/var/svn/maruku</pre>
258
+ <pre><code>$ svn checkout svn://rubyforge.org/var/svn/maruku
259
+ </code></pre>
210
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>
211
261
 
212
262
  <h3 id='bugs_report'><span class='maruku_section_number'>2.1. </span>Bugs report</h3>
@@ -216,15 +266,18 @@ Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pr
216
266
  <h2 id='usage'><span class='maruku_section_number'>3. </span>Usage</h2>
217
267
 
218
268
  <p>This is the basic usage:</p>
219
- <pre class='ruby' style='background-color: #efffef;'><span class='ident'>require</span> <span class='punct'>'</span><span class='string'>rubygems</span><span class='punct'>'</span>
220
- <span class='ident'>require</span> <span class='punct'>'</span><span class='string'>maruku</span><span class='punct'>'</span>
269
+ <pre><code>require &#39;rubygems&#39;
270
+ require &#39;maruku&#39;
221
271
 
222
- <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>
223
- <span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html</span></pre>
272
+ doc = Maruku.new(markdown_string)
273
+ puts doc.to_html
274
+ </code></pre>
224
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>
225
- <pre class='ruby' style='background-color: #efffef;'><span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html_document</span></pre>
276
+ <pre><code>puts doc.to_html_document
277
+ </code></pre>
226
278
  <p>You can have the REXML document tree with:</p>
227
- <pre class='ruby' style='background-color: #efffef;'><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>
279
+ <pre><code>tree = doc.to_html_document_tree
280
+ </code></pre>
228
281
  <h3 id='from_the_command_line'><span class='maruku_section_number'>3.1. </span>From the command line</h3>
229
282
 
230
283
  <p>There are two command-line programs installed: <code>maruku</code> and <code>marutex</code>.</p>
@@ -232,11 +285,11 @@ Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pr
232
285
  <ul>
233
286
  <li>
234
287
  <p><code>maruku</code> converts Markdown to HTML:</p>
235
- <pre class='sh' style='background-color: #efefff;'>$ maruku file.md # creates file.html</pre></li>
288
+ <pre><code>$ maruku file.md # creates file.html</code></pre></li>
236
289
 
237
290
  <li>
238
291
  <p><code>marutex</code> converts Markdown to LaTeX, then calls <code>pdflatex</code> to transform to PDF:</p>
239
- <pre class='sh' style='background-color: #efefff;'>$ marutex file.md # creates file.tex and file.pdf</pre></li>
292
+ <pre><code>$ marutex file.md # creates file.tex and file.pdf</code></pre></li>
240
293
  </ul>
241
294
 
242
295
  <h2 id='extra'><span class='maruku_section_number'>4. </span>Examples of PHP Markdown Extra syntax</h2>
@@ -244,13 +297,13 @@ Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pr
244
297
  <ul>
245
298
  <li>
246
299
  <p>tables</p>
247
- <pre style='background-color: #ffefef;'><code>Col1 | Very very long head | Very very long head|
300
+ <pre><code>Col1 | Very very long head | Very very long head|
248
301
  -----|:-------------------:|-------------------:|
249
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>
250
303
 
251
304
  <li>
252
305
  <p>footnotes <sup id='fnref:1'><a href='#fn:1' rel='footnote'>1</a></sup></p>
253
- <pre style='background-color: #ffefef;'><code>* footnotes [^foot]
306
+ <pre><code>* footnotes [^foot]
254
307
 
255
308
  [^foot]: I really was missing those.</code></pre></li>
256
309
  </ul>
@@ -266,13 +319,13 @@ cell | center-align | right-align |</code></pre><table><thead><tr>
266
319
 
267
320
  <li>
268
321
  <p>header ids</p>
269
- <pre style='background-color: #ffefef;'><code>## Download ## {#download}</code></pre>
322
+ <pre><code>## Download ## {#download}</code></pre>
270
323
  <p>For example, <a href='#download'>a link to the download</a> header.</p>
271
324
  </li>
272
325
 
273
326
  <li>
274
327
  <p>definition lists</p>
275
- <pre style='background-color: #ffefef;'><code>Definition list
328
+ <pre><code>Definition list
276
329
  : something very hard to parse</code></pre>
277
330
  <dl>
278
331
  <dt>Definition list</dt>
@@ -317,13 +370,14 @@ cell | center-align | right-align |</code></pre><table><thead><tr>
317
370
  <h3 id='metadata_for_the_document'><span class='maruku_section_number'>6.2. </span>Meta-data for the document</h3>
318
371
 
319
372
  <p>Meta-data for the document itself is specified through the use of email headers:</p>
320
- <pre style='background-color: #ffefef;'><code>Title: A simple document containing meta-headers
373
+ <pre><code>Title: A simple document containing meta-headers
321
374
  CSS: style.css
322
375
 
323
376
  Content of the document
324
377
  </code></pre>
325
378
  <p>When creating the document through</p>
326
- <pre class='ruby' style='background-color: #efffef;'><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>
379
+ <pre><code>Maruku.new(s).to_html_document
380
+ </code></pre>
327
381
  <p>the title and stylesheet are added as expected.</p>
328
382
 
329
383
  <p>Meta-data keys are assumed to be case-insensitive.</p>
@@ -409,11 +463,11 @@ Content of the document
409
463
  <h3 id='examples'><span class='maruku_section_number'>6.4. </span>Examples</h3>
410
464
 
411
465
  <p>An example of this is the following:</p>
412
- <pre style='background-color: #ffefef;'><code> One space
466
+ <pre><code> One space
413
467
  Two spaces
414
468
  Tab, space, tab
415
469
  Tab, tab, tab and all is green!
416
- {code_show_spaces code_background_color=#ffeedd}</code></pre>
470
+ {:code_show_spaces code_background_color=#ffeedd}</code></pre>
417
471
  <p>That will produce:</p>
418
472
  <pre style='background-color: #ffeedd;'><code>&not;One&not;space
419
473
  &not;&not;Two&not;spaces
@@ -421,7 +475,7 @@ Content of the document
421
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>
422
476
  <p>Or highlighting (support depends on languages):</p>
423
477
  <pre><code> &lt;div style=&quot;text-align:center&quot;&gt;Div&lt;/div&gt;
424
- {lang=html}
478
+ {:lang=html}
425
479
  </code></pre>
426
480
  <p>produces:</p>
427
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 />
@@ -431,7 +485,7 @@ Content of the document
431
485
 
432
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>
433
487
  <pre><code>* This will become a table of contents (this text will be scraped).
434
- {toc}
488
+ {:toc}
435
489
  </code></pre>
436
490
  <p>You can see an example of this at the beginning of this document.</p>
437
491
 
@@ -461,4 +515,4 @@ $ \alpha = \beta + \gamma $ (eq:1)
461
515
 
462
516
  This is a reference to equation: please see (eq:1)</code></pre><div class='footnotes'><hr /><ol><li id='fn:1'>
463
517
  <p>I really was missing those.</p>
464
- <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 interpreter for Ruby'>Maruku</a> at 23:50 on Monday, January 08th, 2007.</span></div></body></html>
518
+ <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 interpreter for Ruby'>Maruku</a> at 13:45 on Thursday, January 11st, 2007.</span></div></body></html>