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.3.8.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

blackdoc-0.3.8-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blackdoc-0.3.8.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for blackdoc-0.3.8.tar.gz
Algorithm Hash digest
SHA256 3c9d5534f92557a627a31550c7faec8363b5b0929bbb0ca3f5df179a81a9d6b2
MD5 9e8fe6b7a205d740ab63400ff54cf879
BLAKE2b-256 d0d52eb09a9b1f0b680d0c0d6f01b587b4d7f7a3df66cbac6ee5e452a8d9b1c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blackdoc-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for blackdoc-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c003a1b72d57692b343815c8b7a15e78977caba96c86060def892602b5aba083
MD5 712d9758027d7fe340816d56ee9ed626
BLAKE2b-256 50b7aa532b3d17c31f820087d4b44e7fa0f21e6c9e27d9a29ff9d21b66ad6e4e

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