pasta 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +57 -0
- data/Rakefile +9 -0
- data/bin/pasta +40 -0
- data/lib/pasta.rb +18 -0
- data/lib/pasta/cookbook.rb +13 -0
- data/lib/pasta/dish.rb +62 -0
- data/lib/pasta/error.rb +3 -0
- data/lib/pasta/ingredients.rb +49 -0
- data/lib/pasta/ingredients/anything.rb +12 -0
- data/lib/pasta/ingredients/atx_headings.rb +21 -0
- data/lib/pasta/ingredients/automatic_links.rb +14 -0
- data/lib/pasta/ingredients/blockquotes.rb +23 -0
- data/lib/pasta/ingredients/code.rb +15 -0
- data/lib/pasta/ingredients/codeblocks.rb +19 -0
- data/lib/pasta/ingredients/emphasis.rb +14 -0
- data/lib/pasta/ingredients/empty_lines.rb +13 -0
- data/lib/pasta/ingredients/html_entities.rb +17 -0
- data/lib/pasta/ingredients/links.rb +58 -0
- data/lib/pasta/ingredients/lists.rb +31 -0
- data/lib/pasta/ingredients/page_breaks.rb +14 -0
- data/lib/pasta/ingredients/paragraphs.rb +27 -0
- data/lib/pasta/ingredients/setext_headings.rb +20 -0
- data/lib/pasta/recipes/base.rb +40 -0
- data/lib/pasta/recipes/gruber.rb +27 -0
- data/lib/pasta/recipes/markdown.rb +11 -0
- data/lib/pasta/version.rb +3 -0
- data/pasta.gemspec +24 -0
- data/specs/base_spec.rb +8 -0
- data/specs/dish_spec.rb +30 -0
- data/specs/dsl_spec.rb +12 -0
- data/specs/recipes/gruber/automatic_links.yml +12 -0
- data/specs/recipes/gruber/blockquotes.yml +112 -0
- data/specs/recipes/gruber/code.yml +48 -0
- data/specs/recipes/gruber/codeblocks.yml +47 -0
- data/specs/recipes/gruber/emphasis.yml +57 -0
- data/specs/recipes/gruber/gruber_spec.rb +22 -0
- data/specs/recipes/gruber/headers.yml +88 -0
- data/specs/recipes/gruber/images.yml +49 -0
- data/specs/recipes/gruber/links.yml +184 -0
- data/specs/recipes/gruber/lists.yml +171 -0
- data/specs/recipes/gruber/page_breaks.yml +31 -0
- data/specs/recipes/gruber/paragraphs.yml +44 -0
- data/specs/spec_helper.rb +3 -0
- metadata +149 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
overview: |
|
2
|
+
To indicate a span of code, wrap it with backtick quotes (`). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph.
|
3
|
+
|
4
|
+
To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters. The backtick delimiters surrounding a code span may include spaces — one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span:
|
5
|
+
|
6
|
+
With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to include example HTML tags.
|
7
|
+
|
8
|
+
http://daringfireball.net/projects/markdown/syntax
|
9
|
+
tests:
|
10
|
+
- name: Code Ticks
|
11
|
+
desc: Single backticks indicate code
|
12
|
+
text: Use the `printf()` function.
|
13
|
+
html: <p>Use the <code>printf()</code> function.</p>
|
14
|
+
|
15
|
+
- name: Code Ticks
|
16
|
+
desc: Will escape HTML entities
|
17
|
+
text: |
|
18
|
+
Please don't use any `<blink>` tags.
|
19
|
+
html: |
|
20
|
+
<p>Please don't use any <code><blink></code> tags.</p>
|
21
|
+
|
22
|
+
- name: Code Ticks
|
23
|
+
desc: Will escape HTML entities
|
24
|
+
text: |
|
25
|
+
`—` is the decimal-encoded equivalent of `—`.
|
26
|
+
html: |
|
27
|
+
<p><code>&#8212;</code> is the decimal-encoded equivalent of <code>&mdash;</code>.</p>
|
28
|
+
|
29
|
+
- name: Code Ticks
|
30
|
+
desc: Multiple ticks indicate literal tick
|
31
|
+
text: |
|
32
|
+
``There is a literal backtick (`) here.``
|
33
|
+
html: |
|
34
|
+
<p><code>There is a literal backtick (`) here.</code></p>
|
35
|
+
|
36
|
+
- name: Code Ticks
|
37
|
+
desc: A single backtick in a code span
|
38
|
+
text: |
|
39
|
+
A single backtick in a code span: `` ` ``
|
40
|
+
html: |
|
41
|
+
<p>A single backtick in a code span: <code> ` </code></p>
|
42
|
+
|
43
|
+
- name: Code Ticks
|
44
|
+
desc: A backtick-delimited string in a code span
|
45
|
+
text: |
|
46
|
+
A backtick-delimited string in a code span: `` `foo` ``
|
47
|
+
html: |
|
48
|
+
<p>A backtick-delimited string in a code span: <code> `foo` </code></p>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
overview: |
|
2
|
+
Code Blocks
|
3
|
+
|
4
|
+
Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the lines of a code block are interpreted literally. Markdown wraps a code block in both <pre> and <code> tags.
|
5
|
+
|
6
|
+
To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab.
|
7
|
+
|
8
|
+
One level of indentation — 4 spaces or 1 tab — is removed from each line of the code block.
|
9
|
+
|
10
|
+
A code block continues until it reaches a line that is not indented (or the end of the article).
|
11
|
+
|
12
|
+
Within a code block, ampersands (&) and angle brackets (< and >) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown — just paste it and indent it, and Markdown will handle the hassle of encoding the ampersands and angle brackets.
|
13
|
+
|
14
|
+
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.
|
15
|
+
|
16
|
+
http://daringfireball.net/projects/markdown/syntax
|
17
|
+
tests:
|
18
|
+
- name: Single line of code
|
19
|
+
desc: A Single line of code with 4 leading spaces
|
20
|
+
text: " This is a code block."
|
21
|
+
html: <pre><code>This is a code block.</code></pre>
|
22
|
+
|
23
|
+
- name: Single line of code
|
24
|
+
desc: A Single line of code with a leading tab
|
25
|
+
text: "\tThis is a code block."
|
26
|
+
html: <pre><code>This is a code block.</code></pre>
|
27
|
+
|
28
|
+
- name: Multi line code
|
29
|
+
desc: Multiple lines of code with 4 leading spaces
|
30
|
+
text: " tell application Foo\n beep\n end tell"
|
31
|
+
html: "<pre><code>tell application Foo\n beep\nend tell</code></pre>"
|
32
|
+
|
33
|
+
- name: Multi line code
|
34
|
+
desc: Multiple lines of code with leading tabs
|
35
|
+
text: "\ttell application Foo\n\t\tbeep\n\tend tell"
|
36
|
+
html: "<pre><code>tell application Foo\n\tbeep\nend tell</code></pre>"
|
37
|
+
|
38
|
+
- name: Escape html entities
|
39
|
+
desc: HTML entities within code blocks will be escaped
|
40
|
+
text: " <div class='footer'>\n © 2004 Foo Corporation\n </div>"
|
41
|
+
html: "<pre><code><div class='footer'>\n &copy; 2004 Foo Corporation\n</div></code></pre>"
|
42
|
+
|
43
|
+
- name: Multiline code
|
44
|
+
desc: Multiple lines of code with empty lines
|
45
|
+
text: " A First Level Header\n ====================\n \n A Second Level Header\n ---------------------"
|
46
|
+
html: "<pre><code>A First Level Header\n====================\n\nA Second Level Header\n---------------------</code></pre>"
|
47
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
overview: |
|
2
|
+
Markdown treats asterisks (*) and underscores (_) as indicators of emphasis. Text wrapped with one * or _ will be wrapped with an HTML <em> tag; double *’s or _’s will be wrapped with an HTML <strong> tag. E.g., this input:
|
3
|
+
|
4
|
+
You can use whichever style you prefer; the lone restriction is that the same character must be used to open and close an emphasis span.
|
5
|
+
|
6
|
+
Emphasis can be used in the middle of a word but if you surround an * or _ with spaces, it’ll be treated as a literal asterisk or underscore.
|
7
|
+
|
8
|
+
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:
|
9
|
+
|
10
|
+
\*this text is surrounded by literal asterisks\*
|
11
|
+
|
12
|
+
http://daringfireball.net/projects/markdown/syntax
|
13
|
+
tests:
|
14
|
+
- name: Single Emp
|
15
|
+
desc: Single asterisks as emphasis
|
16
|
+
text: "*single asterisks*"
|
17
|
+
html: <p><em>single asterisks</em></p>
|
18
|
+
|
19
|
+
- name: Single Emp
|
20
|
+
desc: Single underscore as emphasis
|
21
|
+
text: "_single underscore_"
|
22
|
+
html: <p><em>single underscore</em></p>
|
23
|
+
|
24
|
+
- name: Single Emp
|
25
|
+
desc: Unmatched asterisks and underscore
|
26
|
+
text: "*confused emphasis_"
|
27
|
+
html: <p>*confused emphasis_</p>
|
28
|
+
|
29
|
+
- name: Double Emp
|
30
|
+
desc: Double asteriskss as emphasis
|
31
|
+
text: "**double asterisks**"
|
32
|
+
html: <p><strong>double asterisks</strong></p>
|
33
|
+
|
34
|
+
- name: Double Emp
|
35
|
+
desc: Double underscores as emphasis
|
36
|
+
text: "__double underscore__"
|
37
|
+
html: <p><strong>double underscore</strong></p>
|
38
|
+
|
39
|
+
- name: Mid-word Emp
|
40
|
+
desc: Asterisks mid-word
|
41
|
+
text: "un*frigging*believable"
|
42
|
+
html: <p>un<em>frigging</em>believable</p>
|
43
|
+
|
44
|
+
- name: Mid-word Emp
|
45
|
+
desc: Underscores mid-word
|
46
|
+
text: "un_frigging_believable"
|
47
|
+
html: <p>un<em>frigging</em>believable</p>
|
48
|
+
|
49
|
+
- name: Escaped Emp
|
50
|
+
desc: Underscores surrounded by spaces
|
51
|
+
text: "_ unbelievable _"
|
52
|
+
html: <p>_ unbelievable _</p>
|
53
|
+
|
54
|
+
- name: Escaped Emp
|
55
|
+
desc: Asterisks surrounded by spaces
|
56
|
+
text: "This is * unbelievable *"
|
57
|
+
html: <p>This is * unbelievable *</p>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Gruber' do
|
4
|
+
before do
|
5
|
+
@gruber = Pasta::Recipes::Gruber.new
|
6
|
+
end
|
7
|
+
|
8
|
+
it "converts text to html" do
|
9
|
+
@gruber.to_html('some yummy text').must_be_kind_of String
|
10
|
+
end
|
11
|
+
|
12
|
+
Dir.glob(File.dirname(__FILE__) + '/*.yml').each do |file|
|
13
|
+
yaml = YAML.load_file(file)
|
14
|
+
|
15
|
+
yaml['tests'].each do |test|
|
16
|
+
it "parses #{test['desc']} to html" do
|
17
|
+
@gruber.to_html(test['text']).must_equal test['html'].strip
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
overview: |
|
2
|
+
Markdown supports two styles of headers, Setext and atx.
|
3
|
+
|
4
|
+
Setext-style headers are “underlined” using equal signs (for first-level headers) and dashes (for second-level headers). Any number of underlining =’s or -’s will work.
|
5
|
+
|
6
|
+
Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. 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.)
|
7
|
+
|
8
|
+
http://daringfireball.net/projects/markdown/syntax
|
9
|
+
tests:
|
10
|
+
- name: ATX level 1
|
11
|
+
desc: An ATX level 1 header
|
12
|
+
text: "# This is a header"
|
13
|
+
html: <h1>This is a header</h1>
|
14
|
+
|
15
|
+
- name: ATX level 1 trailing
|
16
|
+
desc: An ATX level 1 header with trailing hash
|
17
|
+
text: "# This is a header #"
|
18
|
+
html: <h1>This is a header</h1>
|
19
|
+
|
20
|
+
- name: ATX level 2
|
21
|
+
desc: An ATX level 2 header
|
22
|
+
text: "## This is a header"
|
23
|
+
html: <h2>This is a header</h2>
|
24
|
+
|
25
|
+
- name: ATX level 2 trailing
|
26
|
+
desc: An ATX level 2 header with trailing hash
|
27
|
+
text: "## This is a header ##"
|
28
|
+
html: <h2>This is a header</h2>
|
29
|
+
|
30
|
+
- name: ATX level 3
|
31
|
+
desc: An ATX level 3 header
|
32
|
+
text: "# This is a header"
|
33
|
+
html: <h1>This is a header</h1>
|
34
|
+
|
35
|
+
- name: ATX level 3 trailing
|
36
|
+
desc: An ATX level 3 header with uneven trailing hash
|
37
|
+
text: "### This is a header #"
|
38
|
+
html: <h3>This is a header</h3>
|
39
|
+
|
40
|
+
- name: ATX level 4
|
41
|
+
desc: An ATX level 3 header
|
42
|
+
text: "# This is a header"
|
43
|
+
html: <h1>This is a header</h1>
|
44
|
+
|
45
|
+
- name: ATX level 4
|
46
|
+
desc: An ATX level 4 header
|
47
|
+
text: "#### This is a header"
|
48
|
+
html: <h4>This is a header</h4>
|
49
|
+
|
50
|
+
- name: ATX level 5
|
51
|
+
desc: An ATX level 5 header
|
52
|
+
text: "##### This is a header"
|
53
|
+
html: <h5>This is a header</h5>
|
54
|
+
|
55
|
+
- name: ATX level 6
|
56
|
+
desc: An ATX level 6 header
|
57
|
+
text: "###### This is a header"
|
58
|
+
html: <h6>This is a header</h6>
|
59
|
+
|
60
|
+
- name: Oversized ATX heading
|
61
|
+
desc: An ATX level 6 header but with too many hashes
|
62
|
+
text: "######## This is a header"
|
63
|
+
html: "<h6>## This is a header</h6>"
|
64
|
+
|
65
|
+
- name: Multiple headers
|
66
|
+
desc: One header followed by another
|
67
|
+
text: |
|
68
|
+
# This is a header
|
69
|
+
|
70
|
+
## And this is another
|
71
|
+
html: |
|
72
|
+
<h1>This is a header</h1>
|
73
|
+
<h2>And this is another</h2>
|
74
|
+
|
75
|
+
|
76
|
+
- name: Setext level 1
|
77
|
+
desc: An setext level 1 header
|
78
|
+
text: |
|
79
|
+
Setext Header 1
|
80
|
+
===============
|
81
|
+
html: <h1>Setext Header 1</h1>
|
82
|
+
|
83
|
+
- name: Setext level 2
|
84
|
+
desc: An setext level 2 header
|
85
|
+
text: |
|
86
|
+
Setext Header 2
|
87
|
+
---------------
|
88
|
+
html: <h2>Setext Header 2</h2>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
overview: |
|
2
|
+
Admittedly, it’s fairly difficult to devise a “natural” syntax for placing images into a plain text document format.
|
3
|
+
|
4
|
+
Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference.
|
5
|
+
|
6
|
+
Inline image syntax looks like this:
|
7
|
+
|
8
|
+
![Alt text](/path/to/img.jpg)
|
9
|
+
|
10
|
+
![Alt text](/path/to/img.jpg "Optional title")
|
11
|
+
|
12
|
+
That is:
|
13
|
+
|
14
|
+
An exclamation mark: !;
|
15
|
+
followed by a set of square brackets, containing the alt attribute text for the image;
|
16
|
+
followed by a set of parentheses, containing the URL or path to the image, and an optional title attribute enclosed in double or single quotes.
|
17
|
+
|
18
|
+
Reference-style image syntax looks like this:
|
19
|
+
|
20
|
+
![Alt text][id]
|
21
|
+
|
22
|
+
Where “id” is the name of a defined image reference. Image references are defined using syntax identical to link references.
|
23
|
+
|
24
|
+
As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML <img> tags.
|
25
|
+
|
26
|
+
http://daringfireball.net/projects/markdown/syntax
|
27
|
+
tests:
|
28
|
+
- name: Inline image
|
29
|
+
desc: An inline image
|
30
|
+
text: |
|
31
|
+
![Alt text](/path/to/img.jpg)
|
32
|
+
html: |
|
33
|
+
<p><img src="/path/to/img.jpg" alt="Alt text" /></p>
|
34
|
+
|
35
|
+
- name: Inline image
|
36
|
+
desc: An inline image with optional title
|
37
|
+
text: |
|
38
|
+
![Alt text](/path/to/img.jpg "Optional title")
|
39
|
+
html: |
|
40
|
+
<p><img src="/path/to/img.jpg" alt="Alt text" title="Optional title" /></p>
|
41
|
+
|
42
|
+
- name: Reference image
|
43
|
+
desc: An reference image with optional title
|
44
|
+
text: |
|
45
|
+
![Alt text][id]
|
46
|
+
|
47
|
+
[id]: url/to/image "Optional title attribute"
|
48
|
+
html: |
|
49
|
+
<p><img src="url/to/image" alt="Alt text" title="Optional title attribute" /></p>
|
@@ -0,0 +1,184 @@
|
|
1
|
+
overview: |
|
2
|
+
Markdown supports two style of links: inline and reference.
|
3
|
+
|
4
|
+
In both styles, the link text is delimited by [square brackets].
|
5
|
+
|
6
|
+
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 optional title for the link, surrounded in quotes.
|
7
|
+
|
8
|
+
If you’re referring to a local resource on the same server, you can use relative paths.
|
9
|
+
|
10
|
+
Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link. You can optionally use a space to separate the sets of brackets. Then, anywhere in the document, you define your link label like this, on a line by itself.
|
11
|
+
|
12
|
+
That is:
|
13
|
+
|
14
|
+
Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces);
|
15
|
+
followed by a colon;
|
16
|
+
followed by one or more spaces (or tabs);
|
17
|
+
followed by the URL for the link;
|
18
|
+
optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses.
|
19
|
+
|
20
|
+
The following three link definitions are equivalent:
|
21
|
+
|
22
|
+
--- this is not implemented ---
|
23
|
+
[foo]: http://example.com/ "Optional Title Here"
|
24
|
+
[foo]: http://example.com/ 'Optional Title Here'
|
25
|
+
[foo]: http://example.com/ (Optional Title Here)
|
26
|
+
---
|
27
|
+
|
28
|
+
The link URL may, optionally, be surrounded by angle brackets:
|
29
|
+
|
30
|
+
You can put the title attribute on the next line and use extra spaces or tabs for padding, which tends to look better with longer URLs.
|
31
|
+
|
32
|
+
Link definitions are only used for creating links during Markdown processing, and are stripped from your document in the HTML output.
|
33
|
+
|
34
|
+
Link definition names may consist of letters, numbers, spaces, and punctuation — but they are not case sensitive.
|
35
|
+
|
36
|
+
The implicit link name shortcut allows you to omit the name of the link, in which case the link text itself is used as the name. Just use an empty set of square brackets — e.g., to link the word “Google” to the google.com web site, you could simply write [Google][] and then define the link as [Google]: http://google.com/
|
37
|
+
|
38
|
+
Because link names may contain spaces, this shortcut even works for multiple words in the link text.
|
39
|
+
|
40
|
+
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.
|
41
|
+
|
42
|
+
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.
|
43
|
+
|
44
|
+
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.
|
45
|
+
|
46
|
+
http://daringfireball.net/projects/markdown/syntax
|
47
|
+
tests:
|
48
|
+
- name: Inline Links
|
49
|
+
desc: An inline link
|
50
|
+
text: |
|
51
|
+
[This link](http://example.net/) has no title attribute.
|
52
|
+
html: |
|
53
|
+
<p><a href="http://example.net/">This link</a> has no title attribute.</p>
|
54
|
+
|
55
|
+
- name: Inline Links Title
|
56
|
+
desc: An inline link with title text
|
57
|
+
text: |
|
58
|
+
This is [an example](http://example.com/ "Title") inline link.
|
59
|
+
html: |
|
60
|
+
<p>This is <a href="http://example.com/" title="Title">an example</a> inline link.</p>
|
61
|
+
|
62
|
+
- name: Relative links
|
63
|
+
desc: Inline relative link
|
64
|
+
text: |
|
65
|
+
See my [About](/about/) page for details.
|
66
|
+
html: |
|
67
|
+
<p>See my <a href="/about/">About</a> page for details.</p>
|
68
|
+
|
69
|
+
- name: Relative links
|
70
|
+
desc: Multiple relative links
|
71
|
+
text: |
|
72
|
+
See my [About](/about/) page for [details](/details).
|
73
|
+
html: |
|
74
|
+
<p>See my <a href="/about/">About</a> page for <a href="/details">details</a>.</p>
|
75
|
+
|
76
|
+
- name: Reference Links
|
77
|
+
desc: A reference link
|
78
|
+
text: |
|
79
|
+
This is [an example][id] reference-style link.
|
80
|
+
|
81
|
+
[id]: http://example.com/ "Optional Title Here"
|
82
|
+
html: |
|
83
|
+
<p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.</p>
|
84
|
+
|
85
|
+
- name: Reference Links
|
86
|
+
desc: A reference link with optional space
|
87
|
+
text: |
|
88
|
+
This is [an example] [id] reference-style link.
|
89
|
+
|
90
|
+
[id]: http://example.com/ "Optional Title Here"
|
91
|
+
html: |
|
92
|
+
<p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.</p>
|
93
|
+
|
94
|
+
- name: Reference Links
|
95
|
+
desc: A reference link with optional angled brackets
|
96
|
+
text: |
|
97
|
+
This is [an example][id] reference-style link.
|
98
|
+
|
99
|
+
[id]: <http://example.de/> "Optional Title Here"
|
100
|
+
html: |
|
101
|
+
<p>This is <a href="http://example.de/" title="Optional Title Here">an example</a> reference-style link.</p>
|
102
|
+
|
103
|
+
- name: Reference Links
|
104
|
+
desc: A reference link with title text on a new line
|
105
|
+
text: |
|
106
|
+
This is [an example][id] reference-style link.
|
107
|
+
|
108
|
+
[id]: http://example.at/longish/path/to/resource/here
|
109
|
+
"Optional Title Here"
|
110
|
+
html: |
|
111
|
+
<p>This is <a href="http://example.at/longish/path/to/resource/here" title="Optional Title Here">an example</a> reference-style link.</p>
|
112
|
+
|
113
|
+
- name: Reference Links
|
114
|
+
desc: Reference link are case insensitive
|
115
|
+
text: |
|
116
|
+
This is [an example][id] reference-style link.
|
117
|
+
|
118
|
+
[iD]: http://example.com/
|
119
|
+
html: |
|
120
|
+
<p>This is <a href="http://example.com/">an example</a> reference-style link.</p>
|
121
|
+
|
122
|
+
- name: Reference Links
|
123
|
+
desc: Reference link with implicit ids
|
124
|
+
text: |
|
125
|
+
[Google][]
|
126
|
+
|
127
|
+
[Google]: http://google.com/
|
128
|
+
html: |
|
129
|
+
<p><a href="http://google.com/">Google</a></p>
|
130
|
+
|
131
|
+
- name: Reference Links
|
132
|
+
desc: Reference link with spaces in implicit ids
|
133
|
+
text: |
|
134
|
+
Visit [Daring Fireball][] for more information.
|
135
|
+
|
136
|
+
[Daring Fireball]: http://daringfireball.net/
|
137
|
+
html: |
|
138
|
+
<p>Visit <a href="http://daringfireball.net/">Daring Fireball</a> for more information.</p>
|
139
|
+
|
140
|
+
- name: Reference Links
|
141
|
+
desc: Reference link with link definitions before link
|
142
|
+
text: |
|
143
|
+
[Daring Fireball]: http://daringfireball.net/
|
144
|
+
|
145
|
+
Visit [Daring Fireball][] for more information.
|
146
|
+
html: |
|
147
|
+
<p>Visit <a href="http://daringfireball.net/">Daring Fireball</a> for more information.</p>
|
148
|
+
|
149
|
+
- name: Reference Links
|
150
|
+
desc: Reference link with multiple links and text
|
151
|
+
text: |
|
152
|
+
This page offers a brief overview of what it's like to use Markdown.
|
153
|
+
The [syntax page] [s] provides complete, detailed documentation for
|
154
|
+
every feature, but Markdown should be very easy to pick up simply by
|
155
|
+
looking at a few examples of it in action. The examples on this page
|
156
|
+
are written in a before/after style, showing example syntax and the
|
157
|
+
HTML output produced by Markdown.
|
158
|
+
|
159
|
+
It's also helpful to simply try Markdown out; the [Dingus] [d] is a
|
160
|
+
web application that allows you type your own Markdown-formatted text
|
161
|
+
and translate it to XHTML.
|
162
|
+
|
163
|
+
**Note:** This document is itself written using Markdown; you
|
164
|
+
can [see the source for it by adding '.text' to the URL] [src].
|
165
|
+
|
166
|
+
[s]: /projects/markdown/syntax "Markdown Syntax"
|
167
|
+
|
168
|
+
[d]: /projects/markdown/dingus "Markdown Dingus"
|
169
|
+
|
170
|
+
[src]: /projects/markdown/basics.text
|
171
|
+
html: |
|
172
|
+
<p>This page offers a brief overview of what it's like to use Markdown.
|
173
|
+
The <a href="/projects/markdown/syntax" title="Markdown Syntax">syntax page</a> provides complete, detailed documentation for
|
174
|
+
every feature, but Markdown should be very easy to pick up simply by
|
175
|
+
looking at a few examples of it in action. The examples on this page
|
176
|
+
are written in a before/after style, showing example syntax and the
|
177
|
+
HTML output produced by Markdown.</p>
|
178
|
+
|
179
|
+
<p>It's also helpful to simply try Markdown out; the <a href="/projects/markdown/dingus" title="Markdown Dingus">Dingus</a> is a
|
180
|
+
web application that allows you type your own Markdown-formatted text
|
181
|
+
and translate it to XHTML.</p>
|
182
|
+
|
183
|
+
<p><strong>Note:</strong> This document is itself written using Markdown; you
|
184
|
+
can <a href="/projects/markdown/basics.text">see the source for it by adding '.text' to the URL</a>.</p>
|