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

Uploaded Source

Built Distribution

blackdoc-0.3.7-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for blackdoc-0.3.7.tar.gz
Algorithm Hash digest
SHA256 0b2e3f2f5611112532c85647a39cdc6e7ced660530e942331aa971c49c71deae
MD5 1bf11d53599dbc8897f0de9b6d635ac9
BLAKE2b-256 86936c705289a9995481ee00e6a28cffa3a109e0422ba9242573f2026fcdc7d9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for blackdoc-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a028fbb2a48e8a3c577d9bbe9c40adf67950c45db9bcd5902bcde5c37cd865
MD5 18c815fcef54e64f89e605cc54a05a33
BLAKE2b-256 42c2d8e4519bfd653087fe16d1b260d7c2768482aa07e960e795938658b30296

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