pandoc-ext / diagram

Generate diagrams from embedded code; supports Mermaid, Dot/GraphViz, PlantUML, Asymptote, CeTZ, and TikZ.
MIT License
90 stars 11 forks source link

mermaid diagram is missing when export html #25

Closed ngocptblaplafla closed 5 months ago

ngocptblaplafla commented 5 months ago

when I export from md to html, mermaid created svg but filter didn't copy it to my directory

tarleb commented 5 months ago

You can set the cache to your current directory, see configuration.

ngocptblaplafla commented 5 months ago

when i set this in metadata,

diagram:
  cache: true
  cache-dir: ./

It wrote image to my working dir but filename was different with html's content

tarleb commented 5 months ago

Ah, I think I understand now: what you want is probably to use pandoc's --extract-media option.

jeremylowery commented 3 months ago

We ran into this also and our issue was that embedding plantuml in our markdown would show up while previewing using quarto preview, but when doing a full quarto render to html and then PDF the assets would not be included.

The fix was to add the following to the configuration in the markdown file.

----
format:
  html:
    extract-media: ../_book/architecture/markdown-name_files/mediabag
---

I'm glad that we got it figured out, but is this really supposed to be the default behavior for this extension?