all repos — grayfriday @ 63f131c23953b35fa4625e35bde612a485f4bba7

blackfriday fork with a few changes

testdata/Markdown Documentation - Basics.html (view raw)

  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.
 14The <a href="/projects/markdown/syntax" title="Markdown Syntax">syntax page</a> provides complete, detailed documentation for
 15every feature, but Markdown should be very easy to pick up simply by
 16looking at a few examples of it in action. The examples on this page
 17are written in a before/after style, showing example syntax and the
 18HTML 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
 21web application that allows you type your own Markdown-formatted text
 22and translate it to XHTML.</p>
 23
 24<p><strong>Note:</strong> This document is itself written using Markdown; you
 25can <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
 30by one or more blank lines. (A blank line is any line that looks like a
 31blank line -- a line containing nothing spaces or tabs is considered
 32blank.) 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>.
 35Setext-style headers for <code>&lt;h1&gt;</code> and <code>&lt;h2&gt;</code> are created by
 36&quot;underlining&quot; with equal signs (<code>=</code>) and hyphens (<code>-</code>), respectively.
 37To create an atx-style header, you put 1-6 hash marks (<code>#</code>) at the
 38beginning of the line -- the number of hashes equals the resulting
 39HTML header level.</p>
 40
 41<p>Blockquotes are indicated using email-style '<code>&gt;</code>' angle brackets.</p>
 42
 43<p>Markdown:</p>
 44
 45<pre><code>A First Level Header
 46====================
 47
 48A Second Level Header
 49---------------------
 50
 51Now is the time for all good men to come to
 52the aid of their country. This is just a
 53regular paragraph.
 54
 55The quick brown fox jumped over the lazy
 56dog's back.
 57
 58### Header 3
 59
 60&gt; This is a blockquote.
 61&gt; 
 62&gt; This is the second paragraph in the blockquote.
 63&gt;
 64&gt; ## This is an H2 in a blockquote
 65</code></pre>
 66
 67<p>Output:</p>
 68
 69<pre><code>&lt;h1&gt;A First Level Header&lt;/h1&gt;
 70
 71&lt;h2&gt;A Second Level Header&lt;/h2&gt;
 72
 73&lt;p&gt;Now is the time for all good men to come to
 74the aid of their country. This is just a
 75regular paragraph.&lt;/p&gt;
 76
 77&lt;p&gt;The quick brown fox jumped over the lazy
 78dog's back.&lt;/p&gt;
 79
 80&lt;h3&gt;Header 3&lt;/h3&gt;
 81
 82&lt;blockquote&gt;
 83    &lt;p&gt;This is a blockquote.&lt;/p&gt;
 84
 85    &lt;p&gt;This is the second paragraph in the blockquote.&lt;/p&gt;
 86
 87    &lt;h2&gt;This is an H2 in a blockquote&lt;/h2&gt;
 88&lt;/blockquote&gt;
 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*.
 98Some of these words _are emphasized also_.
 99
100Use two asterisks for **strong emphasis**.
101Or, if you prefer, __use two underscores instead__.
102</code></pre>
103
104<p>Output:</p>
105
106<pre><code>&lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
107Some of these words &lt;em&gt;are emphasized also&lt;/em&gt;.&lt;/p&gt;
108
109&lt;p&gt;Use two asterisks for &lt;strong&gt;strong emphasis&lt;/strong&gt;.
110Or, if you prefer, &lt;strong&gt;use two underscores instead&lt;/strong&gt;.&lt;/p&gt;
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
117interchangable; 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>&lt;ul&gt;
141&lt;li&gt;Candy.&lt;/li&gt;
142&lt;li&gt;Gum.&lt;/li&gt;
143&lt;li&gt;Booze.&lt;/li&gt;
144&lt;/ul&gt;
145</code></pre>
146
147<p>Ordered (numbered) lists use regular numbers, followed by periods, as
148list markers:</p>
149
150<pre><code>1.  Red
1512.  Green
1523.  Blue
153</code></pre>
154
155<p>Output:</p>
156
157<pre><code>&lt;ol&gt;
158&lt;li&gt;Red&lt;/li&gt;
159&lt;li&gt;Green&lt;/li&gt;
160&lt;li&gt;Blue&lt;/li&gt;
161&lt;/ol&gt;
162</code></pre>
163
164<p>If you put blank lines between items, you'll get <code>&lt;p&gt;</code> tags for the
165list item text. You can create multi-paragraph list items by indenting
166the 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>&lt;ul&gt;
178&lt;li&gt;&lt;p&gt;A list item.&lt;/p&gt;
179&lt;p&gt;With multiple paragraphs.&lt;/p&gt;&lt;/li&gt;
180&lt;li&gt;&lt;p&gt;Another item in the list.&lt;/p&gt;&lt;/li&gt;
181&lt;/ul&gt;
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
188text you want to turn into a link.</p>
189
190<p>Inline-style links use parentheses immediately after the link text.
191For 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>&lt;p&gt;This is an &lt;a href=&quot;http://example.com/&quot;&gt;
199example link&lt;/a&gt;.&lt;/p&gt;
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/ &quot;With a Title&quot;).
205</code></pre>
206
207<p>Output:</p>
208
209<pre><code>&lt;p&gt;This is an &lt;a href=&quot;http://example.com/&quot; title=&quot;With a Title&quot;&gt;
210example link&lt;/a&gt;.&lt;/p&gt;
211</code></pre>
212
213<p>Reference-style links allow you to refer to your links by names, which
214you 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/        &quot;Google&quot;
220[2]: http://search.yahoo.com/  &quot;Yahoo Search&quot;
221[3]: http://search.msn.com/    &quot;MSN Search&quot;
222</code></pre>
223
224<p>Output:</p>
225
226<pre><code>&lt;p&gt;I get 10 times more traffic from &lt;a href=&quot;http://google.com/&quot;
227title=&quot;Google&quot;&gt;Google&lt;/a&gt; than from &lt;a href=&quot;http://search.yahoo.com/&quot;
228title=&quot;Yahoo Search&quot;&gt;Yahoo&lt;/a&gt; or &lt;a href=&quot;http://search.msn.com/&quot;
229title=&quot;MSN Search&quot;&gt;MSN&lt;/a&gt;.&lt;/p&gt;
230</code></pre>
231
232<p>The title attribute is optional. Link names may contain letters,
233numbers 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>&lt;p&gt;I start my morning with a cup of coffee and
244&lt;a href=&quot;http://www.nytimes.com/&quot;&gt;The New York Times&lt;/a&gt;.&lt;/p&gt;
245<h1>Markdown: Basics</h1>
246
247<ul id="ProjectSubmenu">
248    <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
249    <li><a class="selected" title="Markdown Basics">Basics</a></li>
250    <li><a href="/projects/markdown/syntax" title="Markdown Syntax Documentation">Syntax</a></li>
251    <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li>
252    <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li>
253</ul>
254
255<h2>Getting the Gist of Markdown's Formatting Syntax</h2>
256
257<p>This page offers a brief overview of what it's like to use Markdown.
258The <a href="/projects/markdown/syntax" title="Markdown Syntax">syntax page</a> provides complete, detailed documentation for
259every feature, but Markdown should be very easy to pick up simply by
260looking at a few examples of it in action. The examples on this page
261are written in a before/after style, showing example syntax and the
262HTML output produced by Markdown.</p>
263
264<p>It's also helpful to simply try Markdown out; the <a href="/projects/markdown/dingus" title="Markdown Dingus">Dingus</a> is a
265web application that allows you type your own Markdown-formatted text
266and translate it to XHTML.</p>
267
268<p><strong>Note:</strong> This document is itself written using Markdown; you
269can <a href="/projects/markdown/basics.text">see the source for it by adding '.text' to the URL</a>.</p>
270
271<h2>Paragraphs, Headers, Blockquotes</h2>
272
273<p>A paragraph is simply one or more consecutive lines of text, separated
274by one or more blank lines. (A blank line is any line that looks like a
275blank line -- a line containing nothing spaces or tabs is considered
276blank.) Normal paragraphs should not be intended with spaces or tabs.</p>
277
278<p>Markdown offers two styles of headers: <em>Setext</em> and <em>atx</em>.
279Setext-style headers for <code>&lt;h1&gt;</code> and <code>&lt;h2&gt;</code> are created by
280&quot;underlining&quot; with equal signs (<code>=</code>) and hyphens (<code>-</code>), respectively.
281To create an atx-style header, you put 1-6 hash marks (<code>#</code>) at the
282beginning of the line -- the number of hashes equals the resulting
283HTML header level.</p>
284
285<p>Blockquotes are indicated using email-style '<code>&gt;</code>' angle brackets.</p>
286
287<p>Markdown:</p>
288
289<pre><code>A First Level Header
290====================
291
292A Second Level Header
293---------------------
294
295Now is the time for all good men to come to
296the aid of their country. This is just a
297regular paragraph.
298
299The quick brown fox jumped over the lazy
300dog's back.
301
302### Header 3
303
304&gt; This is a blockquote.
305&gt; 
306&gt; This is the second paragraph in the blockquote.
307&gt;
308&gt; ## This is an H2 in a blockquote
309</code></pre>
310
311<p>Output:</p>
312
313<pre><code>&lt;h1&gt;A First Level Header&lt;/h1&gt;
314
315&lt;h2&gt;A Second Level Header&lt;/h2&gt;
316
317&lt;p&gt;Now is the time for all good men to come to
318the aid of their country. This is just a
319regular paragraph.&lt;/p&gt;
320
321&lt;p&gt;The quick brown fox jumped over the lazy
322dog's back.&lt;/p&gt;
323
324&lt;h3&gt;Header 3&lt;/h3&gt;
325
326&lt;blockquote&gt;
327    &lt;p&gt;This is a blockquote.&lt;/p&gt;
328
329    &lt;p&gt;This is the second paragraph in the blockquote.&lt;/p&gt;
330
331    &lt;h2&gt;This is an H2 in a blockquote&lt;/h2&gt;
332&lt;/blockquote&gt;
333</code></pre>
334
335<h3>Phrase Emphasis</h3>
336
337<p>Markdown uses asterisks and underscores to indicate spans of emphasis.</p>
338
339<p>Markdown:</p>
340
341<pre><code>Some of these words *are emphasized*.
342Some of these words _are emphasized also_.
343
344Use two asterisks for **strong emphasis**.
345Or, if you prefer, __use two underscores instead__.
346</code></pre>
347
348<p>Output:</p>
349
350<pre><code>&lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
351Some of these words &lt;em&gt;are emphasized also&lt;/em&gt;.&lt;/p&gt;
352
353&lt;p&gt;Use two asterisks for &lt;strong&gt;strong emphasis&lt;/strong&gt;.
354Or, if you prefer, &lt;strong&gt;use two underscores instead&lt;/strong&gt;.&lt;/p&gt;
355</code></pre>
356
357<h2>Lists</h2>
358
359<p>Unordered (bulleted) lists use asterisks, pluses, and hyphens (<code>*</code>,
360<code>+</code>, and <code>-</code>) as list markers. These three markers are
361interchangable; this:</p>
362
363<pre><code>*   Candy.
364*   Gum.
365*   Booze.
366</code></pre>
367
368<p>this:</p>
369
370<pre><code>+   Candy.
371+   Gum.
372+   Booze.
373</code></pre>
374
375<p>and this:</p>
376
377<pre><code>-   Candy.
378-   Gum.
379-   Booze.
380</code></pre>
381
382<p>all produce the same output:</p>
383
384<pre><code>&lt;ul&gt;
385&lt;li&gt;Candy.&lt;/li&gt;
386&lt;li&gt;Gum.&lt;/li&gt;
387&lt;li&gt;Booze.&lt;/li&gt;
388&lt;/ul&gt;
389</code></pre>
390
391<p>Ordered (numbered) lists use regular numbers, followed by periods, as
392list markers:</p>
393
394<pre><code>1.  Red
3952.  Green
3963.  Blue
397</code></pre>
398
399<p>Output:</p>
400
401<pre><code>&lt;ol&gt;
402&lt;li&gt;Red&lt;/li&gt;
403&lt;li&gt;Green&lt;/li&gt;
404&lt;li&gt;Blue&lt;/li&gt;
405&lt;/ol&gt;
406</code></pre>
407
408<p>If you put blank lines between items, you'll get <code>&lt;p&gt;</code> tags for the
409list item text. You can create multi-paragraph list items by indenting
410the paragraphs by 4 spaces or 1 tab:</p>
411
412<pre><code>*   A list item.
413
414    With multiple paragraphs.
415
416*   Another item in the list.
417</code></pre>
418
419<p>Output:</p>
420
421<pre><code>&lt;ul&gt;
422&lt;li&gt;&lt;p&gt;A list item.&lt;/p&gt;
423&lt;p&gt;With multiple paragraphs.&lt;/p&gt;&lt;/li&gt;
424&lt;li&gt;&lt;p&gt;Another item in the list.&lt;/p&gt;&lt;/li&gt;
425&lt;/ul&gt;
426</code></pre>
427
428<h3>Links</h3>
429
430<p>Markdown supports two styles for creating links: <em>inline</em> and
431<em>reference</em>. With both styles, you use square brackets to delimit the
432text you want to turn into a link.</p>
433
434<p>Inline-style links use parentheses immediately after the link text.
435For example:</p>
436
437<pre><code>This is an [example link](http://example.com/).
438</code></pre>
439
440<p>Output:</p>
441
442<pre><code>&lt;p&gt;This is an &lt;a href=&quot;http://example.com/&quot;&gt;
443example link&lt;/a&gt;.&lt;/p&gt;
444</code></pre>
445
446<p>Optionally, you may include a title attribute in the parentheses:</p>
447
448<pre><code>This is an [example link](http://example.com/ &quot;With a Title&quot;).
449</code></pre>
450
451<p>Output:</p>
452
453<pre><code>&lt;p&gt;This is an &lt;a href=&quot;http://example.com/&quot; title=&quot;With a Title&quot;&gt;
454example link&lt;/a&gt;.&lt;/p&gt;
455</code></pre>
456
457<p>Reference-style links allow you to refer to your links by names, which
458you define elsewhere in your document:</p>
459
460<pre><code>I get 10 times more traffic from [Google][1] than from
461[Yahoo][2] or [MSN][3].
462
463[1]: http://google.com/        &quot;Google&quot;
464[2]: http://search.yahoo.com/  &quot;Yahoo Search&quot;
465[3]: http://search.msn.com/    &quot;MSN Search&quot;
466</code></pre>
467
468<p>Output:</p>
469
470<pre><code>&lt;p&gt;I get 10 times more traffic from &lt;a href=&quot;http://google.com/&quot;
471title=&quot;Google&quot;&gt;Google&lt;/a&gt; than from &lt;a href=&quot;http://search.yahoo.com/&quot;
472title=&quot;Yahoo Search&quot;&gt;Yahoo&lt;/a&gt; or &lt;a href=&quot;http://search.msn.com/&quot;
473title=&quot;MSN Search&quot;&gt;MSN&lt;/a&gt;.&lt;/p&gt;
474</code></pre>
475
476<p>The title attribute is optional. Link names may contain letters,
477numbers and spaces, but are <em>not</em> case sensitive:</p>
478
479<pre><code>I start my morning with a cup of coffee and
480[The New York Times][NY Times].
481
482[ny times]: http://www.nytimes.com/
483</code></pre>
484
485<p>Output:</p>
486
487<pre><code>&lt;p&gt;I start my morning with a cup of coffee and
488&lt;a href=&quot;http://www.nytimes.com/&quot;&gt;The New York Times&lt;/a&gt;.&lt;/p&gt;
489</code></pre>
490
491<p>It is also common to find other protocols such as ftp used for links:</p>
492
493<p>Input:</p>
494
495<pre><code>For example one may test download speeds [here](ftp://speedtest.tele2.net/)
496</code></pre>
497
498<p>Output:</p>
499
500<pre><code>&lt;p&gt;For example one may test download speeds &lt;a href=&quot;ftp://speedtest.tele2.net/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
501</code></pre>
502
503<h3>Images</h3>
504
505<p>Image syntax is very much like link syntax.</p>
506
507<p>Inline (titles are optional):</p>
508
509<pre><code>![alt text](/path/to/img.jpg &quot;Title&quot;)
510</code></pre>
511
512<p>Reference-style:</p>
513
514<pre><code>![alt text][id]
515
516[id]: /path/to/img.jpg &quot;Title&quot;
517</code></pre>
518
519<p>Both of the above examples produce the same output:</p>
520
521<pre><code>&lt;img src=&quot;/path/to/img.jpg&quot; alt=&quot;alt text&quot; title=&quot;Title&quot; /&gt;
522</code></pre>
523
524<h3>Code</h3>
525
526<p>In a regular paragraph, you can create code span by wrapping text in
527backtick quotes. Any ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> or
528<code>&gt;</code>) will automatically be translated into HTML entities. This makes
529it easy to use Markdown to write about HTML example code:</p>
530
531<pre><code>I strongly recommend against using any `&lt;blink&gt;` tags.
532
533I wish SmartyPants used named entities like `&amp;mdash;`
534instead of decimal-encoded entites like `&amp;#8212;`.
535</code></pre>
536
537<p>Output:</p>
538
539<pre><code>&lt;p&gt;I strongly recommend against using any
540&lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
541
542&lt;p&gt;I wish SmartyPants used named entities like
543&lt;code&gt;&amp;amp;mdash;&lt;/code&gt; instead of decimal-encoded
544entites like &lt;code&gt;&amp;amp;#8212;&lt;/code&gt;.&lt;/p&gt;
545</code></pre>
546
547<p>To specify an entire block of pre-formatted code, indent every line of
548the block by 4 spaces or 1 tab. Just like with code spans, <code>&amp;</code>, <code>&lt;</code>,
549and <code>&gt;</code> characters will be escaped automatically.</p>
550
551<p>Markdown:</p>
552
553<pre><code>If you want your page to validate under XHTML 1.0 Strict,
554you've got to put paragraph tags in your blockquotes:
555
556    &lt;blockquote&gt;
557        &lt;p&gt;For example.&lt;/p&gt;
558    &lt;/blockquote&gt;
559</code></pre>
560
561<p>Output:</p>
562
563<pre><code>&lt;p&gt;If you want your page to validate under XHTML 1.0 Strict,
564you've got to put paragraph tags in your blockquotes:&lt;/p&gt;
565
566&lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;
567    &amp;lt;p&amp;gt;For example.&amp;lt;/p&amp;gt;
568&amp;lt;/blockquote&amp;gt;
569&lt;/code&gt;&lt;/pre&gt;
570</code></pre>