markdown流程圖語法


從網上找了非常久關於markdown語法的文章。機會微乎其微。大多所指向的都是同一個頁面https://github.com/adrai/flowchart.js
這是github上的一個開源項目,里面對我實用的僅僅有一小段文字

st=>start: Start|past:>http://www.google.com[blank]
e=>end: End:>http://www.google.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

由於牆的原因,也沒法找到什么實用的外文資料,僅僅能總結一下此段代碼里面的語法了。


流程圖的語法大體分為兩段,第一段用來定義元素,第二段用來連接元素
定義元素階段的語法是
tag=>type: content:>url
tag就是一個標簽。在第二段連接元素時用
type是這個標簽的類型。從上段內容看有6中類型,非別為:

start
end
operation
subroutine
condition
inputoutput

content就是在框框中要寫的內容。中英文均可,但有一點須要特別注意,就是type后的冒號與文本之間一定要有個空格。沒空格會出問題。
url就是一個連接,與框框中的文本相綁定

連接元素階段的語法就簡單多了。直接用->來連接兩個元素,須要注意的是condition類型,由於他有yes和no兩個分支,所以要寫成

c2(yes)->io->e
c2(no)->op2->e

這種格式。
以下為顯示情況

Created with Raphaël 2.1.2 Start My Operation Yes or No? Good idea catch something... End Stuff My Subroutine yes no yes no

假設IE瀏覽器顯示不好,能夠使用chrome試試。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM