Skip to main content

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.

Metadata

Release files for pandoc-inplace-include 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pandoc-inplace-include 0.0.2
File Interpreter ABI Platform
pandoc_inplace_include-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / pandoc_inplace_include-0.0.2-py3-none-any.whl

Download URL pandoc_inplace_include-0.0.2-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91b3fb41c2dfeb37ee43447dbd83571d1d4a83f33fc57ea1ad264b99e7977908
BLAKE2b-256 checksum
How to use checksums
e0e8042732b7de08b6d33ef5d4a772a08d03e00418283cd41cb826b809a53640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page