简体   繁体   中英

Pandoc Markdown - insert rendered HTML

What is an easy solution to insert rendered HTML (no source code) into a Pandoc Markdown or LaTeX file?

I want to visualize an architecture diagram and tried Tikz but hadn't much success in a days worth trying and I figured HTML essentially can do the same and I am already familiar with it.

Only problem I have, is that I haven't found a good way to import it into Markdown.

What I figured so far:

  • PDF seems problematic as you can only insert entrire pages and you don't have labels.
  • Images would work I guess but I haven't found any native solution

HTML and PDF are so different that images are the easiest way to bring one into the other. The best choice to embed a vector image in PDF is via another, cropped PDF "image", with a high resolution PNG being the second best option. Open source tools like ImageMagick or GIMP can help you with these transformations.

My slightly more general advice would be to use Mermaid diagrams in combination with Quarto . Mermaid is a very 'Markdown-esque' way of drawing diagrams and is supported by GitHub and the like, so it can even be embedded in README files. Quarto is based on pandoc but is more opinionated and has many addons and improvements built on top (including support for diagrams ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM