Browse Source

complete basics.md

pull/1/head
othree 14 years ago
parent
commit
982c5b4756
  1. 28
      basics.md

28
basics.md

@ -219,9 +219,14 @@ Markdown supports two styles for creating links: *inline* and
*reference*. With both styles, you use square brackets to delimit the *reference*. With both styles, you use square brackets to delimit the
text you want to turn into a link. text you want to turn into a link.
Markdown 支援兩種形式的連結語法: *行內**參考* 兩種形式,兩種都是使用角括號
來把文字轉成連結。
Inline-style links use parentheses immediately after the link text. Inline-style links use parentheses immediately after the link text.
For example: For example:
行內形式形式是直接在後面用括號直接接上連結:
This is an [example link](http://example.com/). This is an [example link](http://example.com/).
Output: Output:
@ -231,6 +236,8 @@ Output:
Optionally, you may include a title attribute in the parentheses: Optionally, you may include a title attribute in the parentheses:
你也可以選擇性的加上 title 屬性:
This is an [example link](http://example.com/ "With a Title"). This is an [example link](http://example.com/ "With a Title").
Output: Output:
@ -241,6 +248,8 @@ Output:
Reference-style links allow you to refer to your links by names, which Reference-style links allow you to refer to your links by names, which
you define elsewhere in your document: you define elsewhere in your document:
參考形式的連結讓你可以為連結定一個名稱,之後你可以在文件的其他地方定義該連結的內容:
I get 10 times more traffic from [Google][1] than from I get 10 times more traffic from [Google][1] than from
[Yahoo][2] or [MSN][3]. [Yahoo][2] or [MSN][3].
@ -258,6 +267,8 @@ Output:
The title attribute is optional. Link names may contain letters, The title attribute is optional. Link names may contain letters,
numbers and spaces, but are *not* case sensitive: numbers and spaces, but are *not* case sensitive:
title 屬性是選擇性的,連結名稱可以用字母、數字和空格,但是不分大小寫:
I start my morning with a cup of coffee and I start my morning with a cup of coffee and
[The New York Times][NY Times]. [The New York Times][NY Times].
@ -273,18 +284,26 @@ Output:
Image syntax is very much like link syntax. Image syntax is very much like link syntax.
圖片的語法和連結很像。
Inline (titles are optional): Inline (titles are optional):
行內形式(title 是選擇性的):
![alt text](/path/to/img.jpg "Title") ![alt text](/path/to/img.jpg "Title")
Reference-style: Reference-style:
參考形式:
![alt text][id] ![alt text][id]
[id]: /path/to/img.jpg "Title" [id]: /path/to/img.jpg "Title"
Both of the above examples produce the same output: Both of the above examples produce the same output:
上面兩種方法都會輸出:
<img src="/path/to/img.jpg" alt="alt text" title="Title" /> <img src="/path/to/img.jpg" alt="alt text" title="Title" />
@ -296,6 +315,10 @@ backtick quotes. Any ampersands (`&`) and angle brackets (`<` or
`>`) will automatically be translated into HTML entities. This makes `>`) will automatically be translated into HTML entities. This makes
it easy to use Markdown to write about HTML example code: it easy to use Markdown to write about HTML example code:
在一般的段落文字中,你可以使用反引號 `` ` `` 來標記程式碼區段,區段內的 `&`
、`<` 和 `>` 都會被自動的轉換成 HTML 實體,這項特性讓你可以很容易的在程式碼
區段內插入 HTML 碼:
I strongly recommend against using any `<blink>` tags. I strongly recommend against using any `<blink>` tags.
I wish SmartyPants used named entities like `&mdash;` I wish SmartyPants used named entities like `&mdash;`
@ -303,6 +326,8 @@ it easy to use Markdown to write about HTML example code:
Output: Output:
輸出:
<p>I strongly recommend against using any <p>I strongly recommend against using any
<code>&lt;blink&gt;</code> tags.</p> <code>&lt;blink&gt;</code> tags.</p>
@ -315,6 +340,9 @@ To specify an entire block of pre-formatted code, indent every line of
the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`,
and `>` characters will be escaped automatically. and `>` characters will be escaped automatically.
如果要建立一個已經格式化好的程式碼區塊,只要每行都縮排 4 個空格或是一個 tab
就可以了,而 `&`、`<` 和 `>` 也一樣會自動轉成 HTML 實體。
Markdown: Markdown:
If you want your page to validate under XHTML 1.0 Strict, If you want your page to validate under XHTML 1.0 Strict,

Loading…
Cancel
Save