Rehype plugin to generate Mermaid diagrams in place of code fences. This:
```mermaid
flowchart LR
start --> stop
```
will be converted to
<figure class="beoe mermaid">
<svg>...</svg>
</figure>
which can look like this:
flowchart LR
start --> stop
import rehypeMermaid from "@beoe/rehype-mermaid";
const html = await unified()
.use(remarkParse)
.use(remarkRehype)
.use(rehypeMermaid)
.use(rehypeStringify)
.process(`markdown`);
Online documentation provides more details.