maruku 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/maruku +41 -25
- data/docs/char.html +1924 -0
- data/docs/entity_test.html +2 -2
- data/docs/exd.html +92 -0
- data/docs/index.html +77 -23
- data/docs/markdown_syntax.html +6 -6
- data/docs/maruku.html +75 -21
- data/docs/maruku.md +60 -26
- data/docs/proposal.html +105 -123
- data/docs/proposal.md +121 -109
- data/lib/maruku/attributes.rb +33 -1
- data/lib/maruku/defaults.rb +8 -0
- data/lib/maruku/input/charsource.rb +8 -2
- data/lib/maruku/input/parse_block.rb +44 -18
- data/lib/maruku/input/parse_doc.rb +28 -26
- data/lib/maruku/input/parse_span_better.rb +57 -41
- data/lib/maruku/input/type_detection.rb +3 -2
- data/lib/maruku/output/to_html.rb +6 -6
- data/lib/maruku/output/to_latex.rb +21 -5
- data/lib/maruku/structures.rb +0 -4
- data/lib/maruku/tests/new_parser.rb +6 -1
- data/lib/maruku/version.rb +1 -1
- data/tests/unittest/attributes/att2.md +36 -0
- data/tests/unittest/attributes/att3.md +55 -0
- data/tests/unittest/attributes/attributes.md +23 -18
- data/tests/unittest/attributes/circular.md +9 -9
- data/tests/unittest/email.md +2 -2
- data/tests/unittest/links.md +2 -2
- data/tests/unittest/misc_sw.md +1 -1
- data/tests/unittest/syntax_hl.md +3 -5
- data/tests/unittest/xml_instruction.md +1 -2
- metadata +6 -2
data/docs/entity_test.html
CHANGED
@@ -108,7 +108,7 @@
|
|
108
108
|
<code style='background-color: #eef;'>&sigmaf;</code> ς (<code style='background-color: #ffe;'>$\varsigma$</code>)
|
109
109
|
<code style='background-color: #eef;'>&weierp;</code> ℘ (<code style='background-color: #ffe;'>$\wp$</code>)
|
110
110
|
<code style='background-color: #eef;'>&Auml;</code> Ä (<code style='background-color: #ffe;'>\"A</code>)
|
111
|
-
<code style='background-color: #eef;'>&apos;</code>
|
111
|
+
<code style='background-color: #eef;'>&apos;</code> ' (<code style='background-color: #ffe;'>'</code>)
|
112
112
|
<code style='background-color: #eef;'>&micro;</code> µ (<code style='background-color: #ffe;'>$\mu$</code>)
|
113
113
|
<code style='background-color: #eef;'>&Icirc;</code> Î (<code style='background-color: #ffe;'>\^I</code>)
|
114
114
|
<code style='background-color: #eef;'>&xi;</code> ξ (<code style='background-color: #ffe;'>$\xi$</code>)
|
@@ -250,4 +250,4 @@
|
|
250
250
|
<code style='background-color: #eef;'>&mu;</code> μ (<code style='background-color: #ffe;'>$\mu$</code>)
|
251
251
|
<code style='background-color: #eef;'>&hellip;</code> … (<code style='background-color: #ffe;'>\ldots</code>)
|
252
252
|
</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
|
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>
|
data/docs/exd.html
ADDED
@@ -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 – 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>
|
data/docs/index.html
CHANGED
@@ -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 – 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><</code>,<code>></code> enclosed URLs: <code><google.com></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 “Typographer”</h4>
|
58
106
|
|
59
107
|
<ul>
|
60
108
|
<li>
|
61
109
|
<p>Implemented SmartyPants support:</p>
|
62
|
-
<pre><code
|
63
|
-
--- while I was <<ok>>. She was 6\"12
|
110
|
+
<pre><code>'Twas a "test" to 'remember' -- in the '90s
|
111
|
+
--- while I was <<ok>>. She was 6\"12\'.</code></pre>
|
64
112
|
<blockquote>
|
65
113
|
<p>‘Twas a “test” to ‘remember’ – in the ’90s — while I was «ok». She was 6"12'.</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
|
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
|
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
|
220
|
-
|
269
|
+
<pre><code>require 'rubygems'
|
270
|
+
require 'maruku'
|
221
271
|
|
222
|
-
|
223
|
-
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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>¬One¬space
|
419
473
|
¬¬Two¬spaces
|
@@ -421,7 +475,7 @@ Content of the document
|
|
421
475
|
» » » Tab,¬tab,¬tab¬and¬all¬is¬green!</code></pre>
|
422
476
|
<p>Or highlighting (support depends on languages):</p>
|
423
477
|
<pre><code> <div style="text-align:center">Div</div>
|
424
|
-
{lang=html}
|
478
|
+
{:lang=html}
|
425
479
|
</code></pre>
|
426
480
|
<p>produces:</p>
|
427
481
|
<pre class='xml'><span class='punct'><</span><span class='tag'>div</span> <span class='attribute'>style</span><span class='punct'>="</span><span class='string'>text-align:center</span><span class='punct'>"></span>Div<span class='punct'></</span><span class='tag'>div</span><span class='punct'>></span></pre><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'>↩</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
|
518
|
+
<a href='#fnref:1' rev='footnote'>↩</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>
|
data/docs/markdown_syntax.html
CHANGED
@@ -191,7 +191,7 @@ id sem consectetuer libero luctus adipiscing.
|
|
191
191
|
> 1. This is the first list item.
|
192
192
|
> 2. This is the second list item.
|
193
193
|
>
|
194
|
-
> Here
|
194
|
+
> Here's some example code:
|
195
195
|
>
|
196
196
|
> return shell_exec("echo $input | $markdown_script");
|
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
|
294
|
+
This is the second paragraph in the list item. You'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.</p>
|
|
416
416
|
|
417
417
|
<p>The following three link definitions are equivalent:</p>
|
418
418
|
<pre><code>[foo]: http://example.com/ "Optional Title Here"
|
419
|
-
[foo]: http://example.com/
|
419
|
+
[foo]: http://example.com/ 'Optional Title Here'
|
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
|
<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
|
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
|
537
|
+
<pre><code>Please don't use any `<blink>` tags.
|
538
538
|
</code></pre>
|
539
539
|
<p>into:</p>
|
540
|
-
<pre><code><p>Please don
|
540
|
+
<pre><code><p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
|
541
541
|
</code></pre>
|
542
542
|
<p>You can write this:</p>
|
543
543
|
<pre><code>`&#8212;` is the decimal-encoded equivalent of `&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
|
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>
|
data/docs/maruku.html
CHANGED
@@ -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 – 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><</code>,<code>></code> enclosed URLs: <code><google.com></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 “Typographer”</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
|
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
|
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
|
220
|
-
|
269
|
+
<pre><code>require 'rubygems'
|
270
|
+
require 'maruku'
|
221
271
|
|
222
|
-
|
223
|
-
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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>¬One¬space
|
419
473
|
¬¬Two¬spaces
|
@@ -421,7 +475,7 @@ Content of the document
|
|
421
475
|
» » » Tab,¬tab,¬tab¬and¬all¬is¬green!</code></pre>
|
422
476
|
<p>Or highlighting (support depends on languages):</p>
|
423
477
|
<pre><code> <div style="text-align:center">Div</div>
|
424
|
-
{lang=html}
|
478
|
+
{:lang=html}
|
425
479
|
</code></pre>
|
426
480
|
<p>produces:</p>
|
427
481
|
<pre class='xml'><span class='punct'><</span><span class='tag'>div</span> <span class='attribute'>style</span><span class='punct'>="</span><span class='string'>text-align:center</span><span class='punct'>"></span>Div<span class='punct'></</span><span class='tag'>div</span><span class='punct'>></span></pre><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'>↩</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
|
518
|
+
<a href='#fnref:1' rev='footnote'>↩</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>
|