Markdown里面代碼塊的語法,與原來使用縮進(jìn)來添加代碼塊的語法不同,這里使用 兩條單獨(dú)行的三個(gè)一組的反引號(hào)[```] 來包含多行代碼。在上面的代碼塊語法基礎(chǔ)上,在第一組反引號(hào)之后添加代碼的語言,如 javascript或 js,即可將代碼標(biāo)記為 JavaScript,如圖所示:

代碼塊語法
然后被包含的代碼部分就會(huì)根據(jù)不同的語言進(jìn)行高亮顯示,這樣利于讀者閱讀,下面是一些常用的支持高亮顯示的語言介紹。
| 名稱 | 關(guān)鍵字 | 調(diào)用的js | 說明 |
|---|---|---|---|
| AppleScript | applescript | shBrushAppleScript.js | - |
| ActionScript 3.0 | actionscript3 , as3 | shBrushAS3.js | - |
| Shell | bash , shell | shBrushBash.js | - |
| ColdFusion | coldfusion , cf | shBrushColdFusion.js | - |
| C | cpp , c | shBrushCpp.js | - |
| C# | c# , c-sharp , csharp | shBrushCSharp.js | - |
| CSS | css | shBrushCss.js | - |
| Delphi | delphi , pascal , pas | shBrushDelphi.js | - |
| diff&patch | diff patch | shBrushDiff.js | 用代碼版本庫(kù)時(shí),遇到代碼沖突,其語法就是這個(gè). |
| Erlang | erl , erlang | shBrushErlang.js | - |
| Groovy | groovy | shBrushGroovy.js | - |
| Java | java | shBrushJava.js | - |
| JavaFX | jfx , javafx | shBrushJavaFX.js | - |
| JavaScript | js , jscript , javascript | shBrushJScript.js | - |
| JSON | json | - | - |
| Perl | perl , pl , Perl | shBrushPerl.js | - |
| PHP | php | shBrushPhp.js | - |
| text | text , plain | shBrushPlain.js | 就是普通文本. |
| Python | py , python | shBrushPython.js | - |
| Ruby | ruby , rails , ror , rb | shBrushRuby.js | - |
| SASS&SCSS | sass , scss | shBrushSass.js | - |
| Scala | scala | shBrushScala.js | - |
| SQL | sql | shBrushSql.js | - |
| Visual Basic | vb , vbnet | shBrushVb.js | - |
| XML | xml , xhtml , xslt , html | shBrushXml.js | - |
| Objective C | objc , obj-c | shBrushObjectiveC.js | - |
| F# | f# f-sharp , fsharp | shBrushFSharp.js | - |
| - | xpp , dynamics-xpp | shBrushDynamics.js | - |
| R | r , s , splus | shBrushR.js | - |
| matlab | matlab | shBrushMatlab.js | - |
| swift | swift | shBrushSwift.js | - |
| GO | go , golang | shBrushGo.js | - |