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.0.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file mdformat-black-0.1.0.tar.gz
.
File metadata
- Download URL: mdformat-black-0.1.0.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 | cf9b3b9fbde27aa3401a5bf809892970f989d8d71a2275a58b27bbc430de6e90 |
|
MD5 | 91d03c2d4a8bf21a4d982baec15b86ef |
|
BLAKE2b-256 | 56d1e7c8967b98720b1f0ee9ce7479431464cd04e80b209a06c6bc6b052332ee |
Provenance
File details
Details for the file mdformat_black-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: mdformat_black-0.1.0-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 | c90b4264e405be201ec526b2a60fc712b349704b5ca83e4c17762f3e5c19d169 |
|
MD5 | b6079a719e5402d871fd9af88038562d |
|
BLAKE2b-256 | 774da05b76ffb9940e39870789ca8b70d15fcbff198e212c49c00bf89ac1eaa9 |