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