{"id":19811733,"url":"https://github.com/finsberg/clang-format-docs","last_synced_at":"2025-05-01T08:33:14.092Z","repository":{"id":61701777,"uuid":"554145137","full_name":"finsberg/clang-format-docs","owner":"finsberg","description":"Run `clang-format` on C++ code blocks in documentation files","archived":false,"fork":false,"pushed_at":"2024-02-20T13:28:58.000Z","size":35,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-24T01:59:02.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/finsberg.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2022-10-19T10:21:51.000Z","updated_at":"2024-07-28T15:23:44.000Z","dependencies_parsed_at":"2024-02-20T13:48:26.706Z","dependency_job_id":null,"html_url":"https://github.com/finsberg/clang-format-docs","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"15fc4964fda0d3df3241df73349874945a81b44a"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finsberg%2Fclang-format-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finsberg%2Fclang-format-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finsberg%2Fclang-format-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finsberg%2Fclang-format-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finsberg","download_url":"https://codeload.github.com/finsberg/clang-format-docs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224249068,"owners_count":17280274,"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":[],"created_at":"2024-11-12T09:27:37.305Z","updated_at":"2025-05-01T08:33:14.084Z","avatar_url":"https://github.com/finsberg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"clang-format-docs\n=================\n\nRun `clang-format` on C++ code blocks in documentation files.\nThis project is derivative work of [`blacken-docs`](https://github.com/adamchainz/blacken-docs). License from `blacken-docs` is included in [LICENSE_blacken_docs](LICENSE_blacken_docs)\n\n\n## install\n\n```bash\npip install clang-format-docs\n```\n\n\n## Usage\n\n`clang-format-docs` will take markdown files and search for C++ code blocks e.g\n\n```markdown\n    ```c++\n    void hello(){\n        std::cout \u003c\u003c \"Hello world\\n\";\n    }\n    ```\n```\n\nand format them using `clang-format`, i.e\n```bash\nclang-format-docs file.md\n```\nwill rewrite the file with clang-format applied. Also note that you can pass in a different format style using\n```\nclang-format-docs --style=LLVM file.md\n```\nor using a clang-format config file\n```\nclang-format-docs --style=file:my_clang_format.txt file.md\n```\n\n\n## Usage with pre-commit\n\nSee [pre-commit](https://pre-commit.com) for instructions\n\nSample `.pre-commit-config.yaml`:\n\n\n```yaml\n-   repo: https://github.com/finsberg/clang-format-docs\n    rev: v0.3.2\n    hooks:\n    -   id: clang-format-docs\n        additional_dependencies: [clang-format==14.0.6]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinsberg%2Fclang-format-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinsberg%2Fclang-format-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinsberg%2Fclang-format-docs/lists"}