Integrating Mermaid with Pandoc
When converting a markdown file to a pdf file, the mermaid diagram is not rendered. This is because the default pandoc markdown engine does not support mermaid diagrams. The solution is to use a markdown engine that supports mermaid diagrams.
Install mermaid-filter
To render mermaid diagrams, use the mermaid-filter
filter. To install the mermaid-filter
filter, run the following command:
npm i -g mermaid-filter
Assuming you have installed Node.js and npm.
Also, install texlive to render the pdf file:
brew install texlive
Usage
pandoc SAMPLE.md -o SAMPLE.pdf --pdf-engine=xelatex -F mermaid-filter