Reader plugin for Markdown-IT-py replacement
This is double-opinionated, in that it's opinionated using Markdown-IT and again because we add in some additions; in particular:
- Tables
- footnotes
- Pygment-based syntax highlighting
This plugin can be installed via:
python -m pip install pelican-markdown-it-reader
There are currently no configuration items.
Once installed it takes over responsibility for reading the following file extensions:
mdmarkdownmkdmdown
By taking over link_open and image render rules, the plugin handles replacing the
pelican link placeholders with appropriate href items which are then rendered to html.
The reader parses a YAML frontmatter header delimited by --- (terminated by a
line of --- or ...), for example:
---
title: My Post
date: 2021-06-11 10:00
category: server admin
tags:
- apple
- macintosh
---
Body text...List-form values (such as tags) are supported, and FORMATTED_FIELDS (e.g.
summary) are rendered through Markdown-IT as well. Because the reader handles
YAML frontmatter itself, you do not need the pelican-yaml-metadata plugin;
in fact you should remove it, since whichever reader registers last wins the
Markdown extensions and yaml-metadata renders bodies with python-markdown
(which, among other things, cannot render fenced code blocks nested inside
lists).
Files without a --- header fall back to a simple key: value metadata parser
for backwards compatibility.
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.
We use dependabot for updating dependencies, conventional commits for commit messages, and github actions for release.
To generate a release:
cz bump --dry-run [--increment patch]to verify changescz bump [--increment patch]to finalizegit pushto send code andgit push <tag>to send the tag (or the less-safe--tags)
This project is licensed under the MIT license.