Inline plantuml rendering with pandoc
I like the editor Atom1. Although it’s a huge beast, paired withe the
plugin markdown-preview-enhanced
2 for previewing Markdown on-the-fly,
PlantUML3 for rendering various styles of UML diagrams and finally
Pandoc4, for converting Markdown to PDFs, Latex or even Word documents.
When I learned that Microsoft will discontinue Atom5 in favor of VSCode6, I was a tad pisched (though I did the change because the whole toolchain there works the same, so I swallowed the toad).
However, sometimes VSCode or Atom are just way to bloated, and usually I’m just using vi To Get Shit Done™. What I missed was inline rendering of PlantUML diagrams before feeding it to Pandoc.
After some investigation I found pandoc-plantuml-filter
7 which is just doing
was I was looking for. After installing with pip
and simply adding the
--filter plantuml-filter
it worked as expected without any further
complications. The result is exactly as if rendered by Atom or VSCode.
Well, no real-time preview in vi, but whatever.
Update Mon 20 Jun 2022 12:28:40 PM CEST: I added an example.
References
-
Github, “A hackable text editor for the 21st Century,” Atom. https://atom.io/ (accessed Jun. 18, 2022). ↩
-
shd101wyy, “markdown-preview-enhanced,” Atom. https://atom.io/packages/markdown-preview-enhanced (accessed Jun. 18, 2022). ↩
-
Ezoic Inc., “Open-source tool that uses simple textual descriptions to draw beautiful UML diagrams.,” PlantUML.com. https://plantuml.com/ (accessed Jun. 18, 2022). ↩
-
MacFarlane, John, “Pandoc - About pandoc.” https://pandoc.org/ (accessed Jun. 18, 2022). ↩
-
Abhishek, “To Favor Microsoft VS Code, Microsoft’s GitHub is Killing GitHub’s Atom Editor,” It’s FOSS News, Jun. 10, 2022. https://news.itsfoss.com/atom-being-discontinued/ (accessed Jun. 18, 2022). ↩
-
Microsoft, “Visual Studio Code - Code Editing. Redefined.” https://code.visualstudio.com/ (accessed Jun. 18, 2022). ↩
-
T. Furrer, pandoc-plantuml-filter. 2022. Accessed: Jun. 18, 2022. [Online]. Available: https://github.com/timofurrer/pandoc-plantuml-filter ↩