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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: blackdoc-0.3.4.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.11

File hashes

Hashes for blackdoc-0.3.4.tar.gz
Algorithm Hash digest
SHA256 8d416b541d378b431173874d0011a259efaed63580e92817f95c47e3b20d057f
MD5 079e2e80ca5386ece62b7caef099e4ff
BLAKE2b-256 ad62baa1f1bcb7dfeba6ae203801b88e4346219623a96bf8bb064dc5b15e567b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blackdoc-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.11

File hashes

Hashes for blackdoc-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4b6567c1e31dd9f13d684325e40c9f2decf30c0b8f76eeec2c4b71f91e3cdaf2
MD5 882b5f1e6608c6e02a5c632edd607b9a
BLAKE2b-256 97b2d87e9950a29703c9ad86571d7f66466a117d003bb091c41c810d3bf760eb

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