Mermaid for GitBook plugin released
2018-07-25 / modified at 2022-04-04 / 194 words / 1 mins
️This article has been over 2 years since the last update.
Since a lot of plugins for mermaid diagrams are no longer maintained, I just released a new Gitbook plugin with compatibility for GitBook 3.
Features
- Based on mermaid.cli/puppeteer, generate svg with base64 encode at compile time, no external css and js required.
- Same API like gitbook-plugin-mermaid/Typora
How Does it work
1 | 1. Your mermaid string quote with mermaid |
Install
mermaid.cli is based on puppeteer, which need to download a Chrome. to skip download a chrome
in the book.json:
config your chrome exec file
1 | { |
then
1 | # see https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md#environment-variables |
Now we can use a local Chrome Runtime without download the slowly large file from npm.
Please see the full README at gitbook-plugin-mermaid-cli@miao1007