Skip to main content

run black on documentation code snippets

Project description

https://github.com/keewis/blackdoc/workflows/CI/badge.svg?branch=master https://img.shields.io/badge/code%20style-black-000000.svg Documentation Status

blackdoc is a tool that applies black to code in documentation.

It was originally a rewrite of a gist and called black-doctest. In April 2020, it was renamed to blackdoc.

Installation

Dependencies:

Install it with:

python -m pip install blackdoc

Usage

The commandline interface supports two modes: checking and inplace reformatting.

python -m blackdoc --help

In inplace reformatting mode, it will reformat the doctest lines and write them back to disk:

# on explicitly mentioned files
python -m blackdoc file1.py file2.py
# on the whole directory
python -m blackdoc .

When checking, it will report the changed files but will not write them to disk:

python -m blackdoc --check .

It is also possible to use the entrypoint script:

blackdoc --help

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

blackdoc-0.2.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

blackdoc-0.2-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file blackdoc-0.2.tar.gz.

File metadata

  • Download URL: blackdoc-0.2.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200917 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for blackdoc-0.2.tar.gz
Algorithm Hash digest
SHA256 6f973cf4c129ae1f5634fee340004c425c7cc2b6b533641ed1053ee80ad3532c
MD5 0c7ef9b44fab29eafe522b8c265acb58
BLAKE2b-256 84ef73317154840d14f9e59c936dfc1372b02d9d76e5d561fe5f809ff214a206

See more details on using hashes here.

File details

Details for the file blackdoc-0.2-py3-none-any.whl.

File metadata

  • Download URL: blackdoc-0.2-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200917 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for blackdoc-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed60bfae38eb19b328267ca4a2761c7e1be559f797a726098e063d363538735
MD5 c7e2876d9d5c91bf2f71891d73468d99
BLAKE2b-256 9ba23af07827f5ac7f24e21c80d164ff0fe58a00b32911e5a686d3183296f012

See more details on using hashes here.

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