Skip to main content

Render pandoc metadata variables inside the document

Project description

PyPI version

pandoc-jinja

Render pandoc metadata inside the document itself

Example

Write a markdown file, define metadata variable, and use them inside the with double brackets.

---
title: 'Greetings !'
bonjour: 'Hello'
...

## {{ title | upper }}

{{ bonjour }}, {{name}} !

You can also define variable from the command line with --metadata or --metadata-file :

$ pandoc foo.md --filter=pandoc-jinja --metadata=name:world
<h2 id="title">GREETINGS !</h2>
<p>Hello, world !</p>

Disclaimer

  • This filter is slow. In most cases, it is probably more efficient to render the entire document once and for all with jinja and then pass it to pandoc.

  • Jinja conditionals and loops are not supported.

Install

pip install pandoc-jinja

Similar filters

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandoc_jinja-0.2.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

pandoc_jinja-0.2.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pandoc_jinja-0.2.4.tar.gz.

File metadata

  • Download URL: pandoc_jinja-0.2.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for pandoc_jinja-0.2.4.tar.gz
Algorithm Hash digest
SHA256 bffad7c3852fc9ac1d417d2914185f9145c0daff96ae18f52079256956079e0d
MD5 80783a52634fe054c63edbfdc3200a8e
BLAKE2b-256 3f78f34495cc370955f066e645efda66a5ba8994cee860efa4d3f892d6e3c517

See more details on using hashes here.

File details

Details for the file pandoc_jinja-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pandoc_jinja-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 eb324847b83054148b522bebf82f82706915fb072eb04f7b75983f4b2b84166f
MD5 6d68c69c24fc5e7b7b42852359c71a1c
BLAKE2b-256 b917cac19f015aeead2025fde85e5139461ca7c49fec3d29f859e6e6633733e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page