Markdown如今做爲寫blog的標記語言愈來愈流行,github和oschina都支持,因而也學習一下。html
#段落、標題、區塊代碼git
一個段落是由一個以上的鏈接的行句組成,而一個以上的空行則會劃分出不一樣的段落(空行的定義是顯示上看起來像是空行,就被視爲空行,例若有一行只有空白和 tab,那該行也會被視爲空行),通常的段落不須要用空白或換行縮進。github
Markdown 支持兩種標題的語法,Setext 和 atx 形式。Setext 形式是用底線的形式,利用 = (最高階標題)和 - (第二階標題),Atx 形式在行首插入 1 到 6 個 # ,對應到標題 1 到 6 階。ubuntu
區塊引用則使用 email 形式的 '>' 角括號。markdown
Markdown 語法:學習
A First Level Header ==================== A Second Level Header --------------------- Now is the time for all good men to come to the aid of their country. This is just a regular paragraph. The quick brown fox jumped over the lazy dog's back. ### Header 3 > This is a blockquote. > > This is the second paragraph in the blockquote. > > ## This is an H2 in a blockquote
顯示效果爲:ui
Now is the time for all good men to come to the aid of their country. This is just a regular paragraph.google
The quick brown fox jumped over the lazy dog's back..net
This is a blockquote.code
This is the second paragraph in the blockquote.
This is an H2 in a blockquote
#修辭和強調
Markdown 使用星號和底線來標記須要強調的區段。
Markdown 語法:
Some of these words *are emphasized*. Some of these words _are emphasized also_. Use two asterisks for **strong emphasis**. Or, if you prefer, __use two underscores instead__.
顯示效果爲:
Some of these words are emphasized. Some of these words are emphasized also. Use two asterisks for strong emphasis. Or, if you prefer, use two underscores instead.
#列表
無序列表使用星號、加號和減號來作爲列表的項目標記,這些符號是均可以使用的,使用星號:
* Candy. * Gum. * Booze.
顯示效果爲:
有序的列表則是使用通常的數字接着一個英文句點做爲項目標記:
1. Red 2. Green 3. Blue
顯示效果爲:
#連接
Markdown 支援兩種形式的連接語法: 行內 和 參考 兩種形式,兩種都是使用角括號來把文字轉成連結。
行內形式是直接在後面用括號直接接上連接:
This is [github](http://github.com/ "github").
顯示效果爲:
This is github.
參考形式的連接讓你能夠爲連接定一個名稱,以後你能夠在文件的其餘地方定義該連接的內容:
I get 10 times more traffic from [Google][1] than from [Yahoo][2] or [MSN][3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search"
顯示效果爲:
I get 10 times more traffic from Google than from Yahoo or MSN.
title 屬性是選擇性的,連接名稱能夠用字母、數字和空格,可是不分大小寫:
#圖片
圖片的語法和連接很像。
行內形式(title 是選擇性的):

顯示效果爲:
#代碼
在通常的段落文字中,你可使用反引號 ` 來標記代碼區段,區段內的 &、< 和 > 都會被自動的轉換成 HTML 實體,這項特性讓你能夠很容易的在代碼區段內插入 HTML 碼:
I strongly recommend against using any `<blink>` tags. I wish SmartyPants used named entities like `—` instead of decimal-encoded entites like `—`.
顯示效果爲:
I strongly recommend against using any <blink>
tags.
I wish SmartyPants used named entities like —
instead of decimal-encoded entites like —
.
若是要創建一個已經格式化好的代碼區塊,只要每行都縮進 4 個空格或是一個 tab 就能夠了,而 &、< 和 > 也同樣會自動轉成 HTML 實體。
Markdown 語法:
If you want your page to validate under XHTML 1.0 Strict, you've got to put paragraph tags in your blockquotes: <blockquote> <p>For example.</p> </blockquote>
顯示效果爲:
If you want your page to validate under XHTML 1.0 Strict, you've got to put paragraph tags in your blockquotes:
<blockquote> <p>For example.</p> </blockquote>
Refers:
本文的Markdown以下:
Markdown如今做爲寫blog的標記語言愈來愈流行,[github][github]和oschina都支持,因而也學習一下。 #段落、標題、區塊代碼 一個段落是由一個以上的鏈接的行句組成,而一個以上的空行則會劃分出不一樣的段落(空行的定義是顯示上看起來像是空行,就被視爲空行,例若有一行只有空白和 tab,那該行也會被視爲空行),通常的段落不須要用空白或換行縮進。 Markdown 支持兩種標題的語法,[Setext][Setext] 和 [atx][atx] 形式。Setext 形式是用底線的形式,利用 = (最高階標題)和 - (第二階標題),Atx 形式在行首插入 1 到 6 個 # ,對應到標題 1 到 6 階。 區塊引用則使用 email 形式的 '>' 角括號。 Markdown 語法: A First Level Header ==================== A Second Level Header --------------------- Now is the time for all good men to come to the aid of their country. This is just a regular paragraph. The quick brown fox jumped over the lazy dog's back. ### Header 3 > This is a blockquote. > > This is the second paragraph in the blockquote. > > ## This is an H2 in a blockquote 顯示效果爲: A First Level Header ==================== A Second Level Header --------------------- Now is the time for all good men to come to the aid of their country. This is just a regular paragraph. The quick brown fox jumped over the lazy dog's back. ### Header 3 > This is a blockquote. > > This is the second paragraph in the blockquote. > > ## This is an H2 in a blockquote #修辭和強調 Markdown 使用星號和底線來標記須要強調的區段。 Markdown 語法: Some of these words *are emphasized*. Some of these words _are emphasized also_. Use two asterisks for **strong emphasis**. Or, if you prefer, __use two underscores instead__. 顯示效果爲: Some of these words *are emphasized*. Some of these words _are emphasized also_. Use two asterisks for **strong emphasis**. Or, if you prefer, __use two underscores instead__. #列表 無序列表使用星號、加號和減號來作爲列表的項目標記,這些符號是均可以使用的,使用星號: * Candy. * Gum. * Booze. 顯示效果爲: * Candy. * Gum. * Booze. 有序的列表則是使用通常的數字接着一個英文句點做爲項目標記: 1. Red 2. Green 3. Blue 顯示效果爲: 1. Red 2. Green 3. Blue #連接 Markdown 支援兩種形式的連接語法: 行內 和 參考 兩種形式,兩種都是使用角括號來把文字轉成連結。 行內形式是直接在後面用括號直接接上連接: This is [github](http://github.com/ "github"). 顯示效果爲: This is [github](http://github.com/ "github"). 參考形式的連接讓你能夠爲連接定一個名稱,以後你能夠在文件的其餘地方定義該連接的內容: I get 10 times more traffic from [Google][1] than from [Yahoo][2] or [MSN][3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search" 顯示效果爲: I get 10 times more traffic from [Google][1] than from [Yahoo][2] or [MSN][3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search" title 屬性是選擇性的,連接名稱能夠用字母、數字和空格,可是不分大小寫: #圖片 圖片的語法和連接很像。 行內形式(title 是選擇性的):  顯示效果爲:  #代碼 在通常的段落文字中,你可使用反引號 ` 來標記代碼區段,區段內的 &、< 和 > 都會被自動的轉換成 HTML 實體,這項特性讓你能夠很容易的在代碼區段內插入 HTML 碼: I strongly recommend against using any `<blink>` tags. I wish SmartyPants used named entities like `—` instead of decimal-encoded entites like `—`. 顯示效果爲: I strongly recommend against using any `<blink>` tags. I wish SmartyPants used named entities like `—` instead of decimal-encoded entites like `—`. 若是要創建一個已經格式化好的代碼區塊,只要每行都縮進 4 個空格或是一個 tab 就能夠了,而 &、< 和 > 也同樣會自動轉成 HTML 實體。 Markdown 語法: If you want your page to validate under XHTML 1.0 Strict, you've got to put paragraph tags in your blockquotes: <blockquote> <p>For example.</p> </blockquote> 顯示效果爲: If you want your page to validate under XHTML 1.0 Strict, you've got to put paragraph tags in your blockquotes: <blockquote> <p>For example.</p> </blockquote> Refers: 1. [http://wowubuntu.com/markdown/basic.html](http://wowubuntu.com/markdown/basic.html) 2. [http://jianshu.io/p/q81RER](http://jianshu.io/p/q81RER) 3. [http://www.ituring.com.cn/article/23](http://www.ituring.com.cn/article/23) 4. [http://www.oschina.net/question/100267_75314](http://www.oschina.net/question/100267_75314) [github]: http://github.com [Setext]: http://docutils.sourceforge.net/mirror/setext.html [atx]: http://www.aaronsw.com/2002/atx/