mdformat-frontmatter


Namemdformat-frontmatter JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttps://github.com/butler54/mdformat-frontmatter
SummaryAn mdformat plugin for parsing / ignoring frontmatter.
upload_time2023-01-21 06:29:58
maintainer
docs_urlNone
authorChris Butler
requires_python>=3.7
license
keywords mdformat markdown markdown-it
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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": "https://github.com/butler54/mdformat-frontmatter",
    "name": "mdformat-frontmatter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "mdformat,markdown,markdown-it",
    "author": "Chris Butler",
    "author_email": "chris@thebutlers.me",
    "download_url": "https://files.pythonhosted.org/packages/47/5d/7d28c6f3f789ee7719f48f625886cba4ef00eb1e105e36b554465898b81e/mdformat_frontmatter-2.0.1.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\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An mdformat plugin for parsing / ignoring frontmatter.",
    "version": "2.0.1",
    "split_keywords": [
        "mdformat",
        "markdown",
        "markdown-it"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0961ee676ce4d8e53828e60a4b7d7d8c4fcd731071f99e3c970140f24e4ecf43",
                "md5": "45c01c6202abec04835cb2b27919fa1f",
                "sha256": "354143935a103d6049239f5c2df288c80d0fbea8f7dd9e535ccc180e8c5aa235"
            },
            "downloads": -1,
            "filename": "mdformat_frontmatter-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45c01c6202abec04835cb2b27919fa1f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4465,
            "upload_time": "2023-01-21T06:29:57",
            "upload_time_iso_8601": "2023-01-21T06:29:57.624217Z",
            "url": "https://files.pythonhosted.org/packages/09/61/ee676ce4d8e53828e60a4b7d7d8c4fcd731071f99e3c970140f24e4ecf43/mdformat_frontmatter-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "475d7d28c6f3f789ee7719f48f625886cba4ef00eb1e105e36b554465898b81e",
                "md5": "cca93a4df1d16514d8ee133972a52f6b",
                "sha256": "a05c188ba2f483ab434b4e46e312c1a2ccf145e9ab95e3f493f8967c182ffd5c"
            },
            "downloads": -1,
            "filename": "mdformat_frontmatter-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "cca93a4df1d16514d8ee133972a52f6b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6401,
            "upload_time": "2023-01-21T06:29:58",
            "upload_time_iso_8601": "2023-01-21T06:29:58.755460Z",
            "url": "https://files.pythonhosted.org/packages/47/5d/7d28c6f3f789ee7719f48f625886cba4ef00eb1e105e36b554465898b81e/mdformat_frontmatter-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-21 06:29:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "butler54",
    "github_project": "mdformat-frontmatter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "mdformat-frontmatter"
}
        
Elapsed time: 0.03807s