Markdown 高级用法 - 流程图

流程图

横向流程图源代码

```mermaid
graph LR

A[正方形] -->B(圆形)-->C(条件框)

C-->|判断| D(允许)

C-->|判断| E(失败)
F[横向流程图]
```

mermaid: 流程图定义标签

graph LR: 流程图方向,其中LR:表示横向,TD:表示竖向

-->:指向线

[]: 正方形框

(): 圆角框

||: 路径上的条件

下面是横向流程图的展示

graph LR

A[正方形] -->B(圆形)-->C(条件框)

C-->|判断| D(允许)

C-->|判断| E(失败)
F[横向流程图]

标准流程图

```flow
st=>start: 开始框
op=>operation: 处理框
cond=>condition: 判断框(Yes/No)
sub1=>subroutine: 子流程
io=>inputoutput: 输入输出
e=>end: 结果
st->op(right)->cond
cond(yes)->io(right)->e
cond(no)->sub1(right)->op
```

flow: 流程图定义标签

start: : 流程图开始定义(分号后必须有空格

cond(yes): cond是条件,括号里只能是yesno

-->:指向线

=>: 写法必须这样

op(right): 表示箭头的方向,rightleft

下面是标准流程图的展示

st=>start: 开始框
op=>operation: 处理框
cond=>condition: 判断框(Yes/No)
sub1=>subroutine: 子流程
io=>inputoutput: 输入输出
e=>end: 结果
st->op(right)->cond
cond(yes)->io(right)->e
cond(no)->sub1(right)->op

更多高级技巧

Markdown 高级技巧 - 菜鸟教程

参考目录

最后修改:2022 年 07 月 07 日
如果觉得我的文章对你有用,请随意赞赏