Skip to main content

Run `black` on python code blocks in documentation files (also for jupyterbook)

Project description

blacken-docs-jb

Extension of blacken-docs which also supports the executable code blocks from JupyterBook e.g

```{code-cell} python
x = 1 + 2
```

Install

pip install blacken-docs-jb

Usage with pre-commit

See pre-commit for instructions

Sample .pre-commit-config.yaml:

- repo: https://github.com/finsberg/blacken-docs-jb
    rev: v0.6.2
    hooks:
      - id: blacken-docs-jb
        additional_dependencies: [black==22.3.0]
        exclude: slides

License

This project is licensed under MIT. The license file from blacken-docs is found in LICENSE_blacken_docs.

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

blacken_docs_jb-0.6.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

blacken_docs_jb-0.6.2-py2.py3-none-any.whl (4.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file blacken_docs_jb-0.6.2.tar.gz.

File metadata

  • Download URL: blacken_docs_jb-0.6.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for blacken_docs_jb-0.6.2.tar.gz
Algorithm Hash digest
SHA256 5f565cd057a5a9a74e9474804db4830717ef07d911abd3d437216d9a78351668
MD5 3e9ba61a3b323af3599699ed9d1884b1
BLAKE2b-256 4ca66a074245131bd7d47e11cd4141c83adf343dee2356869502ecacf1525078

See more details on using hashes here.

File details

Details for the file blacken_docs_jb-0.6.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for blacken_docs_jb-0.6.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 00a1b709b9d95c33ac6592072a71e4da26ca5dde94a6845e7f465cee9108d747
MD5 3af88ebd850a8868662b6298e4b05f38
BLAKE2b-256 0178b0c6a97aec17a961ec43613429aa7ff66f8383f47733aca2aab2e413dfcf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page