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.
Other things below won't get replaced.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pandoc_inplace_include-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pandoc_inplace_include-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91b3fb41c2dfeb37ee43447dbd83571d1d4a83f33fc57ea1ad264b99e7977908
|
|
| MD5 |
3ad4a8c22435bf52a0877a2162cf0f7d
|
|
| BLAKE2b-256 |
e0e8042732b7de08b6d33ef5d4a772a08d03e00418283cd41cb826b809a53640
|