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

Uploaded Source

Built Distribution

blackdoc-0.1.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blackdoc-0.1.1.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for blackdoc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e340e64c6736ba70792adb76a8615d09c59485a604b372009559c7cdf3774d2d
MD5 29a4dd55fd92fcc18490e016b6104738
BLAKE2b-256 392f3b1803b316c1df1c6a027d8017d1c71bd9561b2c30e745f77340527dc986

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blackdoc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for blackdoc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c26e910dea3307378f246bfe95ab91ed848b1d581d6b167fdc08f5c248b1db9
MD5 b19bfcdc94054195d8359e5bca98a3c1
BLAKE2b-256 e2da82be4b3d2b624d0ac6a37d3f786ceb58d23cd51deb5ccb6218fb5226e9b7

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