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

Uploaded Source

Built Distribution

blackdoc-0.3.1-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for blackdoc-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d5cc07ca5b629df44289305c45016a42186c3e074248b901223d2383d0364ef2
MD5 ea53e29bdf3079dfdb3342a5d61318f9
BLAKE2b-256 26c1c51686449b3399351e6b5d504ef0431b62339ee3e7067d25d543412e9a3b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for blackdoc-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e5fd0cff03d44cf0dab3f05988fd08c33e791398c7501b9dadc841880791163
MD5 48007643f30b7f1945f0521d7ab5691e
BLAKE2b-256 0f9faf1035a13c8418c6eedac4feefee5ea5bfb4d4f5c820b174012f3fea6a56

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