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 you have not explicitly added a PLUGINS
setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add md_include
to your existing PLUGINS
list. For more information, please see the How to Use Plugins documentation.
Usage
The syntax for use within 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. The replacement is done prior to any other Markdown processing, so any Markdown syntax that is wanted can be used within the included files. For more details, see the Markdown-Include extension documentation.
Configuration
The following variables control the behavior of the plugin and can be set in the Pelican settings file:
-
MD_INCLUDE_BASE_PATH
: By default, the file name is given relative to the directory from where 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
: IfTrue
, increases headings on included file by amount of previous heading. Combines withMD_HEADING_OFFSET
option below. Default:False
-
MD_HEADING_OFFSET
: Increases heading depth by a specific amount, in addition to theMD_INCLUDE_INHERIT_HEADING_DEPTH
option. Default:0
Alternatives to this Plugin
Pelican allows the use of extra 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 awkward, because all the extensions loaded by default must also be explicitly listed. In addition to avoiding this problem, 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
). 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 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
File details
Details for the file pelican_markdown_include-1.0.4.tar.gz
.
File metadata
- Download URL: pelican_markdown_include-1.0.4.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c6febd2a9f4fd1d0d98bb8b519defc4541a1cfb73d2eab16e9a36051f1ce363 |
|
MD5 | 0ecc1848e0b5826ba852d958da2590f6 |
|
BLAKE2b-256 | 43f1ae1387a7089654ca0a2843c00e486aeadd1b3cc3e3e60f6c9530daf5548b |
File details
Details for the file pelican_markdown_include-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: pelican_markdown_include-1.0.4-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16489d6bb7f53618125d531fd53f516a45c7d0c9a68551d583378ebe4e6e915e |
|
MD5 | 78ae8238a6af30f3989c48d1ee8121fb |
|
BLAKE2b-256 | de68863b59cb30bfd10203186946f50b142cf0d492adc60fef295f61980bd490 |