An `mdformat` plugin for ensuring that YAML front-matter is respected and formatted within Markdown files. It supports YAML front matter typically used by tools like Jekyll. The current version is 2.0.10, and it maintains an active release cadence with regular updates and fixes.
pip install mdformat mdformat-frontmatterVerified import paths — ran on the pinned version, not inferred.
Install `mdformat` and `mdformat-frontmatter`, then use `mdformat` via its CLI or Python API. The plugin will automatically format YAML front matter.
Ensure your front matter is strictly YAML. For other formats, use a different plugin.
Always ensure your front matter adheres to valid YAML syntax and structure.
Pin the version of `mdformat` in your project dependencies (e.g., `mdformat==1.0.0`) to ensure consistent formatting results across environments and builds.
Upgrade to `mdformat-frontmatter` version 2.0.7 or newer to benefit from the fix that ensures `ruamel.yaml` does not wrap lines in front matter.