run black on documentation code snippets
Project description
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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
blackdoc-0.1.1-py3-none-any.whl
(19.4 kB
view hashes)