Skip to content

ickc/pannb

Repository files navigation

pannb—pandoc filter for ipynb

Date: January 25, 2022

Documentation Status image1

GitHub Actions Coverage Status image2 Codacy Badge Scrutinizer Status CodeClimate Quality Status

Supported versions Supported implementations PyPI Wheel PyPI Package latest release GitHub Releases Development Status Downloads Commits since latest release License

Conda Recipe Conda Downloads Conda Version Conda Platforms

Pandoc supports ipynb format. What this does is add support of

  1. jupytext style yaml metadata block
  2. filter out the Python code block
  3. convert raw block to native pandoc AST, e.g.
    • if a cell outputs HTML, then it is an HTML raw block by default, meaning only HTML-like output formats contains these output cells. This filter convert them using pandoc itself to native pandoc AST so that any output formats will contains the same output.

These 3 filters are implemented as 3 individual functions, so that you can cherry-pick your own combinations (See API doc). The command line program pannb have all 3 included.

See `docs/example.ipynb <https://github.com/ickc/pannb/blob/master/docs/example.ipynb>`__ for the input notebook and its output without the filter and output with the filter.

pandoc versioning semantics is MAJOR.MAJOR.MINOR.PATCH and panflute’s is MAJOR.MINOR.PATCH. Below we shows matching versions of pandoc that pannb supports, in descending order. Only major version is shown as long as the minor versions doesn’t matter.

pannb panflute version supported pandoc versions supported pandoc API versions
0.1.2 2.1.3 2.17.x 1.22.1
0.1.1 2.1.3 2.15–2.16.x 1.22–1.22.1
0.1.0 2.1 2.11.2—2.14.x 1.22