rpeg-multimarkdown 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +94 -0
- data/README.markdown +58 -0
- data/Rakefile +171 -0
- data/bin/rpeg-multimarkdown +128 -0
- data/ext/extconf.h +3 -0
- data/ext/extconf.rb +15 -0
- data/ext/markdown.c +88 -0
- data/ext/markdown_lib.c +211 -0
- data/ext/markdown_lib.h +28 -0
- data/ext/markdown_output.c +2704 -0
- data/ext/markdown_parser.c +8275 -0
- data/ext/markdown_peg.h +142 -0
- data/ext/odf.c +179 -0
- data/ext/odf.h +3 -0
- data/ext/parsing_functions.c +182 -0
- data/ext/utility_functions.c +535 -0
- data/lib/multimarkdown.rb +1 -0
- data/lib/peg_multimarkdown.rb +74 -0
- data/test/MultiMarkdownTest/BeamerTests/Beamer-Tables.html +76 -0
- data/test/MultiMarkdownTest/BeamerTests/Beamer-Tables.tex +64 -0
- data/test/MultiMarkdownTest/BeamerTests/Beamer-Tables.text +38 -0
- data/test/MultiMarkdownTest/MarkdownTest.pl +182 -0
- data/test/MultiMarkdownTest/MemoirTests/Automatic Labels.html +42 -0
- data/test/MultiMarkdownTest/MemoirTests/Automatic Labels.tex +47 -0
- data/test/MultiMarkdownTest/MemoirTests/Automatic Labels.text +46 -0
- data/test/MultiMarkdownTest/MemoirTests/Base Header Level.html +20 -0
- data/test/MultiMarkdownTest/MemoirTests/Base Header Level.tex +19 -0
- data/test/MultiMarkdownTest/MemoirTests/Base Header Level.text +16 -0
- data/test/MultiMarkdownTest/MemoirTests/BibTeX.html +17 -0
- data/test/MultiMarkdownTest/MemoirTests/BibTeX.tex +12 -0
- data/test/MultiMarkdownTest/MemoirTests/BibTeX.text +11 -0
- data/test/MultiMarkdownTest/MemoirTests/Citations.html +63 -0
- data/test/MultiMarkdownTest/MemoirTests/Citations.tex +48 -0
- data/test/MultiMarkdownTest/MemoirTests/Citations.text +43 -0
- data/test/MultiMarkdownTest/MemoirTests/Definition Lists.html +61 -0
- data/test/MultiMarkdownTest/MemoirTests/Definition Lists.tex +63 -0
- data/test/MultiMarkdownTest/MemoirTests/Definition Lists.text +40 -0
- data/test/MultiMarkdownTest/MemoirTests/Dutch.html +23 -0
- data/test/MultiMarkdownTest/MemoirTests/Dutch.tex +18 -0
- data/test/MultiMarkdownTest/MemoirTests/Dutch.text +17 -0
- data/test/MultiMarkdownTest/MemoirTests/Email.html +48 -0
- data/test/MultiMarkdownTest/MemoirTests/Email.tex +61 -0
- data/test/MultiMarkdownTest/MemoirTests/Email.text +32 -0
- data/test/MultiMarkdownTest/MemoirTests/English.html +23 -0
- data/test/MultiMarkdownTest/MemoirTests/English.tex +18 -0
- data/test/MultiMarkdownTest/MemoirTests/English.text +17 -0
- data/test/MultiMarkdownTest/MemoirTests/Footnotes.html +47 -0
- data/test/MultiMarkdownTest/MemoirTests/Footnotes.tex +28 -0
- data/test/MultiMarkdownTest/MemoirTests/Footnotes.text +26 -0
- data/test/MultiMarkdownTest/MemoirTests/French.html +23 -0
- data/test/MultiMarkdownTest/MemoirTests/French.tex +18 -0
- data/test/MultiMarkdownTest/MemoirTests/French.text +17 -0
- data/test/MultiMarkdownTest/MemoirTests/German.html +23 -0
- data/test/MultiMarkdownTest/MemoirTests/German.tex +18 -0
- data/test/MultiMarkdownTest/MemoirTests/German.text +17 -0
- data/test/MultiMarkdownTest/MemoirTests/GermanGuillemets.html +23 -0
- data/test/MultiMarkdownTest/MemoirTests/GermanGuillemets.tex +18 -0
- data/test/MultiMarkdownTest/MemoirTests/GermanGuillemets.text +17 -0
- data/test/MultiMarkdownTest/MemoirTests/Glossary.html +47 -0
- data/test/MultiMarkdownTest/MemoirTests/Glossary.tex +30 -0
- data/test/MultiMarkdownTest/MemoirTests/Glossary.text +29 -0
- data/test/MultiMarkdownTest/MemoirTests/Line Breaks.html +21 -0
- data/test/MultiMarkdownTest/MemoirTests/Line Breaks.tex +16 -0
- data/test/MultiMarkdownTest/MemoirTests/Line Breaks.text +16 -0
- data/test/MultiMarkdownTest/MemoirTests/Link Attributes.html +40 -0
- data/test/MultiMarkdownTest/MemoirTests/Link Attributes.tex +61 -0
- data/test/MultiMarkdownTest/MemoirTests/Link Attributes.text +51 -0
- data/test/MultiMarkdownTest/MemoirTests/Math.html +22 -0
- data/test/MultiMarkdownTest/MemoirTests/Math.tex +16 -0
- data/test/MultiMarkdownTest/MemoirTests/Math.text +16 -0
- data/test/MultiMarkdownTest/MemoirTests/Memoir Mode.html +24 -0
- data/test/MultiMarkdownTest/MemoirTests/Memoir Mode.tex +23 -0
- data/test/MultiMarkdownTest/MemoirTests/Memoir Mode.text +20 -0
- data/test/MultiMarkdownTest/MemoirTests/MetaData.html +22 -0
- data/test/MultiMarkdownTest/MemoirTests/MetaData.tex +14 -0
- data/test/MultiMarkdownTest/MemoirTests/MetaData.text +15 -0
- data/test/MultiMarkdownTest/MemoirTests/Sanity.html +100 -0
- data/test/MultiMarkdownTest/MemoirTests/Sanity.tex +101 -0
- data/test/MultiMarkdownTest/MemoirTests/Sanity.text +78 -0
- data/test/MultiMarkdownTest/MemoirTests/SmartQuotes.html +26 -0
- data/test/MultiMarkdownTest/MemoirTests/SmartQuotes.tex +21 -0
- data/test/MultiMarkdownTest/MemoirTests/SmartQuotes.text +19 -0
- data/test/MultiMarkdownTest/MemoirTests/Swedish.html +23 -0
- data/test/MultiMarkdownTest/MemoirTests/Swedish.tex +18 -0
- data/test/MultiMarkdownTest/MemoirTests/Swedish.text +17 -0
- data/test/MultiMarkdownTest/MemoirTests/Tables.html +221 -0
- data/test/MultiMarkdownTest/MemoirTests/Tables.tex +134 -0
- data/test/MultiMarkdownTest/MemoirTests/Tables.text +64 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Automatic Labels.html +41 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Automatic Labels.tex +46 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Automatic Labels.text +45 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Base Header Level.html +20 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Base Header Level.tex +19 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Base Header Level.text +16 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/BibTeX.html +16 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/BibTeX.tex +11 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/BibTex.text +10 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Citations.html +62 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Citations.tex +47 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Citations.text +42 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Definition Lists.html +60 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Definition Lists.tex +62 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Definition Lists.text +39 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Dutch.html +23 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Dutch.tex +18 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Dutch.text +17 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Email.html +47 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Email.tex +54 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Email.text +31 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/English.html +23 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/English.tex +18 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/English.text +17 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Errors.html +16 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Errors.tex +11 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Errors.text +11 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Footnotes.html +46 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Footnotes.tex +24 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Footnotes.text +25 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/French.html +23 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/French.tex +18 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/French.text +17 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/German.html +23 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/German.tex +18 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/German.text +17 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/GermanGuillemets.html +23 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/GermanGuillemets.tex +18 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/GermanGuillemets.text +17 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Glossary.html +46 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Glossary.tex +26 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Glossary.text +28 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Headers.html +46 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Headers.tex +52 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Headers.text +49 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Line Breaks.html +20 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Line Breaks.tex +15 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Line Breaks.text +15 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Link Attributes.html +54 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Link Attributes.tex +60 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Link Attributes.text +50 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/List Parsing.html +20 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/List Parsing.tex +17 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/List Parsing.text +11 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/MarkdownInHTML.html +19 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/MarkdownInHTML.tex +13 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/MarkdownInHTML.text +19 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Math.html +21 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Math.tex +15 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Math.text +15 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/MetaData.html +21 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/MetaData.tex +13 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/MetaData.text +14 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Sanity.html +104 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Sanity.tex +100 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Sanity.text +77 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/SmartQuotes.html +29 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/SmartQuotes.tex +24 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/SmartQuotes.text +22 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Swedish.html +23 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Swedish.tex +18 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Swedish.text +17 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Tables.html +230 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Tables.tex +133 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/Tables.text +63 -0
- data/test/MultiMarkdownTest/MultiMarkdownTests/bibtex.bib +119 -0
- data/test/MultiMarkdownTest/README.md +58 -0
- data/test/MultiMarkdownTest/Tests/Amps and angle encoding.html +17 -0
- data/test/MultiMarkdownTest/Tests/Amps and angle encoding.text +21 -0
- data/test/MultiMarkdownTest/Tests/Auto links.html +18 -0
- data/test/MultiMarkdownTest/Tests/Auto links.text +13 -0
- data/test/MultiMarkdownTest/Tests/Backslash escapes.html +118 -0
- data/test/MultiMarkdownTest/Tests/Backslash escapes.text +120 -0
- data/test/MultiMarkdownTest/Tests/Blockquotes with code blocks.html +15 -0
- data/test/MultiMarkdownTest/Tests/Blockquotes with code blocks.text +11 -0
- data/test/MultiMarkdownTest/Tests/Code Blocks.html +18 -0
- data/test/MultiMarkdownTest/Tests/Code Blocks.text +14 -0
- data/test/MultiMarkdownTest/Tests/Code Spans.html +6 -0
- data/test/MultiMarkdownTest/Tests/Code Spans.text +6 -0
- data/test/MultiMarkdownTest/Tests/Compatibility.html +5 -0
- data/test/MultiMarkdownTest/Tests/Compatibility.text +9 -0
- data/test/MultiMarkdownTest/Tests/Hard-wrapped paragraphs with list-like lines.html +8 -0
- data/test/MultiMarkdownTest/Tests/Hard-wrapped paragraphs with list-like lines.text +8 -0
- data/test/MultiMarkdownTest/Tests/Horizontal rules.html +71 -0
- data/test/MultiMarkdownTest/Tests/Horizontal rules.text +67 -0
- data/test/MultiMarkdownTest/Tests/Inline HTML (Advanced).html +15 -0
- data/test/MultiMarkdownTest/Tests/Inline HTML (Advanced).text +15 -0
- data/test/MultiMarkdownTest/Tests/Inline HTML (Simple).html +72 -0
- data/test/MultiMarkdownTest/Tests/Inline HTML (Simple).text +69 -0
- data/test/MultiMarkdownTest/Tests/Inline HTML comments.html +13 -0
- data/test/MultiMarkdownTest/Tests/Inline HTML comments.text +13 -0
- data/test/MultiMarkdownTest/Tests/Links, inline style.html +11 -0
- data/test/MultiMarkdownTest/Tests/Links, inline style.text +12 -0
- data/test/MultiMarkdownTest/Tests/Links, reference style.html +52 -0
- data/test/MultiMarkdownTest/Tests/Links, reference style.text +71 -0
- data/test/MultiMarkdownTest/Tests/Links, shortcut references.html +9 -0
- data/test/MultiMarkdownTest/Tests/Links, shortcut references.text +20 -0
- data/test/MultiMarkdownTest/Tests/Literal quotes in titles.html +3 -0
- data/test/MultiMarkdownTest/Tests/Literal quotes in titles.text +7 -0
- data/test/MultiMarkdownTest/Tests/Markdown Documentation - Basics.html +314 -0
- data/test/MultiMarkdownTest/Tests/Markdown Documentation - Basics.text +306 -0
- data/test/MultiMarkdownTest/Tests/Markdown Documentation - Syntax.html +942 -0
- data/test/MultiMarkdownTest/Tests/Markdown Documentation - Syntax.text +888 -0
- data/test/MultiMarkdownTest/Tests/Nested blockquotes.html +9 -0
- data/test/MultiMarkdownTest/Tests/Nested blockquotes.text +5 -0
- data/test/MultiMarkdownTest/Tests/Ordered and unordered lists.html +148 -0
- data/test/MultiMarkdownTest/Tests/Ordered and unordered lists.text +131 -0
- data/test/MultiMarkdownTest/Tests/Strong and em together.html +7 -0
- data/test/MultiMarkdownTest/Tests/Strong and em together.text +7 -0
- data/test/MultiMarkdownTest/Tests/Tabs.html +25 -0
- data/test/MultiMarkdownTest/Tests/Tabs.text +21 -0
- data/test/MultiMarkdownTest/Tests/Tidyness.html +8 -0
- data/test/MultiMarkdownTest/Tests/Tidyness.text +5 -0
- data/test/benchmark.rb +49 -0
- data/test/multimarkdown_test.rb +89 -0
- metadata +280 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
<p>Just a <a href="/url/">URL</a>.</p>
|
2
|
+
|
3
|
+
<p><a href="/url/" title="title">URL and title</a>.</p>
|
4
|
+
|
5
|
+
<p><a href="/url/" title="title preceded by two spaces">URL and title</a>.</p>
|
6
|
+
|
7
|
+
<p><a href="/url/" title="title preceded by a tab">URL and title</a>.</p>
|
8
|
+
|
9
|
+
<p><a href="/url/" title="title has spaces afterward">URL and title</a>.</p>
|
10
|
+
|
11
|
+
<p><a href="">Empty</a>.</p>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<p>Foo <a href="/url/" title="Title">bar</a>.</p>
|
2
|
+
|
3
|
+
<p>Foo <a href="/url/" title="Title">bar</a>.</p>
|
4
|
+
|
5
|
+
<p>Foo <a href="/url/" title="Title">bar</a>.</p>
|
6
|
+
|
7
|
+
<p>With <a href="/url/">embedded [brackets]</a>.</p>
|
8
|
+
|
9
|
+
<p>Indented <a href="/url">once</a>.</p>
|
10
|
+
|
11
|
+
<p>Indented <a href="/url">twice</a>.</p>
|
12
|
+
|
13
|
+
<p>Indented <a href="/url">thrice</a>.</p>
|
14
|
+
|
15
|
+
<p>Indented [four][] times.</p>
|
16
|
+
|
17
|
+
<pre><code>[four]: /url
|
18
|
+
</code></pre>
|
19
|
+
|
20
|
+
<hr />
|
21
|
+
|
22
|
+
<p><a href="foo">this</a> should work</p>
|
23
|
+
|
24
|
+
<p>So should <a href="foo">this</a>.</p>
|
25
|
+
|
26
|
+
<p>And <a href="foo">this</a>.</p>
|
27
|
+
|
28
|
+
<p>And <a href="foo">this</a>.</p>
|
29
|
+
|
30
|
+
<p>And <a href="foo">this</a>.</p>
|
31
|
+
|
32
|
+
<p>But not [that] [].</p>
|
33
|
+
|
34
|
+
<p>Nor [that][].</p>
|
35
|
+
|
36
|
+
<p>Nor [that].</p>
|
37
|
+
|
38
|
+
<p>[Something in brackets like <a href="foo">this</a> should work]</p>
|
39
|
+
|
40
|
+
<p>[Same with <a href="foo">this</a>.]</p>
|
41
|
+
|
42
|
+
<p>In this case, <a href="/somethingelse/">this</a> points to something else.</p>
|
43
|
+
|
44
|
+
<p>Backslashing should suppress [this] and [this].</p>
|
45
|
+
|
46
|
+
<hr />
|
47
|
+
|
48
|
+
<p>Here's one where the <a href="/url/">link
|
49
|
+
breaks</a> across lines.</p>
|
50
|
+
|
51
|
+
<p>Here's another where the <a href="/url/">link
|
52
|
+
breaks</a> across lines, but with a line-ending space.</p>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
Foo [bar] [1].
|
2
|
+
|
3
|
+
Foo [bar][1].
|
4
|
+
|
5
|
+
Foo [bar]
|
6
|
+
[1].
|
7
|
+
|
8
|
+
[1]: /url/ "Title"
|
9
|
+
|
10
|
+
|
11
|
+
With [embedded [brackets]] [b].
|
12
|
+
|
13
|
+
|
14
|
+
Indented [once][].
|
15
|
+
|
16
|
+
Indented [twice][].
|
17
|
+
|
18
|
+
Indented [thrice][].
|
19
|
+
|
20
|
+
Indented [four][] times.
|
21
|
+
|
22
|
+
[once]: /url
|
23
|
+
|
24
|
+
[twice]: /url
|
25
|
+
|
26
|
+
[thrice]: /url
|
27
|
+
|
28
|
+
[four]: /url
|
29
|
+
|
30
|
+
|
31
|
+
[b]: /url/
|
32
|
+
|
33
|
+
* * *
|
34
|
+
|
35
|
+
[this] [this] should work
|
36
|
+
|
37
|
+
So should [this][this].
|
38
|
+
|
39
|
+
And [this] [].
|
40
|
+
|
41
|
+
And [this][].
|
42
|
+
|
43
|
+
And [this].
|
44
|
+
|
45
|
+
But not [that] [].
|
46
|
+
|
47
|
+
Nor [that][].
|
48
|
+
|
49
|
+
Nor [that].
|
50
|
+
|
51
|
+
[Something in brackets like [this][] should work]
|
52
|
+
|
53
|
+
[Same with [this].]
|
54
|
+
|
55
|
+
In this case, [this](/somethingelse/) points to something else.
|
56
|
+
|
57
|
+
Backslashing should suppress \[this] and [this\].
|
58
|
+
|
59
|
+
[this]: foo
|
60
|
+
|
61
|
+
|
62
|
+
* * *
|
63
|
+
|
64
|
+
Here's one where the [link
|
65
|
+
breaks] across lines.
|
66
|
+
|
67
|
+
Here's another where the [link
|
68
|
+
breaks] across lines, but with a line-ending space.
|
69
|
+
|
70
|
+
|
71
|
+
[link breaks]: /url/
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<p>This is the <a href="/simple">simple case</a>.</p>
|
2
|
+
|
3
|
+
<p>This one has a <a href="/foo">line
|
4
|
+
break</a>.</p>
|
5
|
+
|
6
|
+
<p>This one has a <a href="/foo">line
|
7
|
+
break</a> with a line-ending space.</p>
|
8
|
+
|
9
|
+
<p><a href="/that">this</a> and the <a href="/other">other</a></p>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
This is the [simple case].
|
2
|
+
|
3
|
+
[simple case]: /simple
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
This one has a [line
|
8
|
+
break].
|
9
|
+
|
10
|
+
This one has a [line
|
11
|
+
break] with a line-ending space.
|
12
|
+
|
13
|
+
[line break]: /foo
|
14
|
+
|
15
|
+
|
16
|
+
[this] [that] and the [other]
|
17
|
+
|
18
|
+
[this]: /this
|
19
|
+
[that]: /that
|
20
|
+
[other]: /other
|
@@ -0,0 +1,314 @@
|
|
1
|
+
<h1>Markdown: Basics</h1>
|
2
|
+
|
3
|
+
<ul id="ProjectSubmenu">
|
4
|
+
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
|
5
|
+
<li><a class="selected" title="Markdown Basics">Basics</a></li>
|
6
|
+
<li><a href="/projects/markdown/syntax" title="Markdown Syntax Documentation">Syntax</a></li>
|
7
|
+
<li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li>
|
8
|
+
<li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li>
|
9
|
+
</ul>
|
10
|
+
|
11
|
+
<h2>Getting the Gist of Markdown's Formatting Syntax</h2>
|
12
|
+
|
13
|
+
<p>This page offers a brief overview of what it's like to use Markdown.
|
14
|
+
The <a href="/projects/markdown/syntax" title="Markdown Syntax">syntax page</a> provides complete, detailed documentation for
|
15
|
+
every feature, but Markdown should be very easy to pick up simply by
|
16
|
+
looking at a few examples of it in action. The examples on this page
|
17
|
+
are written in a before/after style, showing example syntax and the
|
18
|
+
HTML output produced by Markdown.</p>
|
19
|
+
|
20
|
+
<p>It's also helpful to simply try Markdown out; the <a href="/projects/markdown/dingus" title="Markdown Dingus">Dingus</a> is a
|
21
|
+
web application that allows you type your own Markdown-formatted text
|
22
|
+
and translate it to XHTML.</p>
|
23
|
+
|
24
|
+
<p><strong>Note:</strong> This document is itself written using Markdown; you
|
25
|
+
can <a href="/projects/markdown/basics.text">see the source for it by adding '.text' to the URL</a>.</p>
|
26
|
+
|
27
|
+
<h2>Paragraphs, Headers, Blockquotes</h2>
|
28
|
+
|
29
|
+
<p>A paragraph is simply one or more consecutive lines of text, separated
|
30
|
+
by one or more blank lines. (A blank line is any line that looks like a
|
31
|
+
blank line -- a line containing nothing spaces or tabs is considered
|
32
|
+
blank.) Normal paragraphs should not be intended with spaces or tabs.</p>
|
33
|
+
|
34
|
+
<p>Markdown offers two styles of headers: <em>Setext</em> and <em>atx</em>.
|
35
|
+
Setext-style headers for <code><h1></code> and <code><h2></code> are created by
|
36
|
+
"underlining" with equal signs (<code>=</code>) and hyphens (<code>-</code>), respectively.
|
37
|
+
To create an atx-style header, you put 1-6 hash marks (<code>#</code>) at the
|
38
|
+
beginning of the line -- the number of hashes equals the resulting
|
39
|
+
HTML header level.</p>
|
40
|
+
|
41
|
+
<p>Blockquotes are indicated using email-style '<code>></code>' angle brackets.</p>
|
42
|
+
|
43
|
+
<p>Markdown:</p>
|
44
|
+
|
45
|
+
<pre><code>A First Level Header
|
46
|
+
====================
|
47
|
+
|
48
|
+
A Second Level Header
|
49
|
+
---------------------
|
50
|
+
|
51
|
+
Now is the time for all good men to come to
|
52
|
+
the aid of their country. This is just a
|
53
|
+
regular paragraph.
|
54
|
+
|
55
|
+
The quick brown fox jumped over the lazy
|
56
|
+
dog's back.
|
57
|
+
|
58
|
+
### Header 3
|
59
|
+
|
60
|
+
> This is a blockquote.
|
61
|
+
>
|
62
|
+
> This is the second paragraph in the blockquote.
|
63
|
+
>
|
64
|
+
> ## This is an H2 in a blockquote
|
65
|
+
</code></pre>
|
66
|
+
|
67
|
+
<p>Output:</p>
|
68
|
+
|
69
|
+
<pre><code><h1>A First Level Header</h1>
|
70
|
+
|
71
|
+
<h2>A Second Level Header</h2>
|
72
|
+
|
73
|
+
<p>Now is the time for all good men to come to
|
74
|
+
the aid of their country. This is just a
|
75
|
+
regular paragraph.</p>
|
76
|
+
|
77
|
+
<p>The quick brown fox jumped over the lazy
|
78
|
+
dog's back.</p>
|
79
|
+
|
80
|
+
<h3>Header 3</h3>
|
81
|
+
|
82
|
+
<blockquote>
|
83
|
+
<p>This is a blockquote.</p>
|
84
|
+
|
85
|
+
<p>This is the second paragraph in the blockquote.</p>
|
86
|
+
|
87
|
+
<h2>This is an H2 in a blockquote</h2>
|
88
|
+
</blockquote>
|
89
|
+
</code></pre>
|
90
|
+
|
91
|
+
<h3>Phrase Emphasis</h3>
|
92
|
+
|
93
|
+
<p>Markdown uses asterisks and underscores to indicate spans of emphasis.</p>
|
94
|
+
|
95
|
+
<p>Markdown:</p>
|
96
|
+
|
97
|
+
<pre><code>Some of these words *are emphasized*.
|
98
|
+
Some of these words _are emphasized also_.
|
99
|
+
|
100
|
+
Use two asterisks for **strong emphasis**.
|
101
|
+
Or, if you prefer, __use two underscores instead__.
|
102
|
+
</code></pre>
|
103
|
+
|
104
|
+
<p>Output:</p>
|
105
|
+
|
106
|
+
<pre><code><p>Some of these words <em>are emphasized</em>.
|
107
|
+
Some of these words <em>are emphasized also</em>.</p>
|
108
|
+
|
109
|
+
<p>Use two asterisks for <strong>strong emphasis</strong>.
|
110
|
+
Or, if you prefer, <strong>use two underscores instead</strong>.</p>
|
111
|
+
</code></pre>
|
112
|
+
|
113
|
+
<h2>Lists</h2>
|
114
|
+
|
115
|
+
<p>Unordered (bulleted) lists use asterisks, pluses, and hyphens (<code>*</code>,
|
116
|
+
<code>+</code>, and <code>-</code>) as list markers. These three markers are
|
117
|
+
interchangable; this:</p>
|
118
|
+
|
119
|
+
<pre><code>* Candy.
|
120
|
+
* Gum.
|
121
|
+
* Booze.
|
122
|
+
</code></pre>
|
123
|
+
|
124
|
+
<p>this:</p>
|
125
|
+
|
126
|
+
<pre><code>+ Candy.
|
127
|
+
+ Gum.
|
128
|
+
+ Booze.
|
129
|
+
</code></pre>
|
130
|
+
|
131
|
+
<p>and this:</p>
|
132
|
+
|
133
|
+
<pre><code>- Candy.
|
134
|
+
- Gum.
|
135
|
+
- Booze.
|
136
|
+
</code></pre>
|
137
|
+
|
138
|
+
<p>all produce the same output:</p>
|
139
|
+
|
140
|
+
<pre><code><ul>
|
141
|
+
<li>Candy.</li>
|
142
|
+
<li>Gum.</li>
|
143
|
+
<li>Booze.</li>
|
144
|
+
</ul>
|
145
|
+
</code></pre>
|
146
|
+
|
147
|
+
<p>Ordered (numbered) lists use regular numbers, followed by periods, as
|
148
|
+
list markers:</p>
|
149
|
+
|
150
|
+
<pre><code>1. Red
|
151
|
+
2. Green
|
152
|
+
3. Blue
|
153
|
+
</code></pre>
|
154
|
+
|
155
|
+
<p>Output:</p>
|
156
|
+
|
157
|
+
<pre><code><ol>
|
158
|
+
<li>Red</li>
|
159
|
+
<li>Green</li>
|
160
|
+
<li>Blue</li>
|
161
|
+
</ol>
|
162
|
+
</code></pre>
|
163
|
+
|
164
|
+
<p>If you put blank lines between items, you'll get <code><p></code> tags for the
|
165
|
+
list item text. You can create multi-paragraph list items by indenting
|
166
|
+
the paragraphs by 4 spaces or 1 tab:</p>
|
167
|
+
|
168
|
+
<pre><code>* A list item.
|
169
|
+
|
170
|
+
With multiple paragraphs.
|
171
|
+
|
172
|
+
* Another item in the list.
|
173
|
+
</code></pre>
|
174
|
+
|
175
|
+
<p>Output:</p>
|
176
|
+
|
177
|
+
<pre><code><ul>
|
178
|
+
<li><p>A list item.</p>
|
179
|
+
<p>With multiple paragraphs.</p></li>
|
180
|
+
<li><p>Another item in the list.</p></li>
|
181
|
+
</ul>
|
182
|
+
</code></pre>
|
183
|
+
|
184
|
+
<h3>Links</h3>
|
185
|
+
|
186
|
+
<p>Markdown supports two styles for creating links: <em>inline</em> and
|
187
|
+
<em>reference</em>. With both styles, you use square brackets to delimit the
|
188
|
+
text you want to turn into a link.</p>
|
189
|
+
|
190
|
+
<p>Inline-style links use parentheses immediately after the link text.
|
191
|
+
For example:</p>
|
192
|
+
|
193
|
+
<pre><code>This is an [example link](http://example.com/).
|
194
|
+
</code></pre>
|
195
|
+
|
196
|
+
<p>Output:</p>
|
197
|
+
|
198
|
+
<pre><code><p>This is an <a href="http://example.com/">
|
199
|
+
example link</a>.</p>
|
200
|
+
</code></pre>
|
201
|
+
|
202
|
+
<p>Optionally, you may include a title attribute in the parentheses:</p>
|
203
|
+
|
204
|
+
<pre><code>This is an [example link](http://example.com/ "With a Title").
|
205
|
+
</code></pre>
|
206
|
+
|
207
|
+
<p>Output:</p>
|
208
|
+
|
209
|
+
<pre><code><p>This is an <a href="http://example.com/" title="With a Title">
|
210
|
+
example link</a>.</p>
|
211
|
+
</code></pre>
|
212
|
+
|
213
|
+
<p>Reference-style links allow you to refer to your links by names, which
|
214
|
+
you define elsewhere in your document:</p>
|
215
|
+
|
216
|
+
<pre><code>I get 10 times more traffic from [Google][1] than from
|
217
|
+
[Yahoo][2] or [MSN][3].
|
218
|
+
|
219
|
+
[1]: http://google.com/ "Google"
|
220
|
+
[2]: http://search.yahoo.com/ "Yahoo Search"
|
221
|
+
[3]: http://search.msn.com/ "MSN Search"
|
222
|
+
</code></pre>
|
223
|
+
|
224
|
+
<p>Output:</p>
|
225
|
+
|
226
|
+
<pre><code><p>I get 10 times more traffic from <a href="http://google.com/"
|
227
|
+
title="Google">Google</a> than from <a href="http://search.yahoo.com/"
|
228
|
+
title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
|
229
|
+
title="MSN Search">MSN</a>.</p>
|
230
|
+
</code></pre>
|
231
|
+
|
232
|
+
<p>The title attribute is optional. Link names may contain letters,
|
233
|
+
numbers and spaces, but are <em>not</em> case sensitive:</p>
|
234
|
+
|
235
|
+
<pre><code>I start my morning with a cup of coffee and
|
236
|
+
[The New York Times][NY Times].
|
237
|
+
|
238
|
+
[ny times]: http://www.nytimes.com/
|
239
|
+
</code></pre>
|
240
|
+
|
241
|
+
<p>Output:</p>
|
242
|
+
|
243
|
+
<pre><code><p>I start my morning with a cup of coffee and
|
244
|
+
<a href="http://www.nytimes.com/">The New York Times</a>.</p>
|
245
|
+
</code></pre>
|
246
|
+
|
247
|
+
<h3>Images</h3>
|
248
|
+
|
249
|
+
<p>Image syntax is very much like link syntax.</p>
|
250
|
+
|
251
|
+
<p>Inline (titles are optional):</p>
|
252
|
+
|
253
|
+
<pre><code>
|
254
|
+
</code></pre>
|
255
|
+
|
256
|
+
<p>Reference-style:</p>
|
257
|
+
|
258
|
+
<pre><code>![alt text][id]
|
259
|
+
|
260
|
+
[id]: /path/to/img.jpg "Title"
|
261
|
+
</code></pre>
|
262
|
+
|
263
|
+
<p>Both of the above examples produce the same output:</p>
|
264
|
+
|
265
|
+
<pre><code><img src="/path/to/img.jpg" alt="alt text" title="Title" />
|
266
|
+
</code></pre>
|
267
|
+
|
268
|
+
<h3>Code</h3>
|
269
|
+
|
270
|
+
<p>In a regular paragraph, you can create code span by wrapping text in
|
271
|
+
backtick quotes. Any ampersands (<code>&</code>) and angle brackets (<code><</code> or
|
272
|
+
<code>></code>) will automatically be translated into HTML entities. This makes
|
273
|
+
it easy to use Markdown to write about HTML example code:</p>
|
274
|
+
|
275
|
+
<pre><code>I strongly recommend against using any `<blink>` tags.
|
276
|
+
|
277
|
+
I wish SmartyPants used named entities like `&mdash;`
|
278
|
+
instead of decimal-encoded entites like `&#8212;`.
|
279
|
+
</code></pre>
|
280
|
+
|
281
|
+
<p>Output:</p>
|
282
|
+
|
283
|
+
<pre><code><p>I strongly recommend against using any
|
284
|
+
<code>&lt;blink&gt;</code> tags.</p>
|
285
|
+
|
286
|
+
<p>I wish SmartyPants used named entities like
|
287
|
+
<code>&amp;mdash;</code> instead of decimal-encoded
|
288
|
+
entites like <code>&amp;#8212;</code>.</p>
|
289
|
+
</code></pre>
|
290
|
+
|
291
|
+
<p>To specify an entire block of pre-formatted code, indent every line of
|
292
|
+
the block by 4 spaces or 1 tab. Just like with code spans, <code>&</code>, <code><</code>,
|
293
|
+
and <code>></code> characters will be escaped automatically.</p>
|
294
|
+
|
295
|
+
<p>Markdown:</p>
|
296
|
+
|
297
|
+
<pre><code>If you want your page to validate under XHTML 1.0 Strict,
|
298
|
+
you've got to put paragraph tags in your blockquotes:
|
299
|
+
|
300
|
+
<blockquote>
|
301
|
+
<p>For example.</p>
|
302
|
+
</blockquote>
|
303
|
+
</code></pre>
|
304
|
+
|
305
|
+
<p>Output:</p>
|
306
|
+
|
307
|
+
<pre><code><p>If you want your page to validate under XHTML 1.0 Strict,
|
308
|
+
you've got to put paragraph tags in your blockquotes:</p>
|
309
|
+
|
310
|
+
<pre><code>&lt;blockquote&gt;
|
311
|
+
&lt;p&gt;For example.&lt;/p&gt;
|
312
|
+
&lt;/blockquote&gt;
|
313
|
+
</code></pre>
|
314
|
+
</code></pre>
|