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.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pandoc_inplace_include-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 91b3fb41c2dfeb37ee43447dbd83571d1d4a83f33fc57ea1ad264b99e7977908
MD5 3ad4a8c22435bf52a0877a2162cf0f7d
BLAKE2b-256 e0e8042732b7de08b6d33ef5d4a772a08d03e00418283cd41cb826b809a53640

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