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

Uploaded Source

Built Distribution

blackdoc-0.3-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blackdoc-0.3.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for blackdoc-0.3.tar.gz
Algorithm Hash digest
SHA256 6713ba8db7403c97de9e4c71355ead46f328f27743f6be7b9297e0ab3db9d5e3
MD5 7f935264c9b21e52e983af9eee5bf834
BLAKE2b-256 47bf377c70e710cb7ca0a5458ddf040b5a594eb3b595af37eaf74137041db21b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blackdoc-0.3-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for blackdoc-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 984e40d0f12b9ce73fa31c6218c6b2f88158324648f30255d5fef90fc95b1515
MD5 354d71b650003ee45f2db97e321e0313
BLAKE2b-256 eccb854574f19ca966bfefd839b875d31b187dea4d13accbe123ccc35230e0e4

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