项目作者: butler54

项目描述 :
mdformat plugin to ensure frontmatter is respected.
高级语言: Python
项目地址: git://github.com/butler54/mdformat-frontmatter.git
创建时间: 2021-02-13T01:26:29Z
项目社区:https://github.com/butler54/mdformat-frontmatter

开源协议:MIT License

下载


mdformat-frontmatter

Build Status
codecov.io
PyPI version

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:

  1. ---
  2. test: yaml
  3. ---
  4. # This looks okay
  5. For some markdown code.

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

  1. # This is not
  2. ---
  3. test: yaml
  4. ---

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 provided by executable books and customized (specifically to separate content PR’s from the release cycle).
This package driver flit as the build engine, and tox for test automation.

To install these development dependencies:

  1. pip install tox

To run the tests:

  1. tox

and with test coverage:

  1. tox -e py37-cov

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

To run the code formatting and style checks:

  1. tox -e py37-pre-commit

or directly

  1. pip install pre-commit
  2. pre-commit run --all

To run the pre-commit hook test:

  1. tox -e py37-hook

Publish to PyPi

Either use flit directly:

  1. pip install flit
  2. 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.