ronn-ng 0.8.1 → 0.10.1.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +32 -3
  3. data/Gemfile.lock +70 -0
  4. data/INSTALLING.md +2 -2
  5. data/README.md +40 -30
  6. data/Rakefile +4 -4
  7. data/bin/ronn +23 -11
  8. data/lib/ronn.rb +3 -8
  9. data/lib/ronn/document.rb +23 -12
  10. data/lib/ronn/index.rb +2 -4
  11. data/lib/ronn/roff.rb +18 -8
  12. data/lib/ronn/template.rb +1 -0
  13. data/man/ronn-format.7 +8 -8
  14. data/man/ronn.1 +24 -20
  15. data/man/ronn.1.ronn +10 -7
  16. data/ronn-ng.gemspec +23 -13
  17. data/test/angle_bracket_syntax.html +11 -1
  18. data/test/angle_bracket_syntax.roff +24 -0
  19. data/test/angle_bracket_syntax.ronn +10 -0
  20. data/test/code_blocks.html +38 -0
  21. data/test/code_blocks.roff +38 -0
  22. data/test/{code_blocks.7.ronn → code_blocks.ronn} +0 -0
  23. data/test/code_blocks_regression +19 -0
  24. data/test/code_blocks_regression.html +38 -0
  25. data/test/code_blocks_regression.ronn +40 -0
  26. data/test/definition_list_syntax.html +2 -2
  27. data/test/definition_list_syntax.roff +1 -1
  28. data/test/dots_at_line_start_test.roff +3 -3
  29. data/test/ellipses.roff +2 -2
  30. data/test/entity_encoding_test.html +20 -12
  31. data/test/entity_encoding_test.roff +26 -15
  32. data/test/entity_encoding_test.ronn +9 -0
  33. data/test/markdown_syntax.html +8 -10
  34. data/test/markdown_syntax.roff +49 -49
  35. data/test/middle_paragraph.roff +1 -1
  36. data/test/missing_spaces.roff +1 -1
  37. data/test/nested_list_with_code.html +6 -7
  38. data/test/nested_list_with_code.roff +4 -4
  39. data/test/ordered_list.html +8 -10
  40. data/test/ordered_list.roff +1 -1
  41. data/test/pre_block_with_quotes.roff +1 -1
  42. data/test/section_reference_links.roff +2 -2
  43. data/test/single_quotes.html +11 -0
  44. data/test/single_quotes.roff +5 -0
  45. data/test/single_quotes.ronn +9 -0
  46. data/test/test_ronn.rb +9 -9
  47. data/test/underline_spacing_test.roff +1 -1
  48. metadata +72 -61
  49. data/test/url_formatting.ronn +0 -3
@@ -13,5 +13,15 @@ code block,
13
13
 
14
14
  <p>or when <code>&lt;WORD&gt;</code> is enclosed in backticks.</p>
15
15
 
16
- <p>or when <var>WORD</var> has a &lt;dot.&gt; or &lt;foo:colon&gt;.</p>
16
+ <p>or when <var>WORD</var> has a <dot.> or <colon>.</colon></dot.></p>
17
+
18
+ <h2 id="Escaping-angle-brackets">Escaping angle brackets</h2>
19
+
20
+ <p>You can escape &lt;angle&gt; &lt;brackets&gt; with backslashes, since we're using GitHub Flavored Markdown.</p>
21
+
22
+ <p>Example:</p>
23
+
24
+ <p><code>pxzgrep</code> [<code>-p</code>&lt;n&gt;] [<code>-V</code>] [&lt;xzgrep options&gt;] &lt;pattern&gt; &lt;file1&gt; &lt;file2&gt; [&lt;more files&gt;]</p>
25
+
26
+ <p>(Though really you should just put that in a fenced code block.)</p>
17
27
  </div>
@@ -0,0 +1,24 @@
1
+ .TH "ANGLE_BRACKET_SYNTAX" "5" "January 1979" ""
2
+ .SH "NAME"
3
+ \fBangle_bracket_syntax\fR \- angle bracket syntax test
4
+ .P
5
+ A \fIWORD\fR in angle brackets is converted to \fIWORD\fR,
6
+ .IP "" 4
7
+ .nf
8
+ except when <WORD> is
9
+ part of a preformatted
10
+ code block,
11
+ .fi
12
+ .IP "" 0
13
+ .P
14
+ or when \fB<WORD>\fR is enclosed in backticks\.
15
+ .P
16
+ or when \fIWORD\fR has a
17
+ .SH "Escaping angle brackets"
18
+ You can escape <angle> <brackets> with backslashes, since we're using GitHub Flavored Markdown\.
19
+ .P
20
+ Example:
21
+ .P
22
+ \fBpxzgrep\fR [\fB\-p\fR<n>] [\fB\-V\fR] [<xzgrep options>] <pattern> <file1> <file2> [<more files>]
23
+ .P
24
+ (Though really you should just put that in a fenced code block\.)
@@ -10,3 +10,13 @@ A <WORD> in angle brackets is converted to <var>WORD</var>,
10
10
  or when `<WORD>` is enclosed in backticks.
11
11
 
12
12
  or when <WORD> has a <dot.> or <foo:colon>.
13
+
14
+ ## Escaping angle brackets
15
+
16
+ You can escape \<angle\> \<brackets\> with backslashes, since we're using GitHub Flavored Markdown.
17
+
18
+ Example:
19
+
20
+ `pxzgrep` [`-p`\<n\>] [`-V`] [\<xzgrep options\>] \<pattern\> \<file1\> \<file2\> [\<more files\>]
21
+
22
+ (Though really you should just put that in a fenced code block.)
@@ -0,0 +1,38 @@
1
+ <div class='mp'>
2
+
3
+ <h1 id="Example-Code-Blocks">Example Code Blocks</h1>
4
+ <h2 id="Basic-code-block">Basic code block</h2>
5
+
6
+ <pre><code>Hello, world!
7
+ </code></pre>
8
+
9
+ <h2 id="Language-identified-code-blocks">Language-identified code blocks</h2>
10
+
11
+ <pre><code class="language-html">&lt;html&gt;
12
+ &lt;head&gt;
13
+ &lt;title&gt;Hello, world!&lt;/title&gt;
14
+ &lt;/head&gt;
15
+ &lt;body&gt;
16
+ Hello, world!
17
+ &lt;/body&gt;
18
+ &lt;/html&gt;
19
+ </code></pre>
20
+
21
+ <h2 id="Interspersed-code-blocks-and-text">Interspersed code blocks and text</h2>
22
+
23
+ <p>Some text.</p>
24
+
25
+ <pre><code>Some code.
26
+ </code></pre>
27
+
28
+ <p>Here's some &lt;pre&gt; text.</p>
29
+
30
+ <pre>
31
+ This is pre text.
32
+ </pre>
33
+
34
+ <p>Some more text.</p>
35
+
36
+ <pre><code>Some more code.
37
+ </code></pre>
38
+ </div>
@@ -0,0 +1,38 @@
1
+ .TH "CODE_BLOCKS" "" "January 1979" ""
2
+ .SH "Basic code block"
3
+ .nf
4
+ Hello, world!
5
+ .fi
6
+ .SH "Language\-identified code blocks"
7
+ .nf
8
+ <html>
9
+ <head>
10
+ <title>Hello, world!</title>
11
+ </head>
12
+ <body>
13
+ Hello, world!
14
+ </body>
15
+ </html>
16
+ .fi
17
+ .SH "Interspersed code blocks and text"
18
+ Some text\.
19
+ .IP "" 4
20
+ .nf
21
+ Some code\.
22
+ .fi
23
+ .IP "" 0
24
+ .P
25
+ Here's some <pre> text\.
26
+ .IP "" 4
27
+ .nf
28
+ This is pre text\.
29
+ .fi
30
+ .IP "" 0
31
+ .P
32
+ Some more text\.
33
+ .IP "" 4
34
+ .nf
35
+ Some more code\.
36
+ .fi
37
+ .IP "" 0
38
+
@@ -0,0 +1,19 @@
1
+ .\" generated with Ronn-NG/v0.9.1
2
+ .\" http://github.com/apjanke/ronn-ng/tree/0.9.1
3
+ .TH "CODE_BLOCKS_REGRESSION" "" "July 2020" ""
4
+ .SH "In the text:"
5
+ This is Renzo\'s code\.
6
+ .P
7
+ Debian\'s lintian returns the following warning: acute\-accent\-in\-manual\-page
8
+ .P
9
+ This manual page uses the \' groff sequence\. Usually, the intent to generate an apostrophe, but that sequence actually renders as a an acute accent\.
10
+ .P
11
+ For an apostrophe or a single closing quote, use plain \'\. For single opening quote, i\.e\. a straight downward line \' like the one used in shell commands, use \e(aq\.
12
+ .SH "Basic code block"
13
+ The situation is even worse when there are code blocks, mainly code chunks or commands\. E\.g\., copy\-paste fails\.
14
+ .P
15
+ Type the following command \fBecho \'Hello World\'\fR\.
16
+ .P
17
+ \fBbash $ echo \'hello world\'\fR
18
+ .P
19
+ The following code cannot be compiled: \fBC int main() { int example = 42; switch (example) { case \'a\': return 10; default: return 42; } }\fR
@@ -0,0 +1,38 @@
1
+ <div class='mp'>
2
+
3
+ <h1 id="Example-Quote-Error">Example Quote Error</h1>
4
+ <h2 id="In-the-text-">In the text:</h2>
5
+
6
+ <p>This is Renzo's code.</p>
7
+
8
+ <p>Debian's lintian returns the following warning:
9
+ acute-accent-in-manual-page</p>
10
+
11
+ <p>This manual page uses the ' groff sequence. Usually, the intent to
12
+ generate an apostrophe, but that sequence actually renders as a an acute
13
+ accent.</p>
14
+
15
+ <p>For an apostrophe or a single closing quote, use plain '. For single
16
+ opening quote, i.e. a straight downward line ' like the one used in
17
+ shell commands, use \(aq.</p>
18
+
19
+ <h2 id="Basic-code-block">Basic code block</h2>
20
+
21
+ <p>The situation is even worse when there are code blocks, mainly code
22
+ chunks or commands. E.g., copy-paste fails.</p>
23
+
24
+ <p>Type the following command <code>echo 'Hello World'</code>.</p>
25
+
26
+ <pre><code class="language-bash">$ echo 'hello world'
27
+ </code></pre>
28
+
29
+ <p>The following code cannot be compiled:</p>
30
+ <pre><code class="language-C">int main() {
31
+ int example = 42;
32
+ switch (example) {
33
+ case 'a': return 10;
34
+ default: return 42;
35
+ }
36
+ }
37
+ </code></pre>
38
+ </div>
@@ -0,0 +1,40 @@
1
+ Example Quote Error
2
+ ===================
3
+
4
+ ## In the text:
5
+
6
+ This is Renzo's code.
7
+
8
+ Debian's lintian returns the following warning:
9
+ acute-accent-in-manual-page
10
+
11
+ This manual page uses the \' groff sequence. Usually, the intent to
12
+ generate an apostrophe, but that sequence actually renders as a an acute
13
+ accent.
14
+
15
+ For an apostrophe or a single closing quote, use plain '. For single
16
+ opening quote, i.e. a straight downward line ' like the one used in
17
+ shell commands, use &#92;(aq.
18
+
19
+ ## Basic code block
20
+
21
+ The situation is even worse when there are code blocks, mainly code
22
+ chunks or commands. E.g., copy-paste fails.
23
+
24
+ Type the following command `echo 'Hello World'`.
25
+
26
+ ``` bash
27
+ $ echo 'hello world'
28
+ ```
29
+
30
+ The following code cannot be compiled:
31
+ ``` C
32
+ int main() {
33
+ int example = 42;
34
+ switch (example) {
35
+ case 'a': return 10;
36
+ default: return 42;
37
+ }
38
+ }
39
+ ```
40
+
@@ -13,9 +13,9 @@
13
13
  <dd>The definition may span
14
14
  multiple lines and even
15
15
 
16
- <p>start</p>
16
+ <p>start</p>
17
17
 
18
- <p>new paragraphs</p>
18
+ <p>new paragraphs</p>
19
19
  </dd>
20
20
  <dt>
21
21
  <code>--somearg</code>=<var>VALUE</var>
@@ -1,4 +1,4 @@
1
- .TH "DEFINITION_LIST_SYNTAX" "5" "January 1979" "" ""
1
+ .TH "DEFINITION_LIST_SYNTAX" "5" "January 1979" ""
2
2
  .SH "NAME"
3
3
  \fBdefinition_list_syntax\fR \- hiya
4
4
  .P
@@ -1,10 +1,10 @@
1
- .TH "DOTS_AT_LINE_START_TEST" "" "January 1979" "" ""
1
+ .TH "DOTS_AT_LINE_START_TEST" "" "January 1979" ""
2
2
  .SH "NAME"
3
3
  \fBdots_at_line_start_test\fR
4
4
  .P
5
- There\'s a weird issue where dots at the beginning of a line generate troff warnings due to escaping\.
5
+ There's a weird issue where dots at the beginning of a line generate troff warnings due to escaping\.
6
6
  .P
7
- \&\.\. let\'s see what happens\.
7
+ \&\.\. let's see what happens\.
8
8
  .IP "" 4
9
9
  .nf
10
10
  \&\. A dot on an indented line
@@ -1,7 +1,7 @@
1
- .TH "ELLIPSES" "7" "January 1979" "" ""
1
+ .TH "ELLIPSES" "7" "January 1979" ""
2
2
  .SH "NAME"
3
3
  \fBellipses\fR \- testing ellipses
4
4
  .P
5
5
  Ellipses should be replaced\|\.\|\.\|\.
6
6
  .P
7
- \|\.\|\.\|\.also, they shouldn\'t interfere with regular dots at the beginning of a line\.
7
+ \|\.\|\.\|\.also, they shouldn't interfere with regular dots at the beginning of a line\.
@@ -15,20 +15,28 @@
15
15
  <p>Here's some special entities:</p>
16
16
 
17
17
  <ul>
18
- <li>&amp;bull; •</li>
19
- <li>&amp;nbsp;  </li>
20
- <li>&amp;copy; ©</li>
21
- <li>&amp;rdquo; ”</li>
22
- <li>&amp;mdash; —</li>
23
- <li>&amp;reg; ®</li>
24
- <li>&amp;sect; §</li>
25
- <li>&amp;ge; ≥</li>
26
- <li>&amp;le; ≤</li>
27
- <li>&amp;ne; ≠</li>
28
- <li>&amp;equiv; ≡</li>
18
+ <li>&amp;bull; •</li>
19
+ <li>&amp;nbsp;  </li>
20
+ <li>&amp;copy; ©</li>
21
+ <li>&amp;rdquo; ”</li>
22
+ <li>&amp;mdash; —</li>
23
+ <li>&amp;reg; ®</li>
24
+ <li>&amp;sect; §</li>
25
+ <li>&amp;ge; ≥</li>
26
+ <li>&amp;le; ≤</li>
27
+ <li>&amp;ne; ≠</li>
28
+ <li>&amp;equiv; ≡</li>
29
29
  </ul>
30
30
 
31
-
32
31
  <p>Here's a line that uses non-breaking spaces to force the
33
32
  last few words to wrap together.</p>
33
+
34
+ <p>And stuff like this:</p>
35
+
36
+ <p>git bulk [-g] ([-a]|[-w <ws-name>]) <git command> </git></ws-name><br>
37
+ git bulk --addworkspace <ws-name> <ws-root-directory> (--from <url or file>) </url></ws-root-directory></ws-name><br>
38
+ git bulk --removeworkspace &lt;ws-name&gt; <br></p>
39
+
40
+ <p>Should have the <code>&amp;lt;</code>/<code>&amp;gt;</code> entities stay as <code>&amp;lt;</code>/<code>&amp;gt;</code> in HTML, but be
41
+ turned into literal brackets in the ROFF.</p>
34
42
  </div>
@@ -1,4 +1,4 @@
1
- .TH "HELLO" "1" "January 1979" "" ""
1
+ .TH "HELLO" "1" "January 1979" ""
2
2
  .SH "NAME"
3
3
  \fBhello\fR \- hello world
4
4
  .P
@@ -12,29 +12,40 @@ Your output <i>might</i> look like this:
12
12
  .fi
13
13
  .IP "" 0
14
14
  .P
15
- Here\'s some special entities:
16
- .IP "\[ci]" 4
17
- &bull; \[ci]
18
- .IP "\[ci]" 4
15
+ Here's some special entities:
16
+ .IP "\(bu" 4
17
+ &bull; \(bu
18
+ .IP "\(bu" 4
19
19
  &nbsp; \~
20
- .IP "\[ci]" 4
20
+ .IP "\(bu" 4
21
21
  &copy; \(co
22
- .IP "\[ci]" 4
22
+ .IP "\(bu" 4
23
23
  &rdquo; \(rs
24
- .IP "\[ci]" 4
24
+ .IP "\(bu" 4
25
25
  &mdash; \(em
26
- .IP "\[ci]" 4
26
+ .IP "\(bu" 4
27
27
  &reg; \(rg
28
- .IP "\[ci]" 4
28
+ .IP "\(bu" 4
29
29
  &sect; \(sc
30
- .IP "\[ci]" 4
30
+ .IP "\(bu" 4
31
31
  &ge; \(>=
32
- .IP "\[ci]" 4
32
+ .IP "\(bu" 4
33
33
  &le; \(<=
34
- .IP "\[ci]" 4
34
+ .IP "\(bu" 4
35
35
  &ne; \(!=
36
- .IP "\[ci]" 4
36
+ .IP "\(bu" 4
37
37
  &equiv; \(==
38
38
  .IP "" 0
39
39
  .P
40
- Here\'s a line that uses non\-breaking spaces to force the last\~few\~words\~to\~wrap\~together\.
40
+ Here's a line that uses non\-breaking spaces to force the last\~few\~words\~to\~wrap\~together\.
41
+ .P
42
+ And stuff like this:
43
+ .P
44
+ git bulk [\-g] ([\-a]|[\-w
45
+ .br
46
+ git bulk \-\-addworkspace
47
+ .br
48
+ git bulk \-\-removeworkspace <ws\-name>
49
+ .br
50
+ .P
51
+ Should have the \fB&lt;\fR/\fB&gt;\fR entities stay as \fB&lt;\fR/\fB&gt;\fR in HTML, but be turned into literal brackets in the ROFF\.
@@ -23,3 +23,12 @@ Here's some special entities:
23
23
 
24
24
  Here's a line that uses non-breaking spaces to force the
25
25
  last&nbsp;few&nbsp;words&nbsp;to&nbsp;wrap&nbsp;together.
26
+
27
+ And stuff like this:
28
+
29
+ git bulk [-g] ([-a]|[-w &lt;ws-name&gt;]) &lt;git command&gt; <br/>
30
+ git bulk --addworkspace &lt;ws-name&gt; &lt;ws-root-directory&gt; (--from &lt;URL or file&gt;) <br/>
31
+ git bulk --removeworkspace &lt;ws-name&gt; <br/>
32
+
33
+ Should have the `&lt;`/`&gt;` entities stay as `&lt;`/`&gt;` in HTML, but be
34
+ turned into literal brackets in the ROFF.
@@ -602,16 +602,15 @@ on a line by itself:</p>
602
602
  <p>That is:</p>
603
603
 
604
604
  <ul>
605
- <li>Square brackets containing the link identifier (optionally
605
+ <li>Square brackets containing the link identifier (optionally
606
606
  indented from the left margin using up to three spaces);</li>
607
- <li>followed by a colon;</li>
608
- <li>followed by one or more spaces (or tabs);</li>
609
- <li>followed by the URL for the link;</li>
610
- <li>optionally followed by a title attribute for the link, enclosed
607
+ <li>followed by a colon;</li>
608
+ <li>followed by one or more spaces (or tabs);</li>
609
+ <li>followed by the URL for the link;</li>
610
+ <li>optionally followed by a title attribute for the link, enclosed
611
611
  in double or single quotes, or enclosed in parentheses.</li>
612
612
  </ul>
613
613
 
614
-
615
614
  <p>The following three link definitions are equivalent:</p>
616
615
 
617
616
  <pre><code>[foo]: http://example.com/ "Optional Title Here"
@@ -853,15 +852,14 @@ for links, allowing for two styles: <em>inline</em> and <em>reference</em>.</p>
853
852
  <p>That is:</p>
854
853
 
855
854
  <ul>
856
- <li>An exclamation mark: <code>!</code>;</li>
857
- <li>followed by a set of square brackets, containing the <code>alt</code>
855
+ <li>An exclamation mark: <code>!</code>;</li>
856
+ <li>followed by a set of square brackets, containing the <code>alt</code>
858
857
  attribute text for the image;</li>
859
- <li>followed by a set of parentheses, containing the URL or path to
858
+ <li>followed by a set of parentheses, containing the URL or path to
860
859
  the image, and an optional <code>title</code> attribute enclosed in double
861
860
  or single quotes.</li>
862
861
  </ul>
863
862
 
864
-
865
863
  <p>Reference-style image syntax looks like this:</p>
866
864
 
867
865
  <pre><code>![Alt text][id]
@@ -1,4 +1,4 @@
1
- .TH "MARKDOWN" "5" "January 1979" "" ""
1
+ .TH "MARKDOWN" "5" "January 1979" ""
2
2
  .SH "NAME"
3
3
  \fBmarkdown\fR \- humane markup syntax
4
4
  .SH "SYNOPSIS"
@@ -37,15 +37,15 @@ Inline markup like _italics_, **bold**, and `code()`\.
37
37
  .SS "Philosophy"
38
38
  Markdown is intended to be as easy\-to\-read and easy\-to\-write as is feasible\.
39
39
  .P
40
- Readability, however, is emphasized above all else\. A Markdown\-formatted document should be publishable as\-is, as plain text, without looking like it\'s been marked up with tags or formatting instructions\. While Markdown\'s syntax has been influenced by several existing text\-to\-HTML filters \-\- including Setext \fI\%http://docutils\.sourceforge\.net/mirror/setext\.html\fR, atx \fI\%http://www\.aaronsw\.com/2002/atx/\fR, Textile \fI\%http://textism\.com/tools/textile/\fR, reStructuredText \fI\%http://docutils\.sourceforge\.net/rst\.html\fR, Grutatext \fI\%http://www\.triptico\.com/software/grutatxt\.html\fR, and EtText \fI\%http://ettext\.taint\.org/doc/\fR \-\- the single biggest source of inspiration for Markdown\'s syntax is the format of plain text email\.
40
+ Readability, however, is emphasized above all else\. A Markdown\-formatted document should be publishable as\-is, as plain text, without looking like it's been marked up with tags or formatting instructions\. While Markdown's syntax has been influenced by several existing text\-to\-HTML filters \-\- including Setext \fIhttp://docutils\.sourceforge\.net/mirror/setext\.html\fR, atx \fIhttp://www\.aaronsw\.com/2002/atx/\fR, Textile \fIhttp://textism\.com/tools/textile/\fR, reStructuredText \fIhttp://docutils\.sourceforge\.net/rst\.html\fR, Grutatext \fIhttp://www\.triptico\.com/software/grutatxt\.html\fR, and EtText \fIhttp://ettext\.taint\.org/doc/\fR \-\- the single biggest source of inspiration for Markdown's syntax is the format of plain text email\.
41
41
  .P
42
- To this end, Markdown\'s syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean\. E\.g\., asterisks around a word actually look like *emphasis*\. Markdown lists look like, well, lists\. Even blockquotes look like quoted passages of text, assuming you\'ve ever used email\.
42
+ To this end, Markdown's syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean\. E\.g\., asterisks around a word actually look like *emphasis*\. Markdown lists look like, well, lists\. Even blockquotes look like quoted passages of text, assuming you've ever used email\.
43
43
  .SS "Inline HTML"
44
- Markdown\'s syntax is intended for one purpose: to be used as a format for \fIwriting\fR for the web\.
44
+ Markdown's syntax is intended for one purpose: to be used as a format for \fIwriting\fR for the web\.
45
45
  .P
46
- Markdown is not a replacement for HTML, or even close to it\. Its syntax is very small, corresponding only to a very small subset of HTML tags\. The idea is \fInot\fR to create a syntax that makes it easier to insert HTML tags\. In my opinion, HTML tags are already easy to insert\. The idea for Markdown is to make it easy to read, write, and edit prose\. HTML is a \fIpublishing\fR format; Markdown is a \fIwriting\fR format\. Thus, Markdown\'s formatting syntax only addresses issues that can be conveyed in plain text\.
46
+ Markdown is not a replacement for HTML, or even close to it\. Its syntax is very small, corresponding only to a very small subset of HTML tags\. The idea is \fInot\fR to create a syntax that makes it easier to insert HTML tags\. In my opinion, HTML tags are already easy to insert\. The idea for Markdown is to make it easy to read, write, and edit prose\. HTML is a \fIpublishing\fR format; Markdown is a \fIwriting\fR format\. Thus, Markdown's formatting syntax only addresses issues that can be conveyed in plain text\.
47
47
  .P
48
- For any markup that is not covered by Markdown\'s syntax, you simply use HTML itself\. There\'s no need to preface it or delimit it to indicate that you\'re switching from Markdown to HTML; you just use the tags\.
48
+ For any markup that is not covered by Markdown's syntax, you simply use HTML itself\. There's no need to preface it or delimit it to indicate that you're switching from Markdown to HTML; you just use the tags\.
49
49
  .P
50
50
  The only restrictions are that block\-level HTML elements \-\- e\.g\. \fB<div>\fR, \fB<table>\fR, \fB<pre>\fR, \fB<p>\fR, etc\. \-\- must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces\. Markdown is smart enough not to add extra (unwanted) \fB<p>\fR tags around HTML block\-level tags\.
51
51
  .P
@@ -64,15 +64,15 @@ This is another regular paragraph\.
64
64
  .fi
65
65
  .IP "" 0
66
66
  .P
67
- Note that Markdown formatting syntax is not processed within block\-level HTML tags\. E\.g\., you can\'t use Markdown\-style \fB*emphasis*\fR inside an HTML block\.
67
+ Note that Markdown formatting syntax is not processed within block\-level HTML tags\. E\.g\., you can't use Markdown\-style \fB*emphasis*\fR inside an HTML block\.
68
68
  .P
69
- Span\-level HTML tags \-\- e\.g\. \fB<span>\fR, \fB<cite>\fR, or \fB<del>\fR \-\- can be used anywhere in a Markdown paragraph, list item, or header\. If you want, you can even use HTML tags instead of Markdown formatting; e\.g\. if you\'d prefer to use HTML \fB<a>\fR or \fB<img>\fR tags instead of Markdown\'s link or image syntax, go right ahead\.
69
+ Span\-level HTML tags \-\- e\.g\. \fB<span>\fR, \fB<cite>\fR, or \fB<del>\fR \-\- can be used anywhere in a Markdown paragraph, list item, or header\. If you want, you can even use HTML tags instead of Markdown formatting; e\.g\. if you'd prefer to use HTML \fB<a>\fR or \fB<img>\fR tags instead of Markdown's link or image syntax, go right ahead\.
70
70
  .P
71
71
  Unlike block\-level HTML tags, Markdown syntax \fIis\fR processed within span\-level tags\.
72
72
  .SS "Automatic Escaping for Special Characters"
73
73
  In HTML, there are two characters that demand special treatment: \fB<\fR and \fB&\fR\. Left angle brackets are used to start tags; ampersands are used to denote HTML entities\. If you want to use them as literal characters, you must escape them as entities, e\.g\. \fB&lt;\fR, and \fB&amp;\fR\.
74
74
  .P
75
- Ampersands in particular are bedeviling for web writers\. If you want to write about \'AT&T\', you need to write \'\fBAT&amp;T\fR\'\. You even need to escape ampersands within URLs\. Thus, if you want to link to:
75
+ Ampersands in particular are bedeviling for web writers\. If you want to write about 'AT&T', you need to write '\fBAT&amp;T\fR'\. You even need to escape ampersands within URLs\. Thus, if you want to link to:
76
76
  .IP "" 4
77
77
  .nf
78
78
  http://images\.google\.com/images?num=30&q=larry+bird
@@ -111,7 +111,7 @@ AT&amp;T
111
111
  .fi
112
112
  .IP "" 0
113
113
  .P
114
- Similarly, because Markdown supports \fI\%#html\fR, if you use angle brackets as delimiters for HTML tags, Markdown will treat them as such\. But if you write:
114
+ Similarly, because Markdown supports \fIinline HTML\fR, if you use angle brackets as delimiters for HTML tags, Markdown will treat them as such\. But if you write:
115
115
  .IP "" 4
116
116
  .nf
117
117
  4 < 5
@@ -130,13 +130,13 @@ However, inside Markdown code spans and blocks, angle brackets and ampersands ar
130
130
  .SS "Paragraphs and Line Breaks"
131
131
  A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines\. (A blank line is any line that looks like a blank line \-\- a line containing nothing but spaces or tabs is considered blank\.) Normal paragraphs should not be indented with spaces or tabs\.
132
132
  .P
133
- The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard\-wrapped" text paragraphs\. This differs significantly from most other text\-to\-HTML formatters (including Movable Type\'s "Convert Line Breaks" option) which translate every line break character in a paragraph into a \fB<br />\fR tag\.
133
+ The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard\-wrapped" text paragraphs\. This differs significantly from most other text\-to\-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a \fB<br />\fR tag\.
134
134
  .P
135
135
  When you \fIdo\fR want to insert a \fB<br />\fR break tag using Markdown, you end a line with two or more spaces, then type return\.
136
136
  .P
137
- Yes, this takes a tad more effort to create a \fB<br />\fR, but a simplistic "every line break is a \fB<br />\fR" rule wouldn\'t work for Markdown\. Markdown\'s email\-style \fI\%#blockquote\fR and multi\-paragraph \fI\%#list\fR work best \-\- and look better \-\- when you format them with hard breaks\.
137
+ Yes, this takes a tad more effort to create a \fB<br />\fR, but a simplistic "every line break is a \fB<br />\fR" rule wouldn't work for Markdown\. Markdown's email\-style \fIblockquoting\fR and multi\-paragraph \fIlist items\fR work best \-\- and look better \-\- when you format them with hard breaks\.
138
138
  .SS "Headers"
139
- Markdown supports two styles of headers, Setext \fI\%http://docutils\.sourceforge\.net/mirror/setext\.html\fR and atx \fI\%http://www\.aaronsw\.com/2002/atx/\fR\.
139
+ Markdown supports two styles of headers, Setext \fIhttp://docutils\.sourceforge\.net/mirror/setext\.html\fR and atx \fIhttp://www\.aaronsw\.com/2002/atx/\fR\.
140
140
  .P
141
141
  Setext\-style headers are "underlined" using equal signs (for first\-level headers) and dashes (for second\-level headers)\. For example:
142
142
  .IP "" 4
@@ -149,7 +149,7 @@ This is an H2
149
149
  .fi
150
150
  .IP "" 0
151
151
  .P
152
- Any number of underlining \fB=\fR\'s or \fB\-\fR\'s will work\.
152
+ Any number of underlining \fB=\fR's or \fB\-\fR's will work\.
153
153
  .P
154
154
  Atx\-style headers use 1\-6 hash characters at the start of the line, corresponding to header levels 1\-6\. For example:
155
155
  .IP "" 4
@@ -162,7 +162,7 @@ Atx\-style headers use 1\-6 hash characters at the start of the line, correspond
162
162
  .fi
163
163
  .IP "" 0
164
164
  .P
165
- Optionally, you may "close" atx\-style headers\. This is purely cosmetic \-\- you can use this if you think it looks better\. The closing hashes don\'t even need to match the number of hashes used to open the header\. (The number of opening hashes determines the header level\.) :
165
+ Optionally, you may "close" atx\-style headers\. This is purely cosmetic \-\- you can use this if you think it looks better\. The closing hashes don't even need to match the number of hashes used to open the header\. (The number of opening hashes determines the header level\.) :
166
166
  .IP "" 4
167
167
  .nf
168
168
  # This is an H1 #
@@ -173,7 +173,7 @@ Optionally, you may "close" atx\-style headers\. This is purely cosmetic \-\- yo
173
173
  .fi
174
174
  .IP "" 0
175
175
  .SS "Blockquotes"
176
- Markdown uses email\-style \fB>\fR characters for blockquoting\. If you\'re familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown\. It looks best if you hard wrap the text and put a \fB>\fR before every line:
176
+ Markdown uses email\-style \fB>\fR characters for blockquoting\. If you're familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown\. It looks best if you hard wrap the text and put a \fB>\fR before every line:
177
177
  .IP "" 4
178
178
  .nf
179
179
  > This is a blockquote with two paragraphs\. Lorem ipsum dolor sit amet,
@@ -216,7 +216,7 @@ Blockquotes can contain other Markdown elements, including headers, lists, and c
216
216
  > 1\. This is the first list item\.
217
217
  > 2\. This is the second list item\.
218
218
  >
219
- > Here\'s some example code:
219
+ > Here's some example code:
220
220
  >
221
221
  > return shell_exec("echo $input | $markdown_script");
222
222
  .fi
@@ -262,7 +262,7 @@ Ordered lists use numbers followed by periods:
262
262
  .fi
263
263
  .IP "" 0
264
264
  .P
265
- It\'s important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces\. The HTML Markdown produces from the above list is:
265
+ It's important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces\. The HTML Markdown produces from the above list is:
266
266
  .IP "" 4
267
267
  .nf
268
268
  <ol>
@@ -291,7 +291,7 @@ or even:
291
291
  .fi
292
292
  .IP "" 0
293
293
  .P
294
- you\'d get the exact same HTML output\. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML\. But if you want to be lazy, you don\'t have to\.
294
+ you'd get the exact same HTML output\. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML\. But if you want to be lazy, you don't have to\.
295
295
  .P
296
296
  If you do use lazy list numbering, however, you should still start the list with the number 1\. At some point in the future, Markdown may support starting ordered lists at an arbitrary number\.
297
297
  .P
@@ -308,7 +308,7 @@ To make lists look nice, you can wrap items with hanging indents:
308
308
  .fi
309
309
  .IP "" 0
310
310
  .P
311
- But if you want to be lazy, you don\'t have to:
311
+ But if you want to be lazy, you don't have to:
312
312
  .IP "" 4
313
313
  .nf
314
314
  * Lorem ipsum dolor sit amet, consectetuer adipiscing elit\.
@@ -376,7 +376,7 @@ It looks nice if you indent every line of the subsequent paragraphs, but here ag
376
376
  .nf
377
377
  * This is a list item with two paragraphs\.
378
378
 
379
- This is the second paragraph in the list item\. You\'re
379
+ This is the second paragraph in the list item\. You're
380
380
  only required to indent the first line\. Lorem ipsum dolor
381
381
  sit amet, consectetuer adipiscing elit\.
382
382
 
@@ -384,7 +384,7 @@ sit amet, consectetuer adipiscing elit\.
384
384
  .fi
385
385
  .IP "" 0
386
386
  .P
387
- To put a blockquote within a list item, the blockquote\'s \fB>\fR delimiters need to be indented:
387
+ To put a blockquote within a list item, the blockquote's \fB>\fR delimiters need to be indented:
388
388
  .IP "" 4
389
389
  .nf
390
390
  * A list item with a blockquote:
@@ -403,7 +403,7 @@ To put a code block within a list item, the code block needs to be indented \fIt
403
403
  .fi
404
404
  .IP "" 0
405
405
  .P
406
- It\'s worth noting that it\'s possible to trigger an ordered list by accident, by writing something like this:
406
+ It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this:
407
407
  .IP "" 4
408
408
  .nf
409
409
  1986\. What a great season\.
@@ -482,7 +482,7 @@ will turn into:
482
482
  .fi
483
483
  .IP "" 0
484
484
  .P
485
- Regular Markdown syntax is not processed within code blocks\. E\.g\., asterisks are just literal asterisks within a code block\. This means it\'s also easy to use Markdown to write about Markdown\'s own syntax\.
485
+ Regular Markdown syntax is not processed within code blocks\. E\.g\., asterisks are just literal asterisks within a code block\. This means it's also easy to use Markdown to write about Markdown's own syntax\.
486
486
  .SS "Horizontal Rules"
487
487
  You can produce a horizontal rule tag (\fB<hr />\fR) by placing three or more hyphens, asterisks, or underscores on a line by themselves\. If you wish, you may use spaces between the hyphens or asterisks\. Each of the following lines will produce a horizontal rule:
488
488
  .IP "" 4
@@ -504,7 +504,7 @@ Markdown supports two style of links: \fIinline\fR and \fIreference\fR\.
504
504
  .P
505
505
  In both styles, the link text is delimited by [square brackets]\.
506
506
  .P
507
- To create an inline link, use a set of regular parentheses immediately after the link text\'s closing square bracket\. Inside the parentheses, put the URL where you want the link to point, along with an \fIoptional\fR title for the link, surrounded in quotes\. For example:
507
+ To create an inline link, use a set of regular parentheses immediately after the link text's closing square bracket\. Inside the parentheses, put the URL where you want the link to point, along with an \fIoptional\fR title for the link, surrounded in quotes\. For example:
508
508
  .IP "" 4
509
509
  .nf
510
510
  This is [an example](http://example\.com/ "Title") inline link\.
@@ -524,7 +524,7 @@ title attribute\.</p>
524
524
  .fi
525
525
  .IP "" 0
526
526
  .P
527
- If you\'re referring to a local resource on the same server, you can use relative paths:
527
+ If you're referring to a local resource on the same server, you can use relative paths:
528
528
  .IP "" 4
529
529
  .nf
530
530
  See my [About](/about/) page for details\.
@@ -553,15 +553,15 @@ Then, anywhere in the document, you define your link label like this, on a line
553
553
  .IP "" 0
554
554
  .P
555
555
  That is:
556
- .IP "\[ci]" 4
556
+ .IP "\(bu" 4
557
557
  Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces);
558
- .IP "\[ci]" 4
558
+ .IP "\(bu" 4
559
559
  followed by a colon;
560
- .IP "\[ci]" 4
560
+ .IP "\(bu" 4
561
561
  followed by one or more spaces (or tabs);
562
- .IP "\[ci]" 4
562
+ .IP "\(bu" 4
563
563
  followed by the URL for the link;
564
- .IP "\[ci]" 4
564
+ .IP "\(bu" 4
565
565
  optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses\.
566
566
  .IP "" 0
567
567
  .P
@@ -569,7 +569,7 @@ The following three link definitions are equivalent:
569
569
  .IP "" 4
570
570
  .nf
571
571
  [foo]: http://example\.com/ "Optional Title Here"
572
- [foo]: http://example\.com/ \'Optional Title Here\'
572
+ [foo]: http://example\.com/ 'Optional Title Here'
573
573
  [foo]: http://example\.com/ (Optional Title Here)
574
574
  .fi
575
575
  .IP "" 0
@@ -631,9 +631,9 @@ And then define the link:
631
631
  .fi
632
632
  .IP "" 0
633
633
  .P
634
- Link definitions can be placed anywhere in your Markdown document\. I tend to put them immediately after each paragraph in which they\'re used, but if you want, you can put them all at the end of your document, sort of like footnotes\.
634
+ Link definitions can be placed anywhere in your Markdown document\. I tend to put them immediately after each paragraph in which they're used, but if you want, you can put them all at the end of your document, sort of like footnotes\.
635
635
  .P
636
- Here\'s an example of reference links in action:
636
+ Here's an example of reference links in action:
637
637
  .IP "" 4
638
638
  .nf
639
639
  I get 10 times more traffic from [Google] [1] than from
@@ -667,7 +667,7 @@ or <a href="http://search\.msn\.com/" title="MSN Search">MSN</a>\.</p>
667
667
  .fi
668
668
  .IP "" 0
669
669
  .P
670
- For comparison, here is the same paragraph written using Markdown\'s inline link style:
670
+ For comparison, here is the same paragraph written using Markdown's inline link style:
671
671
  .IP "" 4
672
672
  .nf
673
673
  I get 10 times more traffic from [Google](http://google\.com/ "Google")
@@ -676,11 +676,11 @@ than from [Yahoo](http://search\.yahoo\.com/ "Yahoo Search") or
676
676
  .fi
677
677
  .IP "" 0
678
678
  .P
679
- The point of reference\-style links is not that they\'re easier to write\. The point is that with reference\-style links, your document source is vastly more readable\. Compare the above examples: using reference\-style links, the paragraph itself is only 81 characters long; with inline\-style links, it\'s 176 characters; and as raw HTML, it\'s 234 characters\. In the raw HTML, there\'s more markup than there is text\.
679
+ The point of reference\-style links is not that they're easier to write\. The point is that with reference\-style links, your document source is vastly more readable\. Compare the above examples: using reference\-style links, the paragraph itself is only 81 characters long; with inline\-style links, it's 176 characters; and as raw HTML, it's 234 characters\. In the raw HTML, there's more markup than there is text\.
680
680
  .P
681
- With Markdown\'s reference\-style links, a source document much more closely resembles the final output, as rendered in a browser\. By allowing you to move the markup\-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose\.
681
+ With Markdown's reference\-style links, a source document much more closely resembles the final output, as rendered in a browser\. By allowing you to move the markup\-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose\.
682
682
  .SS "Emphasis"
683
- Markdown treats asterisks (\fB*\fR) and underscores (\fB_\fR) as indicators of emphasis\. Text wrapped with one \fB*\fR or \fB_\fR will be wrapped with an HTML \fB<em>\fR tag; double \fB*\fR\'s or \fB_\fR\'s will be wrapped with an HTML \fB<strong>\fR tag\. E\.g\., this input:
683
+ Markdown treats asterisks (\fB*\fR) and underscores (\fB_\fR) as indicators of emphasis\. Text wrapped with one \fB*\fR or \fB_\fR will be wrapped with an HTML \fB<em>\fR tag; double \fB*\fR's or \fB_\fR's will be wrapped with an HTML \fB<strong>\fR tag\. E\.g\., this input:
684
684
  .IP "" 4
685
685
  .nf
686
686
  *single asterisks*
@@ -715,7 +715,7 @@ un*frigging*believable
715
715
  .fi
716
716
  .IP "" 0
717
717
  .P
718
- But if you surround an \fB*\fR or \fB_\fR with spaces, it\'ll be treated as a literal asterisk or underscore\.
718
+ But if you surround an \fB*\fR or \fB_\fR with spaces, it'll be treated as a literal asterisk or underscore\.
719
719
  .P
720
720
  To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it:
721
721
  .IP "" 4
@@ -773,14 +773,14 @@ will produce:
773
773
  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:
774
774
  .IP "" 4
775
775
  .nf
776
- Please don\'t use any `<blink>` tags\.
776
+ Please don't use any `<blink>` tags\.
777
777
  .fi
778
778
  .IP "" 0
779
779
  .P
780
780
  into:
781
781
  .IP "" 4
782
782
  .nf
783
- <p>Please don\'t use any <code>&lt;blink&gt;</code> tags\.</p>
783
+ <p>Please don't use any <code>&lt;blink&gt;</code> tags\.</p>
784
784
  .fi
785
785
  .IP "" 0
786
786
  .P
@@ -799,7 +799,7 @@ equivalent of <code>&amp;mdash;</code>\.</p>
799
799
  .fi
800
800
  .IP "" 0
801
801
  .SS "Images"
802
- Admittedly, it\'s fairly difficult to devise a "natural" syntax for placing images into a plain text document format\.
802
+ Admittedly, it's fairly difficult to devise a "natural" syntax for placing images into a plain text document format\.
803
803
  .P
804
804
  Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: \fIinline\fR and \fIreference\fR\.
805
805
  .P
@@ -813,11 +813,11 @@ Inline image syntax looks like this:
813
813
  .IP "" 0
814
814
  .P
815
815
  That is:
816
- .IP "\[ci]" 4
816
+ .IP "\(bu" 4
817
817
  An exclamation mark: \fB!\fR;
818
- .IP "\[ci]" 4
818
+ .IP "\(bu" 4
819
819
  followed by a set of square brackets, containing the \fBalt\fR attribute text for the image;
820
- .IP "\[ci]" 4
820
+ .IP "\(bu" 4
821
821
  followed by a set of parentheses, containing the URL or path to the image, and an optional \fBtitle\fR attribute enclosed in double or single quotes\.
822
822
  .IP "" 0
823
823
  .P
@@ -871,9 +871,9 @@ into something like this:
871
871
  .P
872
872
  which will render in a browser as a clickable link to "address@example\.com"\.
873
873
  .P
874
- (This sort of entity\-encoding trick will indeed fool many, if not most, address\-harvesting bots, but it definitely won\'t fool all of them\. It\'s better than nothing, but an address published in this way will probably eventually start receiving spam\.)
874
+ (This sort of entity\-encoding trick will indeed fool many, if not most, address\-harvesting bots, but it definitely won't fool all of them\. It's better than nothing, but an address published in this way will probably eventually start receiving spam\.)
875
875
  .SS "Backslash Escapes"
876
- Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown\'s formatting syntax\. For example, if you wanted to surround a word with literal asterisks (instead of an HTML \fB<em>\fR tag), you can use backslashes before the asterisks, like this:
876
+ Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown's formatting syntax\. For example, if you wanted to surround a word with literal asterisks (instead of an HTML \fB<em>\fR tag), you can use backslashes before the asterisks, like this:
877
877
  .IP "" 4
878
878
  .nf
879
879
  \e*literal asterisks\e*
@@ -900,8 +900,8 @@ _ underscore
900
900
  .SH "AUTHOR"
901
901
  Markdown was created by John Gruber\.
902
902
  .P
903
- Manual page by Ryan Tomayko\. It\'s pretty much a direct copy of the Markdown Syntax Reference \fI\%http://daringfireball\.net/projects/markdown/syntax\fR, also by John Gruber\.
903
+ Manual page by Ryan Tomayko\. It's pretty much a direct copy of the Markdown Syntax Reference \fIhttp://daringfireball\.net/projects/markdown/syntax\fR, also by John Gruber\.
904
904
  .SH "SEE ALSO"
905
905
  ronn(5)
906
906
  .br
907
- \fI\%http://daringfireball\.net/projects/markdown/\fR
907
+ \fIhttp://daringfireball\.net/projects/markdown/\fR