An mdformat plugin for parsing / ignoring frontmatter.
Project description
mdformat-frontmatter
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:
- Merge PRs with conventional commit titles (e.g.,
fix:,feat:,chore:) - The CI workflow automatically analyzes commits, determines version bump, updates CHANGELOG, creates a tag, and publishes to PyPI
- 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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d203935fc26243c3f65783667b7bef00a776153f7bc2e8f9e9f45464239722d
|
|
| MD5 |
35fb3fb99c6455078dbce0f316332883
|
|
| BLAKE2b-256 |
841114238661b3d379ff1d335186914fe52bd42f47df09ca4c474624833cab7d
|
Provenance
The following attestation bundles were made for mdformat_frontmatter-2.1.1.tar.gz:
Publisher:
release.yml on butler54/mdformat-frontmatter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mdformat_frontmatter-2.1.1.tar.gz -
Subject digest:
1d203935fc26243c3f65783667b7bef00a776153f7bc2e8f9e9f45464239722d - Sigstore transparency entry: 1612505286
- Sigstore integration time:
-
Permalink:
butler54/mdformat-frontmatter@c67aef18802fea72434c6d29cc0e854fa5a04f38 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/butler54
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c67aef18802fea72434c6d29cc0e854fa5a04f38 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mdformat_frontmatter-2.1.1-py3-none-any.whl.
File metadata
- Download URL: mdformat_frontmatter-2.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
345b171985aeff6da7285887109711d5fe2a5d0be471cea9584644cd4f454c48
|
|
| MD5 |
fcee58ec2b6061d88200bcc096ed5b8e
|
|
| BLAKE2b-256 |
079557ae780bbab6f6b7e84f735d5cce7e8b56c23f50d4855613dbdf097283d8
|
Provenance
The following attestation bundles were made for mdformat_frontmatter-2.1.1-py3-none-any.whl:
Publisher:
release.yml on butler54/mdformat-frontmatter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mdformat_frontmatter-2.1.1-py3-none-any.whl -
Subject digest:
345b171985aeff6da7285887109711d5fe2a5d0be471cea9584644cd4f454c48 - Sigstore transparency entry: 1612505506
- Sigstore integration time:
-
Permalink:
butler54/mdformat-frontmatter@c67aef18802fea72434c6d29cc0e854fa5a04f38 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/butler54
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c67aef18802fea72434c6d29cc0e854fa5a04f38 -
Trigger Event:
push
-
Statement type: