简体   繁体   English

Pandoc Markdown - 插入呈现 HTML

[英]Pandoc Markdown - insert rendered HTML

What is an easy solution to insert rendered HTML (no source code) into a Pandoc Markdown or LaTeX file?将呈现的 HTML(无源代码)插入 Pandoc Markdown 或 LaTeX 文件的简单解决方案是什么?

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.我想可视化一个架构图并尝试了 Tikz,但在值得尝试的几天内没有取得太大成功,我认为 HTML 基本上可以做同样的事情,我已经熟悉它了。

Only problem I have, is that I haven't found a good way to import it into Markdown.我唯一的问题是,我还没有找到将它导入 Markdown 的好方法。

What I figured so far:到目前为止我的想法是:

  • PDF seems problematic as you can only insert entrire pages and you don't have labels. PDF 似乎有问题,因为您只能插入整个页面并且没有标签。
  • 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. HTML 和 PDF 是如此不同,以至于图像是将一个带入另一个的最简单方法。 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.在 PDF 中嵌入矢量图像的最佳选择是通过另一个裁剪后的 PDF “图像”,高分辨率 PNG 是次佳选择。 Open source tools like ImageMagick or GIMP can help you with these transformations. ImageMagick 或 GIMP 等开源工具可以帮助您进行这些转换。

My slightly more general advice would be to use Mermaid diagrams in combination with Quarto .我稍微更一般的建议是将美人鱼图与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. Mermaid 是一种非常“Markdown 风格”的绘图方式,并得到 GitHub 等的支持,因此它甚至可以嵌入到 README 文件中。 Quarto is based on pandoc but is more opinionated and has many addons and improvements built on top (including support for diagrams ). Quarto 基于 pandoc,但更加自以为是,并且在其之上构建了许多插件和改进(包括对图表的支持)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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