Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to render mermaid diagrams in .md files? #394

Closed
laubonghaudoi opened this issue Feb 28, 2020 · 3 comments
Closed

How to render mermaid diagrams in .md files? #394

laubonghaudoi opened this issue Feb 28, 2020 · 3 comments

Comments

@laubonghaudoi
Copy link

For example I have a file readme.md, which looks like this:

Title

Some texts

Loading
graph LR
    Start --> Stop

Some other texts

Right now the mermaid diagram isn't rendered, it is just rendered as code blocks. How to make it rendered as diagrams?

@ChristianMurphy
Copy link
Member

By using a remark plugin https://github.com/temando/remark-mermaid

@laubonghaudoi
Copy link
Author

By using a remark plugin https://github.com/temando/remark-mermaid

Thanks but this is for remark? Not the react-markdown of this repo.

@ChristianMurphy
Copy link
Member

@laubonghaudoi this project is built on remark, and supports remark plugins.
From the docs:

  • plugins - array An array of unified/remark parser plugins. If you need to pass options to the plugin, pass an array with two elements, the first being the plugin and the second being the options - for instance: {plugins: [[require('remark-shortcodes'), {your: 'options'}]]. (default: []) Note that not all plugins can be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants