Pandoc filters basically let you write plugins that can affect the
document conversion. For example, my filter -
mermaid-filter will let you
embed diagrams in text using mermaid
syntax and then when you convert a markdown document, generate a .png
file on the fly, upload it to imgur and embed the link in the generated
HTML file - so that your final HTML shows the image and not a fenced
A quick example - with markdown like this
~~~mermaid graph TD A --> B ~~~
note that you must specify that it’s a mermaid syntax with
as the start of your code block
You get an image like this in your blog:
In fact, even this blog post was generated from mermaid source itself :)
Goes without saying that this isn’t limited to mermaid-filter - you can use any of the other pandoc filters that are available to generate/filter your blog markup!
Hope you like it as much as I do!