Github Flavored Markdown 的增強(qiáng)部分

目的

總結(jié)對(duì)標(biāo)準(zhǔn)的Markdown語(yǔ)法增強(qiáng)部分

GFM

  1. 單詞中的含有下劃線時(shí),GFM 會(huì)忽略,不轉(zhuǎn)換成斜體

    示例:
    wow_great_stuff
    若將字符串中的某個(gè)單詞變成斜體,則可以使用*
    wow*great*stuff

    效果:
    wow_great_stuff
    wowgreatstuff

  2. 自動(dòng)識(shí)別URL連接
    示例:
    http://example.com
    效果:
    http://example.com

  3. 刪除線
    示例:
    ~~Mistaken text.~~
    效果:
    Mistaken text.

  4. 代碼段每行使用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?");
      }
    
  5. 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
  6. 添加表情

    GFM支持天假emoji表情,輸入不同的符號(hào)碼表示不同的表情

    示例:

    :blush:
    :joy:
    :grinning:
    

    效果:

表情.png
  1. 支持表格

基本:

示例:
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 Display the help window.
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)助
倉(cāng)助
Overload 森林賢王——倉(cāng)助

參考1: https://help.github.com/articles/writing-on-github/
參考2 : https://help.github.com/articles/github-flavored-markdown/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容