Skip to main content

Pandoc filter to allow file inplace includes

Project description

The Pandoc Inplace Include Filter

This is a repo that provides a pandoc filter to include files in a markdown file. This filter does not replace the !include or {include} directives directly in the markdown file, but instead uses a <div> tag with a class="include" attribute. This allows to keep the import relations of the source files, while still being able to include them in the same markdown file, and invariant of running pandoc commands on the same file if the sources are not changed.

Installation

pip install pandoc-inplace-include

Inflate me with

pandoc README.md -o README.md --filter pandoc-inplace-include

Test me with

pandoc README.md -o README.1.md --filter include_filter.py
pandoc README.1.md -o README.2.md --filter include_filter.py
diff README.1.md README.2.md

Supported syntax

<div class="include" file="some.other.md.file.md" start="starting_line_num" end="ending_line_num">
All the contents within such <div> will be replaced by the contents of the file "some.other.md.file.md"
</div>

To be added

  • Support for recursive includes

Now try to include some files

The <div> stuff should not be rendered, but only kept in the source file.

This part will be replaced after running `pandoc`

Other things below won't get replaced.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandoc_inplace_include-0.0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file pandoc_inplace_include-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pandoc_inplace_include-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d7d3c2fa5e81510f6679e89b45be97b8772af43a0b4aa619ac9a1c063bb92a12
MD5 bd99ca74a87f8ec0a7d2343349e050b2
BLAKE2b-256 c0b18a05abbf5172411e6cd0259d18148e460844a7bcb85c6c1d71e692fdfc9a

See more details on using hashes here.

Supported by

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