介绍markdown所支持的扩展语法:数学公式,流程图,序列图,甘特图,饼图,折线图,柱状图,条形图等语法。有些语法部分markdown编辑器并不能识别,通用性较少,且为方言版本,仅供参考。
LaTeX
。$
包含特定的数学语法。关于更多LaTex语法可查看:
https://www.latex-project.org/
```mermaid
graph TD;
A-->B;
B-->C;
```
```mermaid
sequenceDiagram
A->> B: 吃饭了吗?
B->> A: 刚吃完饭了。
```
```mermaid
gantt
title 甘特图
dateFormat YYYY-MM-DD
section 项目A
任务1 :a1, 2019-01-01, 150d
任务2 :after a1, 30d
section 项目B
任务3 :2019-02-01, 60d
任务4 :30d
```
关于更多mermaid语法可查看:
https://knsv.github.io/mermaid/
一些支持mermaid语法的编辑器:
```chart
,Budget,Income,Expenses,Debt
June,5000,8000,4000,6000
July,3000,1000,4000,3000
Aug,5000,7000,6000,3000
Sep,7000,2000,3000,1000
Oct,6000,5000,4000,2000
Nov,4000,3000,5000,
type: pie
title: Monthly Revenue
x.title: Amount
y.title: Month
y.suffix: $
```
```chart
,Budget,Income,Expenses,Debt
June,5000,8000,4000,6000
July,3000,1000,4000,3000
Aug,5000,7000,6000,3000
Sep,7000,2000,3000,1000
Oct,6000,5000,4000,2000
Nov,4000,3000,5000,
type: line
title: Monthly Revenue
x.title: Amount
y.title: Month
y.suffix: $
```
```chart
,Budget,Income,Expenses,Debt
June,5000,8000,4000,6000
July,3000,1000,4000,3000
Aug,5000,7000,6000,3000
Sep,7000,2000,3000,1000
Oct,6000,5000,4000,2000
Nov,4000,3000,5000,
type: column
title: Monthly Revenue
x.title: Amount
y.title: Month
y.suffix: $
```
```chart
,Budget,Income,Expenses,Debt
June,5000,8000,4000,6000
July,3000,1000,4000,3000
Aug,5000,7000,6000,3000
Sep,7000,2000,3000,1000
Oct,6000,5000,4000,2000
Nov,4000,3000,5000,
type: bar
title: Monthly Revenue
x.title: Amount
y.title: Month
y.suffix: $
```
注意:目前已知支持软件印象笔记。
---
包含表格内容;:
区分;注意:只能在文件开头处使用。
示例1:
---
title: Hello world
date: 2019-01-01
tags: 文章
---
示例2:
---
title: Hello world
date: 2019-01-01
tags:
- 文章
- 随笔
---
示例:
<!--注释内容-->
示例:
````markdown
```cpp
int main()
{
}
```
````
效果:
```cpp
int main()
{
}
```