raghur / mermaid-filter

Pandoc filter for creating diagrams in mermaid syntax blocks in markdown docs
432 stars 75 forks source link

Support SVG->EPS conversion #7

Open priiduonu opened 7 years ago

priiduonu commented 7 years ago

Would be nice, if mermaid-filter supported generating EPS files.

  1. mermaid can output SVG (although some diagram types are not rendered correctly)
  2. Inkscape could be used for converting the SVG files to EPS files
  3. EPS files can be used by PanDoc for generating PDF output with diagrams included

I tried and it works, put something like

var epsPath = path.join(outdir, `${prefix}-${counter}.eps`);
...
exec(`inkscape --export-eps=${epsPath} ${newPath}`);

before the function return

You can probably do it better.

raghur commented 7 years ago

Thanks for the suggestion - however, I don't use EPS at all and know little about it.. would you be willing to send a PR?

tewarid commented 6 years ago

pandoc can convert mermaidjs svg output to pdf using rsvg2pdf.