Pelican plugin for using the Markdown-Include extension
Project description
Markdown Include: A Plugin for Pelican
This plugin allows the use of the Markdown-Include extension in Pelican articles.
Installation
This plugin can be installed via:
python -m pip install pelican-markdown-include
As long as there is no PLUGINS setting in the Pelican settings file, the newly installed plugin should be detected and enabled automatically. Otherwise, you must add md_include to your existing PLUGINS list. For more information, please refer to the How to Use Plugins documentation.
Usage
The syntax to use in Pelican articles is {!filename!}. According to the documentation of the Markdown-Include extension, this statement will be replaced by the contents of filename and will work recursively. This replacement occurs before any other Markdown processing, so any desired Markdown syntax can be used within the included files. For more details, see the Markdown-Include extension documentation.
Configuration
The following variables control the plugin's behavior and can be configured in the Pelican settings file:
-
MD_INCLUDE_BASE_PATH: By default, the file name is given relative to the directory from which Pelican is run. This can be changed via this variable. -
MD_INCLUDE_ENCODING: The encoding of the included files. Default:"utf-8" -
MD_INCLUDE_INHERIT_HEADING_DEPTH: If set toTrue, increases the headings in the included file by the amount of the previous heading. This option can be combined with theMD_HEADING_OFFSEToption, which is documented below. Default:False -
MD_HEADING_OFFSET: Increases the heading depth by a specific amount, in addition to theMD_INCLUDE_INHERIT_HEADING_DEPTHoption. Default:0
Alternatives to this Plugin
Pelican allows the use of additional Markdown extensions by declaring them in the MARKDOWN configuration variable. However, as explained in the Pelican documentation, adding new extensions via the MARKDOWN setting is cumbersome because it requires explicitly listing all the extensions loaded by default. This plugin provides a “Pelican-ish” way of setting the configuration values of the Markdown-Include extension (base_path, encoding, inherit_heading_depth, and heading_offset), thus avoiding this problem. Furthermore, the Markdown-Include extension must be installed in a place where Pelican can find it, which may be tricky.
Contributing
Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.
To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.
Acknowledgments
Thanks to Justin Mayer for helping with migration of this plugin under the Pelican Plugins organization.
Author
Copyright © 2015, 2021-2024, 2025 Rafael Laboissière (rafael@laboissiere.net)
License
This project is licensed under the terms of the the AGPL-3.0 license.
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
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 pelican_markdown_include-1.0.6.tar.gz.
File metadata
- Download URL: pelican_markdown_include-1.0.6.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b96512ce77293a0b61e574bef9b0e28fc425185ddcff901a348c1129d0c8836e
|
|
| MD5 |
a27ad37b5fdfb858370fea3cc88a788d
|
|
| BLAKE2b-256 |
5c071fc29e440b5a985ed356ceea21694b3c3a301d641b8dfc5decc9bf0728e4
|
Provenance
The following attestation bundles were made for pelican_markdown_include-1.0.6.tar.gz:
Publisher:
main.yml on pelican-plugins/markdown-include
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pelican_markdown_include-1.0.6.tar.gz -
Subject digest:
b96512ce77293a0b61e574bef9b0e28fc425185ddcff901a348c1129d0c8836e - Sigstore transparency entry: 691751816
- Sigstore integration time:
-
Permalink:
pelican-plugins/markdown-include@51cb78ac6426c66e12e2a26b0f3bc1ea097be85d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pelican-plugins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@51cb78ac6426c66e12e2a26b0f3bc1ea097be85d -
Trigger Event:
push
-
Statement type:
File details
Details for the file pelican_markdown_include-1.0.6-py3-none-any.whl.
File metadata
- Download URL: pelican_markdown_include-1.0.6-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c32bd1e8bfa2e938dc097e8a6bd04d07d7d8b71772a30f93cb658dd118e96b2
|
|
| MD5 |
156e36bbf081de5a84d293d889b4ad39
|
|
| BLAKE2b-256 |
44e8b58c0ef068c967d362eb1fd7c28d1b56afc38d178825867efa926df54f3c
|
Provenance
The following attestation bundles were made for pelican_markdown_include-1.0.6-py3-none-any.whl:
Publisher:
main.yml on pelican-plugins/markdown-include
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pelican_markdown_include-1.0.6-py3-none-any.whl -
Subject digest:
7c32bd1e8bfa2e938dc097e8a6bd04d07d7d8b71772a30f93cb658dd118e96b2 - Sigstore transparency entry: 691751821
- Sigstore integration time:
-
Permalink:
pelican-plugins/markdown-include@51cb78ac6426c66e12e2a26b0f3bc1ea097be85d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pelican-plugins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@51cb78ac6426c66e12e2a26b0f3bc1ea097be85d -
Trigger Event:
push
-
Statement type: