As in GitHub Markdown Dialect, to enable syntax highlighting inside code blocks you have to specify the programming language after the first block marker.
An example:
def fibR(n):
if n == 1 or n == 2:
return 1
return fibR(n - 1) + fibR(n - 2)
print fibR(5)
Supported languages for syntax highlighting and their abbreviations:
注意这里跟在后面的应该写破折后后面的简写,如shell 就需要些sh,否则无法响应
- Apache
- C / C++
- C# - csharp
- CoffeeScript - coffee
- CSS
- GO - golang
- HTML
- Java
- Javascript - js
- JSON
- Lua
- Mathlab - mat
- Objective-C - objc
- Perl
- PHP
- Python - py
- R
- Ruby
- Scala - sc
- SCSS
- Shell - sh
- SQL
- Swift
- Tex - latex
- XML