Markdown基础语法
Contents
标题
Markdown | HTML | Rendered Output |
---|---|---|
# 标题一 | <h1>标题一</h1> | 标题一 |
## 标题二 | <h2>标题二</h2> | 标题二 |
### 标题三 | <h3>标题三</h3> | 标题三 |
#### 标题四 | <h4>标题四</h4> | 标题四 |
##### 标题五 | <h5>标题五</h5> | 标题五 |
###### 标题六 | <h6>标题六</h6> | 标题六 |
段落
Don't put tabs or spaces in front of your paragraphs. Keep lines left-aligned like this.
换行
这是第一行. 这是第二行
这是第一行.
这是第二行
引用
单行引用
Markdown:
> Dorothy followed her through many of the beautiful rooms in her castle.
HTML显示效果:
Dorothy followed her through many of the beautiful rooms in her castle.
多行引用
Markdown:
> Dorothy followed her through many of the beautiful rooms in her castle. > > Dorothy followed her through many of the beautiful rooms in her castle.
HTML显示效果:
Dorothy followed her through many of the beautiful rooms in her castle.
Dorothy followed her through many of the beautiful rooms in her castle.
嵌套引用
Markdown:
> Dorothy followed her through many of the beautiful rooms in her castle. > >> Dorothy followed her through many of the beautiful rooms in her castle.
HTML显示效果:
Dorothy followed her through many of the beautiful rooms in her castle.
Dorothy followed her through many of the beautiful rooms in her castle.
包含其它元素的引用
Markdown:
> #### The quarterly results look great! > > - Revenue was off the chart. > - Profits were higher than ever. > > *Everything* is going according to **plan**.
HTML显示效果:
The quarterly results look great!
- Revenue was off the chart.
- Profits were higher than ever.
Everything is going according to plan.
列表
代码块
普通代码块
Markdown:
```cpp #includeint main(int argc, char *argv[]) { printf("Hello, Hugo"); return 0; } ```
HTML显示效果:
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello, Hugo");
return 0;
}
高亮代码块
Markdown:
```cpp {linenos=table,linenostart=10,hl_lines=[3,"5-7"]} #includeint main(int argc, char *argv[]) { printf("Hello, Hugo"); printf("This is highlight line one"); printf("This is highlight line two"); printf("This is highlight line there"); return 0; } ```
HTML显示效果:
|
|
doubletilde
参考文档: