Markdown 指南
包含实时示例的完整 Markdown 语法参考指南,涵盖所有支持的 Markdown 语法。
标题
使用 # 符号定义标题。# 符号的数量决定标题级别——一个 # 为 H1,六个 ###### 为 H6。
H1 – H6
语法
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6预览
渲染中...
分隔线
在一行中单独使用三个或更多的连字符、下划线或星号来创建水平分隔线。
Dashes
语法
-----预览
渲染中...
Underscores
语法
_____预览
渲染中...
Asterisks
语法
*****预览
渲染中...
强调
使用星号 (*) 或下划线 (_) 包裹文本来应用粗体、斜体或删除线格式。
Bold
语法
**This is bold text**
__This is bold text__预览
渲染中...
Italic
语法
*This is italic text*
_This is italic text_预览
渲染中...
Strikethrough
语法
~~Strikethrough~~预览
渲染中...
列表
使用 -、+ 或 * 创建无序列表,使用数字创建有序列表。使用制表符或两个空格缩进嵌套列表项。
Unordered list
语法
- Unordered
- Create a list by starting a line with `+`, `-`, or `*`
- list
- With nesting too
- end预览
渲染中...
Ordered list
语法
1. Ordered
2. list
1. With nesting预览
渲染中...
Start numbering with offset
语法
57. foo
1. bar预览
渲染中...
任务列表
使用 GitHub Flavored Markdown 语法创建交互式清单。使用 - [ ] 表示未勾选,使用 - [x] 表示已勾选。
Checkboxes
语法
- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media预览
渲染中...
引用块
使用 > 前缀创建引用块。使用多个 > 符号创建嵌套引用块。
Nested blockquotes
语法
> Blockquotes can also be nested...
>> ...by using additional greater-than signs right next to each other...
> > > ...or with spaces between arrows.预览
渲染中...
代码
使用单个反引号格式化内联代码,使用三个反引号创建代码块。在开头的三个反引号后添加语言名称以启用语法高亮。
Inline code
语法
Inline `code`预览
渲染中...
Code block "fences"
语法
```
Sample text here...
```预览
渲染中...
JavaScript — syntax highlighting
语法
```js
var foo = function (bar) {
return bar++;
};
console.log(foo(5));
```预览
渲染中...
Python — syntax highlighting
语法
```python
def hello(name):
print(f"Hello, {name}!")
hello("World")
```预览
渲染中...
表格
使用管道符 (|) 分隔符构建表格。在分隔行中使用冒号 (:) 控制列对齐方式——左对齐 :---,居中 :---:,右对齐 ---:。
Basic table
语法
| Trial | Result |
|-------|---------|
| 1 | Fail |
| 2 | Fail |
| 3 | Success |预览
渲染中...
Column alignment
语法
| Left | Center | Right |
|:------|:------:|------:|
| Left | Center | Right |
| Align | Column | Data |预览
渲染中...
链接
使用 [文本](URL) 语法创建超链接。
Link text
语法
[Markdown Viewer](https://markdownviewer.cc)预览
渲染中...
图片
使用  语法嵌入图片——与链接语法相同,但以 ! 为前缀。
Basic image
语法
预览
渲染中...
数学公式
使用 MathJax 渲染的 LaTeX 语法编写数学表达式。使用 $...$ 表示行内数学,使用 $$...$$ 表示块级(显示)公式。
Inline math
语法
Einstein's famous equation: $E = mc^2$预览
渲染中...
Block equation
语法
$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$预览
渲染中...
Quadratic formula
语法
$$\frac{-b \pm \sqrt{b^2-4ac}}{2a}$$预览
渲染中...
Matrix
语法
$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$预览
渲染中...