# mdformat-frontmatter
[![Build Status][ci-badge]][ci-link]
[![codecov.io][cov-badge]][cov-link]
[![PyPI version][pypi-badge]][pypi-link]
An [mdformat](https://github.com/executablebooks/mdformat) plugin for ensuring that yaml `front-matter` is respected.
Many tools (such as [jekyll](https://github.com/jekyll/jekyll)) use yaml front matter for automation purposes.
`mdformat-frontmatter` only supports yaml. For example:
```markdown
---
test: yaml
---
# This looks okay
For some markdown code.
```
Frontmatter can only be at the first line or two of the code.
```markdown
# 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.
## Development
This package was built from the [template](https://github.com/executablebooks/mdformat-plugin) provided by [executable books](https://github.com/executablebooks) and customized (specifically to separate content PR's from the release cycle).
This package driver [flit](https://flit.readthedocs.io) as the build engine, and [tox](https://tox.readthedocs.io) for test automation.
To install these development dependencies:
```bash
pip install tox
```
To run the tests:
```bash
tox
```
and with test coverage:
```bash
tox -e py37-cov
```
The easiest way to write tests, is to edit tests/fixtures.md
To run the code formatting and style checks:
```bash
tox -e py37-pre-commit
```
or directly
```bash
pip install pre-commit
pre-commit run --all
```
To run the pre-commit hook test:
```bash
tox -e py37-hook
```
## Publish to PyPi
Either use flit directly:
```bash
pip install flit
flit publish
```
or trigger the GitHub Action job, by creating a release with a tag equal to the version, e.g. `v0.0.1`.
Note, this requires generating an API key on PyPi and adding it to the repository `Settings/Secrets`, under the name `PYPI_KEY`.
[ci-badge]: https://github.com/butler54/mdformat-frontmatter/workflows/CI/badge.svg?branch=main
[ci-link]: https://github.com/butler54/mdformat-frontmatter/actions?query=workflow%3ACI+branch%3Amain+event%3Apush
[cov-badge]: https://codecov.io/gh/butler54/mdformat-frontmatter/branch/main/graph/badge.svg
[cov-link]: https://codecov.io/gh/butler54/mdformat-frontmatter
[pypi-badge]: https://img.shields.io/pypi/v/mdformat-frontmatter.svg
[pypi-link]: https://pypi.org/project/mdformat-frontmatter
Raw data
{
"_id": null,
"home_page": null,
"name": "mdformat_frontmatter",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "mdformat,markdown,markdown-it",
"author": null,
"author_email": "Chris Butler <chris@thebutlers.me>",
"download_url": "https://files.pythonhosted.org/packages/71/aa/70876bec1e66f2b1ab26f31d226c09bf7b78d3d27f03c2642d1d69d1ae77/mdformat_frontmatter-2.0.8.tar.gz",
"platform": null,
"description": "# mdformat-frontmatter\n\n[![Build Status][ci-badge]][ci-link]\n[![codecov.io][cov-badge]][cov-link]\n[![PyPI version][pypi-badge]][pypi-link]\n\nAn [mdformat](https://github.com/executablebooks/mdformat) plugin for ensuring that yaml `front-matter` is respected.\nMany tools (such as [jekyll](https://github.com/jekyll/jekyll)) use yaml front matter for automation purposes.\n`mdformat-frontmatter` only supports yaml. For example:\n\n```markdown\n\n---\ntest: yaml\n---\n# This looks okay\nFor some markdown code.\n```\n\nFrontmatter can only be at the first line or two of the code.\n```markdown\n# This is not\n---\ntest: yaml\n---\n```\nNote: that at this stage this plugin is not that sophisticated. The principle objective is to allow properly formed yaml header blocks to pass through.\nIncorrectly formed blocks may result in strange behaviour.\n\n## Development\nThis package was built from the [template](https://github.com/executablebooks/mdformat-plugin) provided by [executable books](https://github.com/executablebooks) and customized (specifically to separate content PR's from the release cycle).\nThis package driver [flit](https://flit.readthedocs.io) as the build engine, and [tox](https://tox.readthedocs.io) for test automation.\n\nTo install these development dependencies:\n\n```bash\npip install tox\n```\n\nTo run the tests:\n\n```bash\ntox\n```\n\nand with test coverage:\n\n```bash\ntox -e py37-cov\n```\n\nThe easiest way to write tests, is to edit tests/fixtures.md\n\nTo run the code formatting and style checks:\n\n```bash\ntox -e py37-pre-commit\n```\n\nor directly\n\n```bash\npip install pre-commit\npre-commit run --all\n```\n\nTo run the pre-commit hook test:\n\n```bash\ntox -e py37-hook\n```\n\n## Publish to PyPi\n\nEither use flit directly:\n\n```bash\npip install flit\nflit publish\n```\n\nor trigger the GitHub Action job, by creating a release with a tag equal to the version, e.g. `v0.0.1`.\n\nNote, this requires generating an API key on PyPi and adding it to the repository `Settings/Secrets`, under the name `PYPI_KEY`.\n\n[ci-badge]: https://github.com/butler54/mdformat-frontmatter/workflows/CI/badge.svg?branch=main\n[ci-link]: https://github.com/butler54/mdformat-frontmatter/actions?query=workflow%3ACI+branch%3Amain+event%3Apush\n[cov-badge]: https://codecov.io/gh/butler54/mdformat-frontmatter/branch/main/graph/badge.svg\n[cov-link]: https://codecov.io/gh/butler54/mdformat-frontmatter\n[pypi-badge]: https://img.shields.io/pypi/v/mdformat-frontmatter.svg\n[pypi-link]: https://pypi.org/project/mdformat-frontmatter\n",
"bugtrack_url": null,
"license": null,
"summary": "An mdformat plugin for parsing / ignoring frontmatter.",
"version": "2.0.8",
"project_urls": {
"Changelog": "https://github.com/butler54/mdformat-frontmatter/blob/main/CHANGELOG.md",
"Source": "https://github.com/butler54/mdformat-frontmatter"
},
"split_keywords": [
"mdformat",
"markdown",
"markdown-it"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5d51b3da1292c32819c52a4e4242ad94c3c07189ca70d228b3909a58f1f3a819",
"md5": "19d688a5f1947c9cabccb2a702932923",
"sha256": "577396695af96ad66dff1ff781284ff3764a10be3ab8659f2ef842ab42264ebb"
},
"downloads": -1,
"filename": "mdformat_frontmatter-2.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "19d688a5f1947c9cabccb2a702932923",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3747,
"upload_time": "2023-11-07T06:53:16",
"upload_time_iso_8601": "2023-11-07T06:53:16.972327Z",
"url": "https://files.pythonhosted.org/packages/5d/51/b3da1292c32819c52a4e4242ad94c3c07189ca70d228b3909a58f1f3a819/mdformat_frontmatter-2.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "71aa70876bec1e66f2b1ab26f31d226c09bf7b78d3d27f03c2642d1d69d1ae77",
"md5": "b7d71e3f728b6b1800af1d0eb0fdd6f5",
"sha256": "c11190ae3f9c91ada78fbd820f5b221631b520484e0b644715aa0f6ed7f097ed"
},
"downloads": -1,
"filename": "mdformat_frontmatter-2.0.8.tar.gz",
"has_sig": false,
"md5_digest": "b7d71e3f728b6b1800af1d0eb0fdd6f5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 3254,
"upload_time": "2023-11-07T06:53:18",
"upload_time_iso_8601": "2023-11-07T06:53:18.258192Z",
"url": "https://files.pythonhosted.org/packages/71/aa/70876bec1e66f2b1ab26f31d226c09bf7b78d3d27f03c2642d1d69d1ae77/mdformat_frontmatter-2.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-07 06:53:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "butler54",
"github_project": "mdformat-frontmatter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "mdformat_frontmatter"
}