1.0.0 • Published 7 years ago
@wrhs/diagrams v1.0.0
@wrhs/diagrams
Utility to generate consistent Mermaid diagrams for Warehouse.ai modules.
Install
npm install @wrhs/diagrams --save-devUsage
The easiest way to use this tool is by adding an npm command to the
consuming module's package.json
"scripts": {
"diagrams": "wrhs-diagrams --source=./docs/diagrams --target=./docs --theme=forest"
...
},This command can then be used from the consuming module by running
npm run diagramsAPI
The tool uses puppeteer with Mermaid's API to generate svg's from
the .mmd diagram definitions. canihaz will install Puppeteer
the first time this tool is used. It only has a single command,
but it supports the following flags.
- --source: Relative path to directory with
.mmdsource files, defaults to./diagrams. - --target: Relative path to directory to store
.pngoutput files, defaults to./assets. - --file: Relative path to source files
--file one.mmd --file two.mmd. - --theme: Theme to be used for diagram styling, defaults to
forest.
Note: If you need to assert the HTML used in Puppeteer to generate the
chart set DEBUG=true to have the script output both an .png and .html
file.
Test
npm test1.0.0
7 years ago