markdown-it-mermaid#
mermaidjs renderer for markdown-it.
Demo#
Installation#
node.js#
npm install --save @agoose77/markdown-it-mermaid
or
yarn add @agoose77/markdown-it-mermaid
Usage Examples#
Simple#
import MarkdownIt from "markdown-it";
import mermaidPlugin from "@agoose77/markdown-it-mermaid";
const md = new MarkdownIt().use(mermaidPlugin);
const result = md.render("```mermaid\ngraph TD;\n\tA-->B;```");
Options#
When calling MarkdownIt.use
, an optional second parameter is interpreted as the input
to Mermaid.initialize
:
const md = new MarkdownIt().use(mermaidPlugin, { theme: "forest" });
Changelog#
1.1.0#
Enhancements#
Accepts both GitHub-style
mermaid
and Myst-style{mermaid}
Dependencies#
Update to
markdown-it@13
andmermaid@9
Documentation#
Adds a documentation website
1.0.3#
Maintenance#
Simplify rendering code
0.1.0-a0#
Initial release.
Contributing#
Quick setup#
Ensure
nodejs
is installed
git clone https://github.com/agoose77/markdown-it-mermaid.git
cd markdown-it-mermaid
npm install
# make changes
npm lint
npm build
Building the documentation#
ensure
conda
ormamba
is installedMambaforge is recommended
install the documentation depdendencies
mamba env update docs/environment.yml
mamba activate markdown-it-mermaid
build the documentation
sphinx-build -b html docs build/docs
serve the documentation
python -m http.server -b 127.0.0.1
review the docs at
http://127.0.0.1:8000/build/docs
Releasing#
Make a new issue to track the release process with a checklist like this:
## Release Checklist - [ ] All PRs are merged - [ ] `package.json` was updated to reflect the new version - [ ] `CHANGELOG.md` was updated with the new version's changes - [ ] The `docs` were updated - [ ] The `latest` documentation was verified on ReadTheDocs - [ ] A GitHub Release and Tag were created - [ ] The `.tgz` and `SHA256SUMS` from the latest distribution from GitHub Actions - [ ] The package was publish on `https://npmjs.com`
Complete the checklist
Close the issue
License#
Copyright (c) Angus Hollands
All rights reserved.
Licensed under the MIT license:
http://www.opensource.org/licenses/mit-license.php
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.