Overview
Installation
npm install -g diagrams
Usage
Railroad Diagrams
-
Run the following command from your terminal
diagrams railroad inputTextFile example.svg
-
If your inputTextFile's content was this:
Diagram(
Optional('+', 'skip'),
Choice(0,
NonTerminal('name-start char'),
NonTerminal('escape')),
ZeroOrMore(
Choice(0,
NonTerminal('name char'),
NonTerminal('escape'))))
- ...then your
example.svg
should look like this:
Tips & Tricks
Embedding SVGs into Github Markdown
If you host your SVG file somewhere like using Github Pages, you can embed svg diagrams into your markdown files using the following style syntax:
<img src="http://francoislaberge.github.io/diagrams/docs/example.svg">
Credits