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 details)
Built Distribution
File details
Details for the file mdformat-black-0.1.1.tar.gz
.
File metadata
- Download URL: mdformat-black-0.1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.0 Linux/5.4.0-47-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57cad92aee314b87dee52a795cdb52469ab166589d2771e3ad3dd19db907ab62 |
|
MD5 | afbb44aa1c43b3929792290b405a2cd7 |
|
BLAKE2b-256 | e7342add7968b8570efcf1be6d456ba18919725c4c31fd105e589dae1808c135 |
File details
Details for the file mdformat_black-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: mdformat_black-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.0 Linux/5.4.0-47-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92a7f83779428ca04e939fcbd196ef6340bf9c83f33b2c50d4d3bb734a63d7b2 |
|
MD5 | cfab1a138775364da9c71926478ff7fa |
|
BLAKE2b-256 | f294ce9138b0dfb2026d188b1edd18bd5fd328ff91e2b76002622da2faad46d7 |