Skip to content

Commit

Permalink
Merge pull request #379 from HustLion/master
Browse files Browse the repository at this point in the history
Added class diagram example to README.md
  • Loading branch information
knsv authored Jul 27, 2016
2 parents f9491ef + 3f2cd65 commit 92c7fe9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 22 deletions.
72 changes: 50 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,29 @@ This is why mermaid was born, a simple markdown-like script language for generat

The code below would render the following image
<table>
<tr><th>Code</th><th>Rendered diagram</th></tr>
<tr><td>
<pre>
<code>
<tr><th>Code</th><th>Rendered diagram</th></tr>
<tr>
<td>
<pre>
<code>
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
<code>
</pre>
</td>
<td>
<img src='http://www.sveido.com/mermaid/img/ex1.png' alt='Example 1'>
</td>
</tr>
<tr>
<td>
<pre>
<code>
</code>
</pre>
</td>
<td>
<p align="center">
<img src='http://www.sveido.com/mermaid/img/ex1.png' alt='Example 1'>
</p>
</td>
</tr>
<tr>
<td>
<pre>
<code>
sequenceDiagram
participant Alice
participant Bob
Expand All @@ -43,13 +46,38 @@ sequenceDiagram
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
</code>
</pre>
</td>
<td>
<img src='http://www.sveido.com/mermaid/img/seq1.png' alt='Example 2'>
</td>
</tr>
</code>
</pre>
</td>
<td>
<img src='http://www.sveido.com/mermaid/img/seq1.png' alt='Example 2'>
</td>
</tr>
<tr>
<td>
<pre>
<code>
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
</code>
</pre>
</td>
<td>
<img src='./docs/img/class-diagram.png' alt='Example 3'>
</td>
</tr>
</table>

## Further reading
Expand Down
Binary file added docs/img/class-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92c7fe9

Please sign in to comment.