Skip to content

asankah/pandoc-filters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pandoc Filters

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.

Admonitions / Aside

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.md

NOTE: This filter only works when the output format is html5, and not html.

Currently it recognizes the following admonitions: note, warning, important, aside.

Wiki Links

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.md

Block quotes with captions

Emits <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

About

List of useful Pandoc filters.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages