Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 657 Bytes

README.md

File metadata and controls

40 lines (30 loc) · 657 Bytes

@beoe/rehype-mermaid

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
Loading

Usage

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.