Skip to main content

An mdformat plugin for parsing / ignoring frontmatter.

Project description

mdformat-frontmatter

Build Status codecov.io PyPI version OpenSSF Scorecard

An mdformat plugin for ensuring that yaml front-matter is respected. Many tools (such as jekyll) use yaml front matter for automation purposes. mdformat-frontmatter only supports yaml. For example:

---
test: yaml
---
# This looks okay
For some markdown code.

Frontmatter can only be at the first line or two of the code.

# This is not
---
test: yaml
---

Note: that at this stage this plugin is not that sophisticated. The principle objective is to allow properly formed yaml header blocks to pass through. Incorrectly formed blocks may result in strange behaviour.

Requirements

Python 3.10 or higher.

Development

This package was built from the template provided by executable books and customized (specifically to separate content PR's from the release cycle). This package uses hatch as the build engine, and tox for test automation.

To install development dependencies:

pip install -e ".[dev,test]"

To run the tests:

tox

and with test coverage:

tox -e py312-cov

The easiest way to write tests, is to edit tests/fixtures.md

To run the code formatting and style checks:

tox -e py312-pre-commit

or directly

pip install pre-commit
pre-commit run --all

To run the pre-commit hook test:

tox -e py312-hook

Release Process

Releases are fully automated using python-semantic-release and conventional commits:

  1. Merge PRs with conventional commit titles (e.g., fix:, feat:, chore:)
  2. The CI workflow automatically analyzes commits, determines version bump, updates CHANGELOG, creates a tag, and publishes to PyPI
  3. Artifacts are signed with Sigstore for supply chain security

The release workflow uses PyPI Trusted Publishing (OIDC) and generates attestations for all published packages.

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

mdformat_frontmatter-2.1.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdformat_frontmatter-2.1.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file mdformat_frontmatter-2.1.2.tar.gz.

File metadata

  • Download URL: mdformat_frontmatter-2.1.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mdformat_frontmatter-2.1.2.tar.gz
Algorithm Hash digest
SHA256 9c9c3159c38407f47e567202749c74ce7680017516cd158c82400f015c6a01d1
MD5 278746f997e5424bb245e933b7226e1b
BLAKE2b-256 4d90ae8a3d20066295367d9048ad480bcde3afe694eb592fec9c35bbdb7d68eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdformat_frontmatter-2.1.2.tar.gz:

Publisher: release.yml on butler54/mdformat-frontmatter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mdformat_frontmatter-2.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mdformat_frontmatter-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bcbb1dd7e35ce4387603acd32f2c092dd4518bbfaa2a4b801a0f29a4e69bf2ca
MD5 e5e1e22386769d383de03643b540b989
BLAKE2b-256 53a020b6f53593139d8b64fa8e7f750033fbb580c096c241cd551b59907e6abe

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdformat_frontmatter-2.1.2-py3-none-any.whl:

Publisher: release.yml on butler54/mdformat-frontmatter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page