You will need:
This guide is based on Ubuntu, for other OS, use their package manager instead.
sudo apt install pandoc -y
# Assuming you have nodejs and npm installed
# (I have tried with yarn, and failed.)
npm i -g mermaid-filter
pdflatexand font, get it from textlive
sudo apt-get -y install texlive-latex-recommended \
texlive-pictures texlive-latex-extra texlive-fonts-recommended
After everything installed (assume that pandoc and mermaid-filter are
available in your $PATH)
pandoc -F mermaid-filter -o mermaid-pandoc-guide.pdf \
mermaid-pandoc-guide.md
- Pandoc in this setup doens't play well with github code fence. Hence, I intentionally omit that.
- Unlike HTML, PDF has fixed witdh, hence, the code is split in multiple line.
- The chart won't look nice on big screen :(
graph TD;
A-->B;
A-->C;
B-->D;
C

Add these and your chart will be of higher quality.