Giter Club home page Giter Club logo

pandoc-filters's Introduction

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

pandoc-filters's People

Contributors

asankah avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.