1.1.0 • Published 5 years ago

docute-mermaid v1.1.0

Weekly downloads
9
License
MIT
Repository
-
Last release
5 years ago

docute-mermaid

Using Mermaid in Docute.

Usage

First load this plugin via <script> tag:

<!-- Load these after docute.js -->
<script src="https://cdn.jsdelivr.net/npm/mermaid@8.0.0-rc.8/dist/mermaid.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docute-mermaid@1/dist/index.min.js"></script>

This plugin is exposed as window.docuteMermaid:

new Docute({
  // ...
  plugins: [
    docuteMermaid()
  ]
})

Then you can use code fences to write mermaid code to generate charts:

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```

options

options.initOpts

Options for mermaid.init().

options.evaluateOnly

  • Type: boolean
  • Default: false

Only convert code to chart only when evaluate: true:

```mermaid {evaluate: true}
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```

License

MIT © LEPTOSIA