Hexo博客:markdown 绘制 flowchart 流程图

有道云笔记的 markdown 支持绘制 flowchart 流程图的。基于hexo静态blog也可以,需要手动支持一下。

hexo 目录下安装 npm install --save hexo-filter-flowchart

markdown 编写:

1
2
3
4
5
6
7
8
9
10
11
12
13
###flow  注意使用时需要把 # 替换成 `,末尾同样 
st=>start: start
in=>inputoutput: input
e=>end: end
op=>operation: operation
cond=>condition: condition?
out=>inputoutput: inputoutput

st->in->op->cond
cond(yes)->out
cond(no)->op
out->e
###

再来个列子:

源码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
st=>start: Start|past:>http://www.baidu.com
e=>end: End:>http://www.baidu.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes or No?|approved:>http://www.baidu.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e

更多语法和图例参考:http://flowchart.js.org/