This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
learn:mkchart [2017/03/02 11:59] soup |
learn:mkchart [2017/03/03 05:57] (current) soup |
||
---|---|---|---|
Line 7: | Line 7: | ||
PhantomJS是一个无界面的,可脚本编程的WebKit浏览器引擎。 | PhantomJS是一个无界面的,可脚本编程的WebKit浏览器引擎。 | ||
- | mac 安装 | + | ====mac 安装==== |
<code> | <code> | ||
npm install -g mermaid | npm install -g mermaid | ||
Line 13: | Line 13: | ||
</code> | </code> | ||
+ | ====使用==== | ||
term 输入 | term 输入 | ||
mermaid --help | mermaid --help | ||
Line 34: | Line 35: | ||
--version Print version and quit | --version Print version and quit | ||
</code> | </code> | ||
+ | |||
+ | ====时序图例子==== | ||
+ | <code> | ||
+ | sequenceDiagram | ||
+ | participant Alice | ||
+ | participant Bob | ||
+ | Alice->John: Hello John, how are you? | ||
+ | loop Healthcheck | ||
+ | John->John: Fight against hypochondria | ||
+ | end | ||
+ | Note right of John: Rational thoughts <br/>prevail... | ||
+ | John-->Alice: Great! | ||
+ | John->Bob: How about you? | ||
+ | alt good | ||
+ | Bob-->John: Jolly good! | ||
+ | else bad | ||
+ | Bob-->John: Jolly bad! | ||
+ | end | ||
+ | </code> | ||
+ | |||
+ | ====流程图例子==== | ||
+ | <code> | ||
+ | graph LR | ||
+ | A-->B | ||
+ | B-->C | ||
+ | C-->|back|A | ||
+ | D-.->|dot|C | ||
+ | </code> | ||
+ | ====甘特图例子==== | ||
+ | <code> | ||
+ | gantt | ||
+ | dateFormat YYYY-MM-DD | ||
+ | title Adding GANTT diagram functionality to mermaid | ||
+ | section A section | ||
+ | Completed task :done, des1, 2014-01-06,2014-01-08 | ||
+ | Active task :active, des2, 2014-01-09, 3d | ||
+ | Future task : des3, after des2, 5d | ||
+ | Future task2 : des4, after des3, 5d | ||
+ | section Critical tasks | ||
+ | Completed task in the critical line :crit, done, 2014-01-06,24h | ||
+ | Implement parser and jison :crit, done, after des1, 2d | ||
+ | Create tests for parser :crit, active, 3d | ||
+ | Future task in critical line :crit, 5d | ||
+ | Create tests for renderer :2d | ||
+ | Add to mermaid :1d | ||
+ | </code> | ||