Skip to main content

run black on documentation code snippets

Reason this release was yanked:

serious bug with triple-quoted strings

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

Uploaded Source

Built Distribution

blackdoc-0.3.5-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for blackdoc-0.3.5.tar.gz
Algorithm Hash digest
SHA256 7958065881412dc243fe809f8fa249fbb8a6731ae5f587c976ce803eaf886ac9
MD5 6f645f5854ee010329483c17759e502c
BLAKE2b-256 7f219801e4195793f0d23175592d94fec69129caab70cf70b1fd19453d2de8aa

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for blackdoc-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8fee2c3fde8da2b2224f054a0d5b10215a15a90c43943be397bdc11315e1be8a
MD5 5648bd59dd25e12e1830e62a9dcd4803
BLAKE2b-256 c7ffe21bc84084590578a3edffe880e6166655c52a8f95ec5d5f249870a2afba

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