blacken-docs 1.1.0
pip install blacken-docs==1.1.0
Released:
Run `black` on python code blocks in documentation files
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Anthony Sottile
- Requires: Python >=3.6
Classifiers
Project description
blacken-docs
Run black
on python code blocks in documentation files.
install
pip install blacken-docs
usage
blacken-docs
provides a single executable (blacken-docs
) which will modify
.rst
/ .md
files in place.
It currently supports the following black
options:
-l
/--line-length
-t
/--target-version
-S
/--skip-string-normalization
Following additional parameters can be used:
-E
/--skip-errors
blacken-docs
will format code in the following block types:
(markdown)
```python
def hello():
print("hello world")
```
(rst)
.. code-block:: python
def hello():
print("hello world")
usage with pre-commit
See pre-commit for instructions
Sample .pre-commit-config.yaml
:
- repo: https://github.com/asottile/blacken-docs
rev: v1.1.0
hooks:
- id: blacken-docs
additional_dependencies: [black==...]
Since black
is currently a moving target, it is suggested to pin black
to a specific version using additional_dependencies
.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Anthony Sottile
- Requires: Python >=3.6
Classifiers
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
Built Distribution
File details
Details for the file blacken_docs-1.1.0.tar.gz
.
File metadata
- Download URL: blacken_docs-1.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d0db1a256098fde879c57a675ff7c76c3c54c2fae9cdd949ed6fb2fcc2d51e7 |
|
MD5 | e1d0c0e8ebefedb40650cc103cd5eb4c |
|
BLAKE2b-256 | 1a4e4751825612f8a4a2e1a4f5bee5d843348c982c7352ee8901688d83bece81 |
File details
Details for the file blacken_docs-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: blacken_docs-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12f5483c8ec56e7c28953c3b7f9b8b840e3cae0f8ce5692fd0fe31d7c334dae0 |
|
MD5 | 5c0f18906cb6c84fb43485017b44bb30 |
|
BLAKE2b-256 | c584229f165070d855224b7873f376b9c2ab32136c30b7d478d5cd3a9533ba42 |