1. 段落、標題、區塊代碼
一級標題
二級標題
三級標題
四級標題
五級標題
六級標題
代碼:
#一級標題
##二級標題
###三級標題
####四級標題
#####五級標題
2.修辭和強調
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__.
3.列表
**無序列表使用星號、加號和減號來做為列表的項目標記,這些符號是都可以使用的; **
星號:
- Candy.
- Gum.
- Booze.
加號:
- Candy.
- Gum.
- Booze.
和減號
- Candy.
- Gum.
- Booze.
* Candy.
* Gum.
* Booze.
+ Candy.
+ Gum.
+ Booze.
- Candy.
- Gum.
- Booze.
有序的列表則是使用一般的數字接著一個英文句點作為項目標記:
- Red
- Green
- Blue
1. Red
2. Green
3. Blue
4.鏈接
Markdown 支援兩種形式的鏈接語法: 行內 和 參考 兩種形式,兩種都是使用角括號來把文字轉成鏈接。
行內形式是直接在后面用括號直接接上鏈接:
This is an example link.
This is an [example link](http://example.com/).
你也可以選擇性的加上 title 屬性:
This is an example link.
This is an [example link](http://example.com/ "With a Title").
參考形式的鏈接讓你可以為鏈接定一個名稱,之后你可以在文件的其他地方定義該鏈接的內容:
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"
[3]: 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"
[3]: http://search.msn.com/ "MSN Search"
title 屬性是選擇性的,鏈接名稱可以用字母、數字和空格,但是不分大小寫:
I start my morning with a cup of coffee and
[The New York Times][NY Times].
[ny times]: http://www.nytimes.com/
I start my morning with a cup of coffee and
[The New York Times][NY Times].
[ny times]: http://www.nytimes.com/
5.圖片
圖片的語法和鏈接很像。
- 行內形式(title 是選擇性的):

- 參考形式:
![Geek.jpg][1]
[1]:http://upload-images.jianshu.io/upload_images/41733-6e5461773b550597.jpg "極客范"
![Geek.jpg][1]
[1]:http://upload-images.jianshu.io/upload_images/41733-
6e5461773b550597.jpg "極客范"
6.代碼
在一般的段落文字中,你可以使用反引號 ` 來標記代碼區段,區段內的 &、< 和 > 都會被自動的轉換成 HTML 實體,這項特性讓你可以很容易的在代碼區段內插入 HTML 碼:
I strongly recommend against using any <blink>
tags.
I wish SmartyPants used named entities like —
instead of decimal-encoded entites like —
.
如果要建立一個已經格式化好的代碼區塊,只要每行都縮進 4 個空格或是一個 tab 就可以了,而 &、< 和 > 也一樣會自動轉成 HTML 實體。
7.其他
>
表示引用
---
表示分界線
Markdown 可以利用反斜杠來插入一些在語法中有其它意義的符號,例如:如果你想要用星號加在文字旁邊的方式來做出強調效果(但不用標簽),你可以在星號的前面加上反斜杠:**
*literal asterisks*
\*literal asterisks\*