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

Uploaded Source

Built Distribution

blackdoc-0.1.2-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blackdoc-0.1.2.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

File hashes

Hashes for blackdoc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1573230228009268b506ea2590ecedc41c8604b86706645b177bd7d64193db19
MD5 c32b70225aa5173cebfe224778b5d42f
BLAKE2b-256 3a7c35aef087f1186e206194347efec3faa30b05e529d5632de8637a9f638792

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blackdoc-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

File hashes

Hashes for blackdoc-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e3f012199a580c0e3eed9043c7d4b6de718048c4ae0cc71d53f3ff5957550b4e
MD5 ce531bf790bb35412d96c253265e8ab6
BLAKE2b-256 d3c33cd108da40894e04a895b2d72589e54083b07cfdb8562898d033839cd735

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