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.1.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.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mdformat_frontmatter-2.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 1d203935fc26243c3f65783667b7bef00a776153f7bc2e8f9e9f45464239722d
MD5 35fb3fb99c6455078dbce0f316332883
BLAKE2b-256 841114238661b3d379ff1d335186914fe52bd42f47df09ca4c474624833cab7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdformat_frontmatter-2.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mdformat_frontmatter-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 345b171985aeff6da7285887109711d5fe2a5d0be471cea9584644cd4f454c48
MD5 fcee58ec2b6061d88200bcc096ed5b8e
BLAKE2b-256 079557ae780bbab6f6b7e84f735d5cce7e8b56c23f50d4855613dbdf097283d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdformat_frontmatter-2.1.1-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