Markdown流程圖

流程圖的語法大體分為兩段,第一段用來定義元素,第二段用來連接元素

定義元素

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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容