From d2513e9b501984c9851a16ee53f5c786f685f427 Mon Sep 17 00:00:00 2001 From: fardog Date: Sat, 20 Dec 2014 17:46:23 -0800 Subject: [PATCH] Adds CLI information to the README. --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index c027212de..4d4117016 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,36 @@ graph LR ![Example 2](http://www.sveido.com/mermaid/img/ex2.png) +# 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 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.