dendron icon indicating copy to clipboard operation
dendron copied to clipboard

Mermaid content does not appear in PDF generated by Prince

Open jeffbarr opened this issue 4 years ago • 2 comments

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

  • [ ] Onboard. Initial vault setup and import/export pods
  • [ ] Create. Note creation, lookup, snippets and templates
  • [ ] Retrieve. Backlinks, references, graph view
  • [ ] Structure. Refactoring, multi-vault and schemas
  • [ ] Publish. Sharing your repo with the world
  • [X] Misc (Choose this if your not sure)

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)

  • OS: [Windows 10]
  • Browser [Firefox]
  • Version [78.10.0esr]

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

jeffbarr avatar Apr 21 '21 02:04 jeffbarr

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 avatar Apr 21 '21 03:04 kevinslin

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

kevinslin avatar Aug 25 '21 17:08 kevinslin