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

Uploaded Source

Built Distribution

blackdoc-0.3.3-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blackdoc-0.3.3.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for blackdoc-0.3.3.tar.gz
Algorithm Hash digest
SHA256 b4956bdd3ad21c501cf33129dfe8a63f202e03630b2951ac23b38bbdc435165a
MD5 c00b40f613a488290ec418a5699afae8
BLAKE2b-256 2c4552587e9f56657b20640488dbb7ad3305302a39468b9d43ab1fe2d26e8917

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blackdoc-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for blackdoc-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cdf47d090635f8c9a23019d9d1ea9f2fc3c597960aa2fb0b39e5be267bc82ccf
MD5 b71782929fa3811f2eb360bda476dbc3
BLAKE2b-256 62018dafc304c4367f5bb3251a70ff3832526d1cfe729d6a9b7fab75362e9762

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