Skip to main content

Mdformat plugin to Blacken Python code blocks

Project description

Build Status PyPI version

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


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)

Uploaded Source

Built Distribution

mdformat_black-0.1.1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page