{"id":16284207,"url":"https://github.com/keewis/blackdoc","last_synced_at":"2025-04-04T19:12:51.889Z","repository":{"id":37930757,"uuid":"246162161","full_name":"keewis/blackdoc","owner":"keewis","description":"run black on documentation code snippets","archived":false,"fork":false,"pushed_at":"2024-10-01T20:22:50.000Z","size":291,"stargazers_count":47,"open_issues_count":10,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T19:18:46.596Z","etag":null,"topics":["black","codeformatter","doctest","documentation","python"],"latest_commit_sha":null,"homepage":"https://blackdoc.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keewis.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-09T23:17:55.000Z","updated_at":"2024-09-05T09:28:52.000Z","dependencies_parsed_at":"2023-01-31T03:01:06.082Z","dependency_job_id":"e6197818-8e37-4064-b620-ebaeb8e77b21","html_url":"https://github.com/keewis/blackdoc","commit_stats":{"total_commits":181,"total_committers":7,"mean_commits":"25.857142857142858","dds":0.4419889502762431,"last_synced_commit":"eb065946149871d1e21506c0a82d4400d074417e"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keewis%2Fblackdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keewis%2Fblackdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keewis%2Fblackdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keewis%2Fblackdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keewis","download_url":"https://codeload.github.com/keewis/blackdoc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["black","codeformatter","doctest","documentation","python"],"created_at":"2024-10-10T19:18:45.113Z","updated_at":"2025-04-04T19:12:51.867Z","avatar_url":"https://github.com/keewis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"blackdoc\n========\n\n.. image:: https://github.com/keewis/blackdoc/workflows/CI/badge.svg?branch=main\n    :target: https://github.com/keewis/blackdoc/actions\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/python/black\n.. image:: https://readthedocs.org/projects/blackdoc/badge/?version=latest\n    :target: https://blackdoc.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n**blackdoc** is a tool that applies `black`_ to code in documentation.\n\nIt was originally a rewrite of a `gist`_ and called\n**black-doctest**. In April 2020, it was renamed to **blackdoc**.\n\n.. _gist: https://gist.github.com/mattharrison/2a1a263597d80e99cf85e898b800ec32\n.. _black: https://github.com/psf/black\n\nInstallation\n------------\nDependencies:\n\n- `black`_\n- `more-itertools`_\n- `rich`_\n- `tomli`_\n- `pathspec`_\n\n.. _more-itertools: https://github.com/more-itertools/more-itertools\n.. _rich: https://github.com/textualize/rich\n.. _tomli: https://github.com/hukkin/tomli\n.. _pathspec: https://github.com/cpburnz/python-pathspec\n\nInstall it with:\n\n.. code:: bash\n\n    python -m pip install blackdoc\n\nUsage\n-----\nThe commandline interface supports two modes: checking and inplace\nreformatting.\n\n.. code:: bash\n\n    python -m blackdoc --help\n\n\nIn inplace reformatting mode, it will reformat the doctest lines and\nwrite them back to disk:\n\n.. code:: bash\n\n    # on explicitly mentioned files\n    python -m blackdoc file1.py file2.py\n    # on the whole directory\n    python -m blackdoc .\n\n\nWhen checking, it will report the changed files but will not write them to disk:\n\n.. code:: bash\n\n    python -m blackdoc --check .\n\nIt is also possible to use the entrypoint script:\n\n.. code:: bash\n\n    blackdoc --help\n\npre-commit\n----------\nThis repository defines a ``pre-commit`` hook:\n\n.. code:: yaml\n\n   hooks:\n   ...\n   - repo: https://github.com/keewis/blackdoc\n     rev: 3.8.0\n     hooks:\n     - id: blackdoc\n\nIt is recommended to *pin* ``black`` in order to avoid having different versions for each contributor. To automatically synchronize this pin with the version of the ``black`` hook, use the ``blackdoc-autoupdate-black`` hook:\n\n.. code:: yaml\n\n   hooks:\n   ...\n   - repo: https://github.com/psf/black\n     rev: 23.10.1\n     hooks:\n     - id: black\n   ...\n   - repo: https://github.com/keewis/blackdoc\n     rev: 3.8.0\n     hooks:\n     - id: blackdoc\n       additional_dependencies: [\"black==23.10.1\"]\n     - id: blackdoc-autoupdate-black\n\nNote that this hook is *not* run on ``pre-commit autoupdate``.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeewis%2Fblackdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeewis%2Fblackdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeewis%2Fblackdoc/lists"}