{"categories":[{"label":"Documentation","url":"https://skillfed.io/packages/category/documentation/2"}],"enrichment":{"capability":"Applies Black code formatting to Python code blocks embedded in documentation files (Markdown, reStructuredText, LaTeX) and Python docstrings.","skillfed_tags":["code-formatter","documentation-tools","pre-commit"],"use_cases":["Enforce consistent code style in README and API documentation examples alongside your main codebase formatting.","Integrate into pre-commit hooks to automatically reformat code blocks in pull requests before commit.","Verify documentation code blocks are syntactically valid and properly formatted as part of CI checks.","Reformat Python code examples embedded in docstrings when refactoring or upgrading Black versions.","Maintain LaTeX documentation with minted code blocks in a consistent style with your project's Black config."],"what_it_does":"blacken-docs is a command-line tool that runs Black's code formatter on Python code blocks found within documentation files. It recognizes Python code in Markdown fenced blocks (```python and ```pycon), reStructuredText code-block directives, LaTeX minted and pycode environments, and Python docstrings. The tool rewrites files in place and exits with a non-zero status if any changes were made, making it suitable for CI/CD pipelines and pre-commit hooks.\n\nThe package depends solely on black and is designed to keep documentation examples in sync with your project's code style. It supports Black's key options (line length, target version, string normalization, preview mode) and adds its own flags for dry-run checking, error suppression, and optional reStructuredText literal-block formatting. It does not recurse directories\u2014you provide explicit file paths or use shell globbing and pre-commit integration to apply it across many files.","worth_installing":"Yes. This is a lightweight, actively maintained tool with no security vulnerabilities and a single stable dependency. Install it if you maintain documentation with embedded Python code and want to keep those examples formatted consistently with Black. The pre-commit integration makes it a natural fit for projects already using Black."},"id":"blacken-docs","links":{"html":"https://skillfed.io/packages/blacken-docs","md":"https://skillfed.io/packages/blacken-docs.md","pypi":"https://pypi.org/project/blacken-docs/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-09-08","license_spdx":"MIT","license_treatment":"permissive","name":"blacken-docs","python_support":"supports_current","summary":"Run Black on Python code blocks in documentation files."},"popularity":{"monthly_downloads":131001,"position":11614,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.20.0"}
