` tag. 237 | 238 | + Fix for horizontal rules preceded by 2 or 3 spaces. 239 | 240 | + `
` tags.
256 |
257 | + You can now write empty links:
258 |
259 | [like this]()
260 |
261 | and they'll be turned into anchor tags with empty href attributes.
262 | This should have worked before, but didn't.
263 |
264 | + `***this***` and `___this___` are now turned into
265 |
266 | this
267 |
268 | Instead of
269 |
270 | this
271 |
272 | which isn't valid. (Thanks to Michel Fortin for the fix.)
273 |
274 | + Added a new substitution in `_EncodeCode()`: s/\$/$/g; This
275 | is only for the benefit of Blosxom users, because Blosxom
276 | (sometimes?) interpolates Perl scalars in your article bodies.
277 |
278 | + Fixed problem for links defined with urls that include parens, e.g.:
279 |
280 | [1]: http://sources.wikipedia.org/wiki/Middle_East_Policy_(Chomsky)
281 |
282 | "Chomsky" was being erroneously treated as the URL's title.
283 |
284 | + At some point during 1.0's beta cycle, I changed every sub's
285 | argument fetching from this idiom:
286 |
287 | my $text = shift;
288 |
289 | to:
290 |
291 | my $text = shift || return '';
292 |
293 | The idea was to keep Markdown from doing any work in a sub
294 | if the input was empty. This introduced a bug, though:
295 | if the input to any function was the single-character string
296 | "0", it would also evaluate as false and return immediately.
297 | How silly. Now fixed.
298 |
299 |
300 |
301 | Donations
302 | ---------
303 |
304 | Donations to support Markdown's development are happily accepted. See:
305 | 声明: 这份文档派生(fork)于繁体中文版,在此基础上进行了繁体转简体工作,并进行了适当的润色。此文档用 Markdown 语法编写,你可以到这里查看它的源文件。「繁体中文版的原始文件可以查看这里」--By @riku / 本项目托管于 GitCafe 注: 本项目同时也托管于 Github上,请通过 fork+pull request 方式来帮忙改进本项目。 此页提供了 Markdown 的简单概念, 语法说明 页提供了完整详细的文档,说明了每项功能。但是 Markdown 其实很简单就可以上手,此页文档提供了一些范例,并且每个范例都会提供输出的 HTML 结果。 其实直接试试看也是一个很不错的方法, Dingus 是一个网页应用程序,你可以把自已编写的 Markdown 文档转成 XHTML。 一个段落是由一个以上的连接的行句组成,而一个以上的空行则会划分出不同的段落(空行的定义是显示上看起来像是空行,就被视为空行,例如有一行只有空白和 tab,那该行也会被视为空行),一般的段落不需要用空白或换行缩进。 Markdown 支持两种标题的语法,Setext 和 atx 形式。Setext 形式是用底线的形式,利用 区块引用则使用 email 形式的 ' Markdown 语法: 输出 HTML 为: Markdown 使用星号和底线来标记需要强调的区段。 Markdown 语法: 输出 HTML 为: 无序列表使用星号、加号和减号来做为列表的项目标记,这些符号是都可以使用的,使用星号: 加号: 和减号 都会输出 HTML 为: 有序的列表则是使用一般的数字接着一个英文句点作为项目标记: 输出 HTML 为: 如果你在项目之间插入空行,那项目的内容会用 输出 HTML 为: Markdown 支援两种形式的链接语法: 行内 和 参考 两种形式,两种都是使用角括号来把文字转成连结。 行内形式是直接在后面用括号直接接上链接: 输出 HTML 为: 你也可以选择性的加上 title 属性: 输出 HTML 为: 参考形式的链接让你可以为链接定一个名称,之后你可以在文件的其他地方定义该链接的内容: 输出 HTML 为: title 属性是选择性的,链接名称可以用字母、数字和空格,但是不分大小写: 输出 HTML 为: 图片的语法和链接很像。 行内形式(title 是选择性的): 参考形式: 上面两种方法都会输出 HTML 为: 在一般的段落文字中,你可以使用反引号 输出 HTML 为: 如果要建立一个已经格式化好的代码区块,只要每行都缩进 4 个空格或是一个 tab 就可以了,而 Markdown 语法: 输出 HTML 为: 声明: 这份文档派生(fork)于繁体中文版,在此基础上进行了繁体转简体工作,并进行了适当的润色。此文档用 Markdown 语法编写,你可以到这里查看它的源文件。「繁体中文版的原始文件可以查看这里」--By @riku / 本项目托管于 GitCafe 注: 本项目同时也托管于 Github上,请通过 fork+pull request 方式来帮忙改进本项目。 此页提供了 Markdown 的简单概念, 语法说明 页提供了完整详细的文档,说明了每项功能。但是 Markdown 其实很简单就可以上手,此页文档提供了一些范例,并且每个范例都会提供输出的 HTML 结果。 其实直接试试看也是一个很不错的方法, Dingus 是一个网页应用程序,你可以把自已编写的 Markdown 文档转成 XHTML。 一个段落是由一个以上的连接的行句组成,而一个以上的空行则会划分出不同的段落(空行的定义是显示上看起来像是空行,就被视为空行,例如有一行只有空白和 tab,那该行也会被视为空行),一般的段落不需要用空白或换行缩进。 Markdown 支持两种标题的语法,Setext 和 atx 形式。Setext 形式是用底线的形式,利用 区块引用则使用 email 形式的 ' Markdown 语法: 输出 HTML 为: Markdown 使用星号和底线来标记需要强调的区段。 Markdown 语法: 输出 HTML 为: 无序列表使用星号、加号和减号来做为列表的项目标记,这些符号是都可以使用的,使用星号: 加号: 和减号 都会输出 HTML 为: 有序的列表则是使用一般的数字接着一个英文句点作为项目标记: 输出 HTML 为: 如果你在项目之间插入空行,那项目的内容会用 输出 HTML 为: Markdown 支援两种形式的链接语法: 行内 和 参考 两种形式,两种都是使用角括号来把文字转成连结。 行内形式是直接在后面用括号直接接上链接: 输出 HTML 为: 你也可以选择性的加上 title 属性: 输出 HTML 为: 参考形式的链接让你可以为链接定一个名称,之后你可以在文件的其他地方定义该链接的内容: 输出 HTML 为: title 属性是选择性的,链接名称可以用字母、数字和空格,但是不分大小写: 输出 HTML 为: 图片的语法和链接很像。 行内形式(title 是选择性的): 参考形式: 上面两种方法都会输出 HTML 为: 在一般的段落文字中,你可以使用反引号 输出 HTML 为: 如果要建立一个已经格式化好的代码区块,只要每行都缩进 4 个空格或是一个 tab 就可以了,而 Markdown 语法: 输出 HTML 为: Now is the time for all good men to come to
63 | the aid of their country. This is just a
64 | regular paragraph. The quick brown fox jumped over the lazy
66 | dog's back. This is a blockquote. This is the second paragraph in the blockquote. Some of these words are emphasized.
88 | Some of these words are emphasized also. Use two asterisks for strong emphasis.
90 | Or, if you prefer, use two underscores instead. ` 包起来,你也可以在一个项目内放上多个段落,只要在它前面缩排 4 个空白或 1 个 tab 。
135 |
136 | * A list item.
137 | With multiple paragraphs.
138 |
139 | * Another item in the list.
140 |
141 | 输出 HTML 为:
142 |
143 | A list item. With multiple paragraphs. Another item in the list. This is an
159 | example link. This is an
168 | example link. I get 10 times more traffic from Google than from Yahoo or MSN. I start my morning with a cup of coffee and
196 | The New York Times.Markdown: Basics (快速入门) / (点击查看完整语法说明)
17 |
18 | Getting the Gist of Markdown's Formatting Syntax
19 |
20 | 段落、标题、区块代码
25 |
26 | =
(最高阶标题)和 -
(第二阶标题),Atx 形式在行首插入 1 到 6 个 #
,对应到标题 1 到 6 阶。>
' 角括号。
53 |
54 | A First Level Header
35 | ====================
36 | A Second Level Header
37 | ---------------------
38 |
39 | Now is the time for all good men to come to
40 | the aid of their country. This is just a
41 | regular paragraph.
42 |
43 | The quick brown fox jumped over the lazy
44 | dog's back.
45 | ### Header 3
46 |
47 | > This is a blockquote.
48 | >
49 | > This is the second paragraph in the blockquote.
50 | >
51 | > ## This is an H2 in a blockquote
52 |
70 |
71 | <h1>A First Level Header</h1>
57 | <h2>A Second Level Header</h2>
58 | <p>Now is the time for all good men to come to
59 | the aid of their country. This is just a
60 | regular paragraph.</p>
61 | <p>The quick brown fox jumped over the lazy
62 | dog's back.</p>
63 | <h3>Header 3</h3>
64 | <blockquote>
65 | <p>This is a blockquote.</p>
66 | <p>This is the second paragraph in the blockquote.</p>
67 | <h2>This is an H2 in a blockquote</h2>
68 | </blockquote>
69 |
修辞和强调
72 |
73 |
82 |
83 | Some of these words *are emphasized*.
78 | Some of these words _are emphasized also_.
79 | Use two asterisks for **strong emphasis**.
80 | Or, if you prefer, __use two underscores instead__.
81 |
90 |
91 | <p>Some of these words <em>are emphasized</em>.
86 | Some of these words <em>are emphasized also</em>.</p>
87 | <p>Use two asterisks for <strong>strong emphasis</strong>.
88 | Or, if you prefer, <strong>use two underscores instead</strong>.</p>
89 |
列表
92 |
93 |
99 |
100 | * Candy.
96 | * Gum.
97 | * Booze.
98 |
106 |
107 | + Candy.
103 | + Gum.
104 | + Booze.
105 |
113 |
114 | - Candy.
110 | - Gum.
111 | - Booze.
112 |
122 |
123 | <ul>
117 | <li>Candy.</li>
118 | <li>Gum.</li>
119 | <li>Booze.</li>
120 | </ul>
121 |
129 |
130 | 1. Red
126 | 2. Green
127 | 3. Blue
128 |
138 |
139 | <ol>
133 | <li>Red</li>
134 | <li>Green</li>
135 | <li>Blue</li>
136 | </ol>
137 |
<p>
包起来,你也可以在一个项目内放上多个段落,只要在它前面缩排 4 个空白或 1 个 tab 。
146 |
147 | * A list item.
142 | With multiple paragraphs.
143 |
144 | * Another item in the list.
145 |
155 |
156 | <ul>
150 | <li><p>A list item.</p>
151 | <p>With multiple paragraphs.</p></li>
152 | <li><p>Another item in the list.</p></li>
153 | </ul>
154 |
链接
157 |
158 |
164 |
165 | This is an [example link](http://example.com/).
163 |
170 |
171 | <p>This is an <a href="http://example.com/">
168 | example link</a>.</p>
169 |
175 |
176 | This is an [example link](http://example.com/ "With a Title").
174 |
181 |
182 | <p>This is an <a href="http://example.com/" title="With a Title">
179 | example link</a>.</p>
180 |
191 |
192 | I get 10 times more traffic from [Google][1] than from
185 | [Yahoo][2] or [MSN][3].
186 |
187 | [1]: http://google.com/ "Google"
188 | [2]: http://search.yahoo.com/ "Yahoo Search"
189 | [3]: http://search.msn.com/ "MSN Search"
190 |
199 |
200 | <p>I get 10 times more traffic from <a href="http://google.com/"
195 | title="Google">Google</a> than from <a href="http://search.yahoo.com/"
196 | title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
197 | title="MSN Search">MSN</a>.</p>
198 |
207 |
208 | I start my morning with a cup of coffee and
203 | [The New York Times][NY Times].
204 |
205 | [ny times]: http://www.nytimes.com/
206 |
213 |
214 | <p>I start my morning with a cup of coffee and
211 | <a href="http://www.nytimes.com/">The New York Times</a>.</p>
212 |
图片
215 |
216 |
222 |
223 | 
221 |
229 |
230 | ![alt text][id]
226 |
227 | [id]: /path/to/img.jpg "Title"
228 |
234 |
235 | <img src="/path/to/img.jpg" alt="alt text" title="Title" />
233 |
代码
236 |
237 | `
来标记代码区段,区段内的 &
、<
和 >
都会被自动的转换成 HTML 实体,这项特性让你可以很容易的在代码区段内插入 HTML 码:
244 |
245 | I strongly recommend against using any `<blink>` tags.
240 |
241 | I wish SmartyPants used named entities like `—`
242 | instead of decimal-encoded entites like `—`.
243 |
253 |
254 | <p>I strongly recommend against using any
248 | <code><blink></code> tags.</p>
249 | <p>I wish SmartyPants used named entities like
250 | <code>&mdash;</code> instead of decimal-encoded
251 | entites like <code>&#8212;</code>.</p>
252 |
&
、<
和 >
也一样会自动转成 HTML 实体。
265 |
266 | If you want your page to validate under XHTML 1.0 Strict,
259 | you've got to put paragraph tags in your blockquotes:
260 |
261 | <blockquote>
262 | <p>For example.</p>
263 | </blockquote>
264 |
275 |
276 |
277 | <p>If you want your page to validate under XHTML 1.0 Strict,
269 | you've got to put paragraph tags in your blockquotes:</p>
270 | <pre><code><blockquote>
271 | <p>For example.</p>
272 | </blockquote>
273 | </code></pre>
274 |
Markdown: Basics (快速入门) / (点击查看完整语法说明)
6 |
7 | Getting the Gist of Markdown's Formatting Syntax
8 |
9 | 段落、标题、区块代码
14 |
15 | =
(最高阶标题)和 -
(第二阶标题),Atx 形式在行首插入 1 到 6 个 #
,对应到标题 1 到 6 阶。>
' 角括号。
42 |
43 | A First Level Header
24 | ====================
25 | A Second Level Header
26 | ---------------------
27 |
28 | Now is the time for all good men to come to
29 | the aid of their country. This is just a
30 | regular paragraph.
31 |
32 | The quick brown fox jumped over the lazy
33 | dog's back.
34 | ### Header 3
35 |
36 | > This is a blockquote.
37 | >
38 | > This is the second paragraph in the blockquote.
39 | >
40 | > ## This is an H2 in a blockquote
41 |
59 |
60 | <h1>A First Level Header</h1>
46 | <h2>A Second Level Header</h2>
47 | <p>Now is the time for all good men to come to
48 | the aid of their country. This is just a
49 | regular paragraph.</p>
50 | <p>The quick brown fox jumped over the lazy
51 | dog's back.</p>
52 | <h3>Header 3</h3>
53 | <blockquote>
54 | <p>This is a blockquote.</p>
55 | <p>This is the second paragraph in the blockquote.</p>
56 | <h2>This is an H2 in a blockquote</h2>
57 | </blockquote>
58 |
修辞和强调
61 |
62 |
71 |
72 | Some of these words *are emphasized*.
67 | Some of these words _are emphasized also_.
68 | Use two asterisks for **strong emphasis**.
69 | Or, if you prefer, __use two underscores instead__.
70 |
79 |
80 | <p>Some of these words <em>are emphasized</em>.
75 | Some of these words <em>are emphasized also</em>.</p>
76 | <p>Use two asterisks for <strong>strong emphasis</strong>.
77 | Or, if you prefer, <strong>use two underscores instead</strong>.</p>
78 |
列表
81 |
82 |
88 |
89 | * Candy.
85 | * Gum.
86 | * Booze.
87 |
95 |
96 | + Candy.
92 | + Gum.
93 | + Booze.
94 |
102 |
103 | - Candy.
99 | - Gum.
100 | - Booze.
101 |
111 |
112 | <ul>
106 | <li>Candy.</li>
107 | <li>Gum.</li>
108 | <li>Booze.</li>
109 | </ul>
110 |
118 |
119 | 1. Red
115 | 2. Green
116 | 3. Blue
117 |
127 |
128 | <ol>
122 | <li>Red</li>
123 | <li>Green</li>
124 | <li>Blue</li>
125 | </ol>
126 |
<p>
包起来,你也可以在一个项目内放上多个段落,只要在它前面缩排 4 个空白或 1 个 tab 。
135 |
136 | * A list item.
131 | With multiple paragraphs.
132 |
133 | * Another item in the list.
134 |
144 |
145 | <ul>
139 | <li><p>A list item.</p>
140 | <p>With multiple paragraphs.</p></li>
141 | <li><p>Another item in the list.</p></li>
142 | </ul>
143 |
链接
146 |
147 |
153 |
154 | This is an [example link](http://example.com/).
152 |
159 |
160 | <p>This is an <a href="http://example.com/">
157 | example link</a>.</p>
158 |
164 |
165 | This is an [example link](http://example.com/ "With a Title").
163 |
170 |
171 | <p>This is an <a href="http://example.com/" title="With a Title">
168 | example link</a>.</p>
169 |
180 |
181 | I get 10 times more traffic from [Google][1] than from
174 | [Yahoo][2] or [MSN][3].
175 |
176 | [1]: http://google.com/ "Google"
177 | [2]: http://search.yahoo.com/ "Yahoo Search"
178 | [3]: http://search.msn.com/ "MSN Search"
179 |
188 |
189 | <p>I get 10 times more traffic from <a href="http://google.com/"
184 | title="Google">Google</a> than from <a href="http://search.yahoo.com/"
185 | title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
186 | title="MSN Search">MSN</a>.</p>
187 |
196 |
197 | I start my morning with a cup of coffee and
192 | [The New York Times][NY Times].
193 |
194 | [ny times]: http://www.nytimes.com/
195 |
202 |
203 | <p>I start my morning with a cup of coffee and
200 | <a href="http://www.nytimes.com/">The New York Times</a>.</p>
201 |
图片
204 |
205 |
211 |
212 | 
210 |
218 |
219 | ![alt text][id]
215 |
216 | [id]: /path/to/img.jpg "Title"
217 |
223 |
224 | <img src="/path/to/img.jpg" alt="alt text" title="Title" />
222 |
代码
225 |
226 | `
来标记代码区段,区段内的 &
、<
和 >
都会被自动的转换成 HTML 实体,这项特性让你可以很容易的在代码区段内插入 HTML 码:
233 |
234 | I strongly recommend against using any `<blink>` tags.
229 |
230 | I wish SmartyPants used named entities like `—`
231 | instead of decimal-encoded entites like `—`.
232 |
242 |
243 | <p>I strongly recommend against using any
237 | <code><blink></code> tags.</p>
238 | <p>I wish SmartyPants used named entities like
239 | <code>&mdash;</code> instead of decimal-encoded
240 | entites like <code>&#8212;</code>.</p>
241 |
&
、<
和 >
也一样会自动转成 HTML 实体。
254 |
255 | If you want your page to validate under XHTML 1.0 Strict,
248 | you've got to put paragraph tags in your blockquotes:
249 |
250 | <blockquote>
251 | <p>For example.</p>
252 | </blockquote>
253 |
264 |
--------------------------------------------------------------------------------
/basics.md:
--------------------------------------------------------------------------------
1 | << [访问 Wow!Ubuntu](http://wowubuntu.com)
2 |
3 | **声明:** 这份文档派生(fork)于[繁体中文版](http://markdown.tw/),在此基础上进行了繁体转简体工作,并进行了适当的润色。此文档用 Markdown 语法编写,你可以到这里[查看它的源文件][src1]。「繁体中文版的原始文件可以[查看这里][src]」--By @[riku][t]
4 |
5 | **注:** 本项目托管于 [GitCafe][]上,请通过"派生"和"合并请求"来帮忙改进本项目。
6 |
7 | [src1]:http://gitcafe.com/riku/Markdown-Syntax-CN/blob/master/basics.md
8 | [src]: https://github.com/othree/markdown-syntax-zhtw/blob/master/basics.md
9 | [t]: http://twitter.com/riku
10 | [g]: http://gitcafe.com/riku/Markdown-Syntax-CN
11 | [GitCafe]: http://gitcafe.com/riku/Markdown-Syntax-CN/
12 |
13 | Markdown: Basics (快速入门) / ([点击查看完整语法说明](./index.html))
14 | ================
15 |
16 | Getting the Gist of Markdown's Formatting Syntax
17 | ------------------------------------------------
18 |
19 | 此页提供了 Markdown 的简单概念, [语法说明][s] 页提供了完整详细的文档,说明了每项功能。但是 Markdown 其实很简单就可以上手,此页文档提供了一些范例,并且每个范例都会提供输出的 HTML 结果。
20 |
21 | [s]: http://gitcafe.com/riku/Markdown-Syntax-CN/blob/master/syntax.md "Markdown Syntax"
22 | [d]: http://daringfireball.net/projects/markdown/dingus "Markdown Dingus"
23 |
24 | 其实直接试试看也是一个很不错的方法, [Dingus][d] 是一个网页应用程序,你可以把自已编写的 Markdown 文档转成 XHTML。
25 |
26 | ## 段落、标题、区块代码 ##
27 |
28 | 一个段落是由一个以上的连接的行句组成,而一个以上的空行则会划分出不同的段落(空行的定义是显示上看起来像是空行,就被视为空行,例如有一行只有空白和 tab,那该行也会被视为空行),一般的段落不需要用空白或换行缩进。
29 |
30 | Markdown 支持两种标题的语法,[Setext] [1] 和 [atx] [2] 形式。Setext 形式是用底线的形式,利用 `=` (最高阶标题)和 `-` (第二阶标题),Atx 形式在行首插入 1 到 6 个 `#` ,对应到标题 1 到 6 阶。
31 |
32 | [1]: http://docutils.sourceforge.net/mirror/setext.html
33 | [2]: http://www.aaronsw.com/2002/atx/
34 |
35 | 区块引用则使用 email 形式的 '`>`' 角括号。
36 |
37 | Markdown 语法:
38 |
39 | A First Level Header
40 | ====================
41 | A Second Level Header
42 | ---------------------
43 |
44 | Now is the time for all good men to come to
45 | the aid of their country. This is just a
46 | regular paragraph.
47 |
48 | The quick brown fox jumped over the lazy
49 | dog's back.
50 | ### Header 3
51 |
52 | > This is a blockquote.
53 | >
54 | > This is the second paragraph in the blockquote.
55 | >
56 | > ## This is an H2 in a blockquote
57 |
58 | 输出 HTML 为:
59 |
60 | <p>If you want your page to validate under XHTML 1.0 Strict,
258 | you've got to put paragraph tags in your blockquotes:</p>
259 | <pre><code><blockquote>
260 | <p>For example.</p>
261 | </blockquote>
262 | </code></pre>
263 |
A First Level Header
61 | A Second Level Header
62 | Header 3
68 |
69 |
73 |
74 | ### 修辞和强调 ###
75 |
76 | Markdown 使用星号和底线来标记需要强调的区段。
77 |
78 | Markdown 语法:
79 |
80 | Some of these words *are emphasized*.
81 | Some of these words _are emphasized also_.
82 | Use two asterisks for **strong emphasis**.
83 | Or, if you prefer, __use two underscores instead__.
84 |
85 | 输出 HTML 为:
86 |
87 | This is an H2 in a blockquote
72 |
115 |
119 |
120 | 有序的列表则是使用一般的数字接着一个英文句点作为项目标记:
121 |
122 | 1. Red
123 | 2. Green
124 | 3. Blue
125 |
126 | 输出 HTML 为:
127 |
128 |
129 |
133 |
134 | 如果你在项目之间插入空行,那项目的内容会用 `
144 |
148 | ### 链接 ###
149 |
150 | Markdown 支援两种形式的链接语法: *行内* 和 *参考* 两种形式,两种都是使用角括号来把文字转成连结。
151 |
152 | 行内形式是直接在后面用括号直接接上链接:
153 |
154 | This is an [example link](http://example.com/).
155 |
156 | 输出 HTML 为:
157 |
158 |
216 |
217 | ### 代码 ###
218 | 在一般的段落文字中,你可以使用反引号 `` ` `` 来标记代码区段,区段内的 `&`、`<` 和 `>` 都会被自动的转换成 HTML 实体,这项特性让你可以很容易的在代码区段内插入 HTML 码:
219 |
220 | I strongly recommend against using any `