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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

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