mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Adds CLI information to the README.
This commit is contained in:
30
README.md
30
README.md
@@ -52,6 +52,36 @@ graph LR
|
||||

|
||||
|
||||
|
||||
# mermaid CLI
|
||||
|
||||
Installing mermaid globally (`npm install -g mermaid`) will expose the `mermaid` command to your environment, allowing you to generate PNGs from any file containing mermaid markup via the command line.
|
||||
|
||||
**Note:** The `mermaid` command requires PhantomJS to be installed and available in your *$PATH*. You can specify it's location with the `-e` option.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
$ mermaid --help
|
||||
|
||||
Usage: mermaid [options] <file>...
|
||||
|
||||
file The mermaid description file to be rendered
|
||||
|
||||
Options:
|
||||
-s --svg Output SVG instead of PNG (experimental)
|
||||
-p --png If SVG was selected, and you also want PNG, set this flag
|
||||
-o --outputDir Directory to save files, will be created automatically, defaults to `cwd`
|
||||
-e --phantomPath Specify the path to the phantomjs executable
|
||||
-h --help Show this message
|
||||
-v --verbose Show logging
|
||||
--version Print version and quit
|
||||
```
|
||||
|
||||
## Known Issues
|
||||
|
||||
- SVG output currently does some replacement on text, as mermaid's SVG output is only appropriate for browsers. Text color and background color is not yet replicated; please use PNGs for most purposes until this is resolved.
|
||||
- SVG output is decidedly non-standard. It works, but may cause issues in some viewers.
|
||||
|
||||
|
||||
# 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.
|
||||
|
Reference in New Issue
Block a user