Skip to content

Commit

Permalink
Merge pull request #4 from knsv/master
Browse files Browse the repository at this point in the history
Merge from master
  • Loading branch information
bjowes committed Jan 11, 2015
2 parents 6a1550f + 911cd09 commit 58659c4
Show file tree
Hide file tree
Showing 37 changed files with 4,305 additions and 1,337 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ bower_components/
*.sublime-project
*.sublime-workspace
.DS_Store
.idea
coverage
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

This page is currently a starting point is not so rigorous to start with.
This page is currently a starting point and is not so rigorous to start with.

Some important guidlines:

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

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

* Comment in the issue that you are working on it. You will then be added as an assignee (eventually).
Expand Down
90 changes: 50 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

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)
=======

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

The code below would render the following image

```
<table>
<tr><th>Code</th><th>Rendered diagram</th></tr>
<tr><td>
<pre>
<code>
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```

would render this lovely chart:

![Example 1](http://www.sveido.com/mermaid/img/ex1.png)

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/)


# [The main documentation is located in the wiki](https://github.com/knsv/mermaid/wiki)



# Another graph example

```
graph LR;
A[Hard edge]-->|Link text|B(Round edge);
B-->C{Decision};
C-->|One|D[Result one];
C-->|Two|E[Result two];
```

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.

```
graph LR
A[Hard edge] -->|Link text| B(Round edge)
B --> C{Decision}
C -->|One| D[Result one]
C -->|Two| E[Result two]
```


![Example 2](http://www.sveido.com/mermaid/img/ex2.png)


<code>
</pre>
</td>
<td>
<img src='http://www.sveido.com/mermaid/img/ex1.png' alt='Example 1'>
</td>
</tr>
<tr>
<td>
<pre>
<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>
</td>
<td>
<img src='http://www.sveido.com/mermaid/img/seq1.png' alt='Example 2'>
</td>
</tr>
</table>

## Further reading

* [Usage](http://knsv.github.io/mermaid/usage.html)
* [Flowchart syntax](http://knsv.github.io/mermaid/flowchart.html)
* [Sequence diagram syntax](http://knsv.github.io/mermaid/sequenceDiagram.html)
* [Mermaid client](http://knsv.github.io/mermaid/mermaidCLI.html)
* [Demos](http://knsv.github.io/mermaid/demos.html)

# Credits
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.
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.

*Mermaid was created by Knut Sveidqvist for easier documentation.*

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).
27 changes: 27 additions & 0 deletions bin/mermaid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node

var fs = require('fs')
, chalk = require('chalk')
, error = chalk.bold.red
, cli = require('../lib/cli.js')
, lib = require('../lib')

cli.parse(process.argv.slice(2), function(err, message, options) {
if (err) {
console.error(
error('\nYou had errors in your syntax. Use --help for further information.')
)
err.forEach(function (e) {
console.error(e.message)
})

return
}
else if (message) {
console.log(message)

return
}

lib.process(options.files, options)
})
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mermaid",
"version": "0.2.16",
"version": "0.3.2",
"authors": [
"knsv <knut@sveido.com>"
],
Expand Down
Loading

0 comments on commit 58659c4

Please sign in to comment.