跳转至

Markdown代码高亮

行内代码高亮

依赖模块: pymdownx.inlinehilite

Bash
`code`

code

区块代码高亮

依赖模块: codehilite

写法1: 3个`

Python
text = "Hello, world!"
print text

写法2: 4个空格+shebang

Text Only
1
2
3
#!/usr/bin/python
text = "Hello, world!"
print text

指定第几行背景高亮

hl_lines="2"

Python
1
2
3
text1 = "Hello, "
text2 = "world!"
print text1 + text2

指定行号从多少开始编号

linenums="2"

Python
2
3
4
text1 = "Hello, "
text2 = "world!"
print text1 + text2