目的
總結(jié)對(duì)標(biāo)準(zhǔn)的Markdown語(yǔ)法增強(qiáng)部分
GFM
-
單詞中的含有下劃線時(shí),GFM 會(huì)忽略,不轉(zhuǎn)換成斜體
示例:
wow_great_stuff
若將字符串中的某個(gè)單詞變成斜體,則可以使用*
wow*great*stuff效果:
wow_great_stuff
wowgreatstuff 自動(dòng)識(shí)別URL連接
示例:
http://example.com
效果:
http://example.com刪除線
示例:
~~Mistaken text.~~
效果:
Mistaken text.-
代碼段每行使用4個(gè)空格,標(biāo)準(zhǔn)MD會(huì)自動(dòng)識(shí)別為代碼段,GFM也支持這樣的語(yǔ)法
同時(shí)GFM還設(shè)計(jì)了一種優(yōu)化語(yǔ)法,就是在代碼段頭尾行使用 `
還支持語(yǔ)言標(biāo)識(shí)示例:
```javascript function test() { console.log("notice the blank line before this function?"); } ```效果:
function test() { console.log("notice the blank line before this function?"); } -
Task列表
GFM 支持把列表變成帶勾選的任務(wù)列表
- 基本列表
示例:
- [ ] a task list item - [ ] list syntax required - [ ] normal **formatting**, @mentions, #1234 refs - [ ] incomplete - [x] commplete效果:
示例1.png- 嵌套列表
示例2:
- [ ] a bigger project - [ ] first subtask #1234 - [ ] follow up subtask #4321 - [ ] final subtask cc @mention - [ ] a separate task效果:
示例2.png -
添加表情
GFM支持天假emoji表情,輸入不同的符號(hào)碼表示不同的表情
示例:
:blush: :joy: :grinning:效果:

- 支持表格
基本:
示例:
First Header | Second Header -------------|-------------- Content Cell | Content Cell Content Cell | Content Cell
效果:
| First Header | Second Header |
|---|---|
| Content Cell | Content Cell |
| Content Cell | Content Cell |
可以在兩邊都加豎線:
示例:
| First Header | Second Header | | ------------- | ------------- | | Content Cell | Content Cell | | Content Cell | Content Cell |
效果:
| First Header | Second Header |
|---|---|
| Content Cell | Content Cell |
| Content Cell | Content Cell |
可以不對(duì)齊:
示例:
```
| Name | Description |
| ------------- | ----------- |
| Help | ~~Display the~~ help window.|
| Close | _Closes_ a window |
```
效果:
| Name | Description |
|---|---|
| Help |
|
| Close | Closes a window |
可以定義表格中文字對(duì)齊方式:
示例:
| Left-Aligned | Center Aligned | Right Aligned | | :------------ |:---------------:| -----:| | col 3 is | some wordy text | $1600 | | col 2 is | centered | $12 | | zebra stripes | are neat | $1 |
效果:
| Left-Aligned | Center Aligned | Right Aligned |
|---|---|---|
| col 3 is | some wordy text | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
支持在表格中嵌入圖片
示例:
| 圖片|描述| | ------------ |---------------| | http://img4.duitang.com/uploads/item/201508/19/20150819131018_vYPyR.thumb.224_0.png | Overload 森林賢王——倉(cāng)助 |
效果:
| 圖片 | 描述 |
|---|---|
倉(cāng)助
|
Overload 森林賢王——倉(cāng)助 |
參考1: https://help.github.com/articles/writing-on-github/
參考2 : https://help.github.com/articles/github-flavored-markdown/

