1.2.0-patch • Published 3 years ago
@maxam2017/mdx-mermaid v1.2.0-patch
mdx-mermaid
Plug and play Mermaid in MDX
Use Mermaid in .md, .mdx, .jsx and .tsx files with ease.
Based off the answer here by unknown.
Quick start with Docusaurus
Install mdx-mermaid and mermaid
mermaid is a peer dependency so you can specify the version to use
yarn add mdx-mermaid mermaidUpdate docusaurus.config.js
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
remarkPlugins: [import('mdx-mermaid')],Use code blocks in .md or .mdx files:
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```Use the component in .mdx, .jsx or .tsx files:
import { Mermaid } from 'mdx-mermaid/Mermaid';
<Mermaid chart={`graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
`} />There are more examples here
License
1.2.0-patch
3 years ago
1.2.0
3 years ago