Skip to content

Latest commit

 

History

History

rehype-mermaid

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

@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.