Add support for mermaid via library

Implementation is largely based on: https://github.com/kovetskiy/mark/pull/167

Co-Authored-By: Manuel Rueger <manuel@rueg.eu>
This commit is contained in:
Dreampuf
2023-04-12 13:43:34 +02:00
committed by Manuel Rüger
parent 88c070f524
commit d9d560eda0
16 changed files with 466 additions and 186 deletions

View File

@@ -553,6 +553,21 @@ And attach any image with the following
The width will be the commented html after the image (in this case 300px).
### Render Mermaid Diagram
Confluence doesn't provide [mermaid.js](https://github.com/mermaid-js/mermaid) support natively. Mark provides a convenient way to enable the feature like [Github does](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/).
As long as you have a code block and are marked as "mermaid", the mark will automatically render it as a PNG image and insert into before the code block.
```mermaid title diagrams_example
graph TD;
A-->B;
```
In order to properly render mermaid, you can choose between the following mermaid providers:
* "mermaid-go" via [mermaid.go](https://github.com/dreampuf/mermaid.go)
* "cloudscript" via [cloudscript-io-mermaid-addon](https://marketplace.atlassian.com/apps/1219878/cloudscript-io-mermaid-addon)
## Installation
### Homebrew