Mdformat plugin to Blacken Python code blocks
Project description
mdformat-black
Mdformat plugin to Blacken Python code blocks
Description
mdformat-black is an mdformat plugin that makes mdformat format Python code blocks with Black.
Usage
Install with:
pip install mdformat-black
When using mdformat on the command line, Black formatting will be automatically enabled after install.
When using mdformat Python API, code formatting for Python will have to be enabled explicitly:
import mdformat
unformatted = "```python\n'''black converts quotes'''\n```\n"
formatted = mdformat.text(unformatted, codeformatters={"python"})
assert formatted == '```python\n"""black converts quotes"""\n```\n'
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
mdformat-black-0.1.1.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for mdformat_black-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92a7f83779428ca04e939fcbd196ef6340bf9c83f33b2c50d4d3bb734a63d7b2 |
|
MD5 | cfab1a138775364da9c71926478ff7fa |
|
BLAKE2b-256 | f294ce9138b0dfb2026d188b1edd18bd5fd328ff91e2b76002622da2faad46d7 |