clang-format-docs


Nameclang-format-docs JSON
Version 0.3.1 PyPI version JSON
download
home_pageNone
SummaryRun `clang-format` on C++ code blocks in documentation files
upload_time2025-01-04 13:19:29
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            clang-format-docs
=================

Run `clang-format` on C++ code blocks in documentation files.
This 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)


## install

```bash
pip install clang-format-docs
```


## Usage

`clang-format-docs` will take markdown files and search for C++ code blocks e.g

```markdown
    ```c++
    void hello(){
        std::cout << "Hello world\n";
    }
    ```
```

and format them using `clang-format`, i.e
```bash
clang-format-docs file.md
```
will rewrite the file with clang-format applied. Also note that you can pass in a different format style using
```
clang-format-docs --style=LLVM file.md
```
or using a clang-format config file
```
clang-format-docs --style=file:my_clang_format.txt file.md
```


## Usage with pre-commit

See [pre-commit](https://pre-commit.com) for instructions

Sample `.pre-commit-config.yaml`:


```yaml
-   repo: https://github.com/finsberg/clang-format-docs
    rev: v0.3.0
    hooks:
    -   id: clang-format-docs
        additional_dependencies: [clang-format==14.0.6]
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "clang-format-docs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Henrik Finsberg <henriknf@simula.no>",
    "download_url": "https://files.pythonhosted.org/packages/47/71/cde3a97d5bdc6b86e6b3d5bc5a128ddb2a8dd9e7514e166fb67ecc62548c/clang_format_docs-0.3.1.tar.gz",
    "platform": null,
    "description": "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 << \"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.0\n    hooks:\n    -   id: clang-format-docs\n        additional_dependencies: [clang-format==14.0.6]\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Run `clang-format` on C++ code blocks in documentation files",
    "version": "0.3.1",
    "project_urls": {
        "Homepage": "https://github.com/finsberg/clang-format-docs"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "409ddf08b3f3b15ef247bfeaa04fbc7789db58af06239cf9f34571df218ad358",
                "md5": "0650181d7352ca01e501d25a3a94b155",
                "sha256": "90d9efdd20ea289c8337dc0e3b5ff411051eccebaa4b2a9603bca8ab07c3864b"
            },
            "downloads": -1,
            "filename": "clang_format_docs-0.3.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0650181d7352ca01e501d25a3a94b155",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.9",
            "size": 5658,
            "upload_time": "2025-01-04T13:19:27",
            "upload_time_iso_8601": "2025-01-04T13:19:27.223504Z",
            "url": "https://files.pythonhosted.org/packages/40/9d/df08b3f3b15ef247bfeaa04fbc7789db58af06239cf9f34571df218ad358/clang_format_docs-0.3.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4771cde3a97d5bdc6b86e6b3d5bc5a128ddb2a8dd9e7514e166fb67ecc62548c",
                "md5": "0b6d0cda958710f524b4b11c12d3c074",
                "sha256": "1bb4089c040ad5bca46eded3f145c6700f4a01419eb8a15277e481b70fb7f4d5"
            },
            "downloads": -1,
            "filename": "clang_format_docs-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0b6d0cda958710f524b4b11c12d3c074",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5725,
            "upload_time": "2025-01-04T13:19:29",
            "upload_time_iso_8601": "2025-01-04T13:19:29.594886Z",
            "url": "https://files.pythonhosted.org/packages/47/71/cde3a97d5bdc6b86e6b3d5bc5a128ddb2a8dd9e7514e166fb67ecc62548c/clang_format_docs-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-04 13:19:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "finsberg",
    "github_project": "clang-format-docs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "clang-format-docs"
}
        
Elapsed time: 0.36436s