Skip to main content

run black on documentation code snippets

Reason this release was yanked:

still a 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.6.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

blackdoc-0.3.6-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for blackdoc-0.3.6.tar.gz
Algorithm Hash digest
SHA256 e7e24e67b4eef3abd9d7d8b61b6c6948cd678315ae2def3b1fc07cedf68b6acf
MD5 c337552377410ab230c40903fc05f67d
BLAKE2b-256 798fe351c09beff1dd095cdd1b81d80798ea9b35f3c051a43565f371bf3ef4f0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for blackdoc-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cb5e742e8062d21e3fee1dfa40f6441cd03be14348ed3c6ec2d5a974fe4f92ac
MD5 d9935049549995acd16d48bfe78128ce
BLAKE2b-256 26092c01a747b4d132028e09d3a769a974c6c0a965612e95425f2ebf2e10924d

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