clang-format-docs


Nameclang-format-docs JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/finsberg/clang-format-docs
SummaryRun `clang-format` on C++ code blocks in documentation files
upload_time2023-01-09 08:17:01
maintainer
docs_urlNone
authorHenrik Finsberg
requires_python>=3.7
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.2.1
    hooks:
    -   id: clang-format-docs
        additional_dependencies: [clang-format==14.0.6]
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/finsberg/clang-format-docs",
    "name": "clang-format-docs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Henrik Finsberg",
    "author_email": "henriknf@simula.no",
    "download_url": "https://files.pythonhosted.org/packages/0f/c2/b9c91792cb5efc6d76d843fc8932ac3e1e61411a392439cddccd78e40814/clang_format_docs-0.2.2.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.2.1\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.2.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "104d453eb0677be269410e18731f43ab31626bb43b57e0391337fb125dfd5307",
                "md5": "bf38364bc0c2983469e5f19b585e541e",
                "sha256": "80a9707a3d23426b617dac81c8eb4dfda29b2db21fdb3f08ea7857e7383ab55a"
            },
            "downloads": -1,
            "filename": "clang_format_docs-0.2.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bf38364bc0c2983469e5f19b585e541e",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 5653,
            "upload_time": "2023-01-09T08:17:00",
            "upload_time_iso_8601": "2023-01-09T08:17:00.818064Z",
            "url": "https://files.pythonhosted.org/packages/10/4d/453eb0677be269410e18731f43ab31626bb43b57e0391337fb125dfd5307/clang_format_docs-0.2.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0fc2b9c91792cb5efc6d76d843fc8932ac3e1e61411a392439cddccd78e40814",
                "md5": "27f54bba6f69639b3b10ed518ae0eda6",
                "sha256": "19e40f2558e4f3294ce1a95732b134fea3c72318eb503e23263e156a81a3fd14"
            },
            "downloads": -1,
            "filename": "clang_format_docs-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "27f54bba6f69639b3b10ed518ae0eda6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4516,
            "upload_time": "2023-01-09T08:17:01",
            "upload_time_iso_8601": "2023-01-09T08:17:01.972938Z",
            "url": "https://files.pythonhosted.org/packages/0f/c2/b9c91792cb5efc6d76d843fc8932ac3e1e61411a392439cddccd78e40814/clang_format_docs-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-09 08:17:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "finsberg",
    "github_project": "clang-format-docs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "clang-format-docs"
}
        
Elapsed time: 0.05983s