Skip to content

Commit 58659c4

Browse files
committed
Merge pull request #4 from knsv/master
Merge from master
2 parents 6a1550f + 911cd09 commit 58659c4

37 files changed

+4305
-1337
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ bower_components/
33
*.sublime-project
44
*.sublime-workspace
55
.DS_Store
6+
.idea
7+
coverage

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Great that you want to be involved in this project! Contributing is fun and contributions are GREAT! :)
44

5-
This page is currently a starting point is not so rigorous to start with.
5+
This page is currently a starting point and is not so rigorous to start with.
66

77
Some important guidlines:
88

@@ -16,7 +16,7 @@ The issue list and the items marked with **help wanted** is a good starting poin
1616
## Guidelines for avoiding duplicate work
1717

1818
Contributing is great. It is not so fun when you are done with your issue and just before you're about to push your
19-
change you cant because someone else just pushed the same fix so you have wasted your time. The guidelines below are in
19+
change you can't because someone else just pushed the same fix so you have wasted your time. The guidelines below are in
2020
place to prevent this:
2121

2222
* Comment in the issue that you are working on it. You will then be added as an assignee (eventually).

README.md

+50-40
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
mermaid [![Build Status](https://travis-ci.org/knsv/mermaid.svg?branch=master)](https://travis-ci.org/knsv/mermaid) [![Code Climate](https://codeclimate.com/github/knsv/mermaid/badges/gpa.svg)](https://codeclimate.com/github/knsv/mermaid)
23
=======
34

@@ -8,52 +9,61 @@ Ever wanted to simplify documentation and avoid heavy tools like Visio when expl
89
This is why mermaid was born, a simple markdown-like script language for generating charts from text via javascript.
910

1011
The code below would render the following image
11-
12-
```
12+
<table>
13+
<tr><th>Code</th><th>Rendered diagram</th></tr>
14+
<tr><td>
15+
<pre>
16+
<code>
1317
graph TD;
1418
A-->B;
1519
A-->C;
1620
B-->D;
1721
C-->D;
18-
```
19-
20-
would render this lovely chart:
21-
22-
![Example 1](http://www.sveido.com/mermaid/img/ex1.png)
23-
24-
A page with a live example can be seen [here](http://www.sveido.com/mermaid/demo/html/web.html). You can also look at mermaid in action using [jsbin](http://jsbin.com/faxunexeku/1/edit?html,output). If you want a live demo, there is an editor provided in the mermaid project or you can simply look at this [great editor](http://danielmschmidt.github.io/mermaid-demo/)
25-
26-
27-
# [The main documentation is located in the wiki](https://github.com/knsv/mermaid/wiki)
28-
29-
30-
31-
# Another graph example
32-
33-
```
34-
graph LR;
35-
A[Hard edge]-->|Link text|B(Round edge);
36-
B-->C{Decision};
37-
C-->|One|D[Result one];
38-
C-->|Two|E[Result two];
39-
```
40-
41-
Below is the new declaration of the graph which since 0.2.16 also is valid along with the old declaration of the graph as described in the graph example on the home wiki page.
42-
43-
```
44-
graph LR
45-
A[Hard edge] -->|Link text| B(Round edge)
46-
B --> C{Decision}
47-
C -->|One| D[Result one]
48-
C -->|Two| E[Result two]
49-
```
50-
51-
52-
![Example 2](http://www.sveido.com/mermaid/img/ex2.png)
53-
54-
22+
<code>
23+
</pre>
24+
</td>
25+
<td>
26+
<img src='http://www.sveido.com/mermaid/img/ex1.png' alt='Example 1'>
27+
</td>
28+
</tr>
29+
<tr>
30+
<td>
31+
<pre>
32+
<code>
33+
sequenceDiagram
34+
participant Alice
35+
participant Bob
36+
Alice->John: Hello John, how are you?
37+
loop Healthcheck
38+
John->John: Fight against hypochondria
39+
end
40+
Note right of John: Rational thoughts &lt;br/>prevail...
41+
John-->Alice: Great!
42+
John->Bob: How about you?
43+
Bob-->John: Jolly good!
44+
</code>
45+
</pre>
46+
</td>
47+
<td>
48+
<img src='http://www.sveido.com/mermaid/img/seq1.png' alt='Example 2'>
49+
</td>
50+
</tr>
51+
</table>
52+
53+
## Further reading
54+
55+
* [Usage](http://knsv.github.io/mermaid/usage.html)
56+
* [Flowchart syntax](http://knsv.github.io/mermaid/flowchart.html)
57+
* [Sequence diagram syntax](http://knsv.github.io/mermaid/sequenceDiagram.html)
58+
* [Mermaid client](http://knsv.github.io/mermaid/mermaidCLI.html)
59+
* [Demos](http://knsv.github.io/mermaid/demos.html)
5560

5661
# Credits
57-
Many thanks to the [d3](http://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries! Thanks also to the [js-sequence-diagram](http://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams.
62+
Many thanks to the [d3](http://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing
63+
the graphical layout and drawing libraries! Thanks also to the
64+
[js-sequence-diagram](http://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the
65+
sequence diagrams.
5866

5967
*Mermaid was created by Knut Sveidqvist for easier documentation.*
68+
69+
Knut has not done all work by him self, here is the full list of the projects [contributors](https://github.com/knsv/mermaid/graphs/contributors).

bin/mermaid.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env node
2+
3+
var fs = require('fs')
4+
, chalk = require('chalk')
5+
, error = chalk.bold.red
6+
, cli = require('../lib/cli.js')
7+
, lib = require('../lib')
8+
9+
cli.parse(process.argv.slice(2), function(err, message, options) {
10+
if (err) {
11+
console.error(
12+
error('\nYou had errors in your syntax. Use --help for further information.')
13+
)
14+
err.forEach(function (e) {
15+
console.error(e.message)
16+
})
17+
18+
return
19+
}
20+
else if (message) {
21+
console.log(message)
22+
23+
return
24+
}
25+
26+
lib.process(options.files, options)
27+
})

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mermaid",
3-
"version": "0.2.16",
3+
"version": "0.3.2",
44
"authors": [
55
"knsv <knut@sveido.com>"
66
],

0 commit comments

Comments
 (0)