流程圖的語法大體分為兩段悯嗓,第一段用來定義元素拒迅,第二段用來連接元素
定義元素
tag=>type: content:>url
tag:就是一個標(biāo)簽骚秦,在第二段連接元素時用
type:是這個標(biāo)簽的類型她倘,從上段內(nèi)容看有6中類型,非別為:
start
end
operation
subroutine
condition
inputoutput
content:流程語句中放置的內(nèi)容
? 注意: type:與content之間一定要有一個空格作箍,否則會出問題硬梁!
url:鏈接,與流程語句綁定
連接元素
使用->符號胞得,如:
c2(yes)->io->e
c2(no)->op2->e
代碼塊
Markdown使用flow定義流程圖的代碼塊
測試
st=>start: Start|past:>http://blog.xiaoyulive.top
e=>end: End:>http://www.xiaoyulive.top
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes or No?|approved:>https://github.com/quanzaiyu
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
st=>start: start:>http://www.baidu.com
op1=>operation: 操作1
cond1=>condition: YES or NO?
sub=>subroutine: 子程序
e=>end
st->op1->cond1
cond1(yes)->e
cond1(no)->sub(right)->op1
st=>start: Start|past:>http://www.baidu.com
e=>end: Ende|future:>http://www.baidu.com
op1=>operation: My Operation
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes or No|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|future
st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
st=>start: Start
i=>inputoutput: 輸入年份n
cond1=>condition: n能否被4整除荧止?
cond2=>condition: n能否被100整除?
cond3=>condition: n能否被400整除懒震?
o1=>inputoutput: 輸出非閏年
o2=>inputoutput: 輸出非閏年
o3=>inputoutput: 輸出閏年
o4=>inputoutput: 輸出閏年
e=>end
st->i->cond1
cond1(no)->o1->e
cond1(yes)->cond2
cond2(no)->o3->e
cond2(yes)->cond3
cond3(yes)->o2->e
cond3(no)->o4->e