scully-plugin-mermaid - The mermaid
To install this library with
npm i scully-plugin-mermaid --save-dev
Apply the postRenderer plugin via your Scully config file (
/** The options for mermaid will be passed 1:1*/;;;setPluginConfigMermaidPlugin, mermaidOptions;;
By default, you don't need to add any options. The defaults from Mermaid will be used as described in the official docs. You can use any of the described mermaid config parameter.
After running the postRenderer it will convert markdown content like the following into SVG graphics:
```mermaid sequenceDiagram Alice ->> Bob: Hello Bob, how are you? Bob-->>John: How about you John? Bob--x Alice: I am good thanks! Bob-x John: I am good thanks! Note right of John: Some note. Bob-->Alice: Checking with John... Alice->John: Yes... John, how are you? ```
The above example will result in a graphic like this one:
The resulting SVG is wrapped into an HTML
<div> element with the class
mermaid-svg by default.
This can be changed to other elements / classes by adjusting the options.