docs: Add docs for Mermaid Component (#9816)

* add docs

* fix: missplace

* Update markdown-features-diagrams.mdx

* yarn format

* fix: correct language

* fix: typo
This commit is contained in:
n4n5 2024-02-02 17:26:07 +01:00 committed by GitHub
parent c1ac06768b
commit 9e5679ff1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 0 deletions

View file

@ -83,3 +83,19 @@ export default {
```
See the [Mermaid config documentation](https://mermaid-js.github.io/mermaid/#/./Setup?id=configuration) and the [Mermaid config types](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts) for the available config options.
## Dynamic Mermaid Component {#component}
To generate dynamic diagrams, you can use the `Mermaid` component:
```mdx title="Example of dynamic Mermaid component"
import Mermaid from '@theme/Mermaid';
<Mermaid
value={`graph TD;
A-->B;
A-->C;
B-->D;
C-->D;`}
/>
```

View file

@ -83,3 +83,19 @@ export default {
```
See the [Mermaid config documentation](https://mermaid-js.github.io/mermaid/#/./Setup?id=configuration) and the [Mermaid config types](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts) for the available config options.
## Dynamic Mermaid Component {#component}
To generate dynamic diagrams, you can use the `Mermaid` component:
```mdx title="Example of dynamic Mermaid component"
import Mermaid from '@theme/Mermaid';
<Mermaid
value={`graph TD;
A-->B;
A-->C;
B-->D;
C-->D;`}
/>
```