Useful pandoc filters. Primarily useful for converting Markdown to HTML for blogs and other things.
All the filters are in the filters/ subdirectory. That way you only need to add one directory to your resource-path.
Converts Divs that include specific classes into HTML <aside> elements. For example:
::: note :::
This is a note.
It can contain multiple paragraphs.
::::::Will result in:
<aside class="note">
This is a note.
<p>
It can contain multiple paragraphs.
</aside>Another single-paragraph admonition style is supported:
NOTE: This is a single-paragraph admonition.
This is not a part of the admonition.Use as:
pandoc --resource-path /path/to/pandoc-filters/filters --lua-filter=admonitions.lua -t html my-doc.mdNOTE: This filter only works when the output format is html5, and not html.
Currently it recognizes the following admonitions: note, warning, important, aside.
Converts some Wiki like links so that they will function correctly when used in converted HTML.
Example:
This is a [[Wiki Style]] link.
Also supports [[Links With|Separate Descriptions]] like this one.Converts to:
<p>This is a <a href="Wiki Style.html">Wiki Style</a> link.</p>
<p>Also supports <a href="Links With.html">Separate Descriptions<a/> like this one.</p>Use as:
pandoc --resource-path /path/to/pandoc-filters/filters --lua-filter=wikilinks.lua -t html my-doc.mdEmits <figure> elements for blockquotes that include a citation.
A citation has to start with two dashes (--). If the smart extension
is enabled, then the first dash needs to be escaped.
This is a regular paragraph.
> Blockquotes look like this.
>
> \-- And this is the citation. It has to start with two dashes.Converts to:
<p>This is a regular paragraph.</p>
<blockquote>
<figure>
<p>BLockquotes look like this.</p>
<figcaption>
<p>-- And this is the citation. It has to start with two dashes.</p>
</figcaption>
</figure>
</blockquote>Use as:
pandoc --lua-filter=quotes.lua -t html my-doc.md