UNPKG

mermaid

Version:

Markdownish syntax for generating flowcharts, sequence diagrams and gantt charts.

54 lines (53 loc) 3.42 kB
<h1 id="mermaid">mermaid</h1> <p><img src="images/header.png" alt="Alt text"></p> <blockquote> <p>Generation of diagrams and flowcharts from text in a similar manner as markdown.</p> </blockquote> <p>Ever wanted to simplify documentation and avoid heavy tools like Visio when explaining your code?</p> <p>This is why mermaid was born, a simple markdown-like script language for generating charts from text via javascript. <a href="http://knsv.github.io/mermaid/live_editor">Try it using our editor</a>.</p> <p>Code examples below:</p> <h3 id="an-example-of-a-flowchart">An example of a flowchart</h3> <pre class="css"><code>graph TD; A-->B; A-->C; B-->D; C-->D;</code></pre><h3 id="an-example-of-a-sequence-diagram">An example of a sequence diagram</h3> <pre class="css"><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 &lt;br/>prevail... John-->Alice: Great! John->Bob: How about you? Bob-->John: Jolly good!</code></pre><h3 id="example-code-for-a-gantt-diagram">Example code for a gantt diagram</h3> <pre class="css"><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></pre><p>Play with mermaid using this <a href="http://danielmschmidt.github.io/mermaid-demo/">editor</a> or this <a href="live_editor">live editor</a>.</p> <h2 id="further-reading">Further reading</h2> <ul> <li><a href="http://knsv.github.io/mermaid/index.html#usage">Usage</a></li> <li><a href="http://knsv.github.io/mermaid/index.html#flowcharts-basic-syntax">Flowchart syntax</a></li> <li><a href="http://knsv.github.io/mermaid/index.html#sequence-diagrams">Sequence diagram syntax</a></li> <li><a href="http://knsv.github.io/mermaid/index.html#gant-diagrams">Gantt chart syntax</a></li> <li><a href="http://knsv.github.io/mermaid/index.html#flowcharts-basic-syntax">Mermaid client</a></li> <li><a href="http://knsv.github.io/mermaid/live_editor">Editor</a></li> </ul> <h2 id="credits">Credits</h2> <p>Many thanks to the <a href="http://d3js.org/">d3</a> and <a href="https://github.com/cpettitt/dagre-d3">dagre-d3</a> projects for providing<br>the graphical layout and drawing libraries! Thanks also to the<br><a href="http://bramp.github.io/js-sequence-diagrams">js-sequence-diagram</a> project for usage of the grammar for the<br>sequence diagrams.</p> <p><em>Mermaid was created by Knut Sveidqvist for easier documentation.</em></p> <p>Knut has not done all work by himself, here is the full list of the projects <a href="https://github.com/knsv/mermaid/graphs/contributors">contributors</a>.</p>