Skip to content

Mermaid Integration #207

Answered by yhatt
patrickpiresdev asked this question in Q&A
Nov 5, 2021 · 8 comments · 21 replies
Discussion options

You must be logged in to vote

Marp has no built-in integrations for any diagrams like mermaid.js, but you can try to extend Marp engine via compatible markdown-it plugins via if you are using Marp CLI.

// engine.js
module.exports = ({ marp }) => marp.use(require('markdown-it-mermaid'))
marp --engine ./engine.js your-markdown.md

But even if could render, the diagram may not become a reliable one because mermaid.js will misdetect font size in Marp slide (inside SVG <foreignObject>), as pointed out in yhatt/marp#125 (comment) and marp-team/marp-core#139 (comment).

The most reliable way to place a mermaid.js diagram to Marp slide is using Markdown snippet generated by mermaid.live. It puts a diagram as pre-rendered SVG im…

Replies: 8 comments 21 replies

Comment options

You must be logged in to vote
3 replies
@hongvvu
Comment options

@yhatt
Comment options

@hongvvu
Comment options

Answer selected by patrickpiresdev
Comment options

You must be logged in to vote
3 replies
@JamesLarkinWhite
Comment options

@yhatt
Comment options

@pillsilly
Comment options

This comment has been minimized.

Comment options

You must be logged in to vote
2 replies
@yhatt
Comment options

@droctothorpe
Comment options

Comment options

You must be logged in to vote
1 reply
@greyovo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@GuillaumeDesforges
Comment options

@codingluke
Comment options

@codingluke
Comment options

@codingluke
Comment options

@codingluke
Comment options

Comment options

You must be logged in to vote
6 replies
@hakib
Comment options

@codingluke
Comment options

@hakib
Comment options

@codingluke
Comment options

@daviddwlee84
Comment options

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