dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.76k stars 259 forks source link

Mermaid content does not appear in PDF generated by Prince #653

Open jeffbarr opened 3 years ago

jeffbarr commented 3 years ago

Please select the area your Bug applys to. (Multiple selections are Possible)

Describe the bug

If I include a Mermaid graph in my Markdown, the graph shows up in the preview but not in the PDF.

To Reproduce

Steps to reproduce the behavior:

  1. Open a Markdown file
  2. Define a Mermaid graph (sample below)
  3. View the Dendron preview and confirm that the graph is visible
  4. Right-click on the preview and choose PDF
  5. Open the resulting PDF
  6. Note that the graph is not rendered into the PDF

Sample Mermaid graph

graph TD;
    A-->B;
    A-->C;
    A-->D;
    A-->E;

Expected behavior

Graph is visible

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information)

Additional context

Add any other context about the problem here.

Dendron Log file

Please attach the output of >Dev:Dendron: Open Logs here Untitled-1.log

kevinslin commented 3 years ago

Thanks for the issue, confirmed and repro'd. The preview pdf export is currently a few versions out of date from the most recent Dendron markdown syntax. Will aim to clear some cycles in May to fix this

kevinslin commented 3 years ago

So May might have been ambitious 😅 @jeffbarr apologies for the delays on this, this item is still in our backlog.

I've written up a workaround in the meantime. Let me know if this works as a temporary solution.

The following installs everything on a mac. For other operating systems, you can see references at the bottom

Installation

echo "install pandoc"
brew installpandoc
brew install basictex
echo "install mermaid"
npm install -g @mermaid-js/mermaid-cli
echo "install filter"
pip3 install pandoc-mermaid-filter

Running

pandoc {path/to/src} -o {path/to/dst} --filter pandoc-mermaid

References