{"id":18793581,"url":"https://github.com/kfrlib/cxxdox","last_synced_at":"2025-08-24T00:05:38.942Z","repository":{"id":112868840,"uuid":"225478483","full_name":"kfrlib/cxxdox","owner":"kfrlib","description":"Generates mkdocs files from C++ source code with minimal configuration. Python + libclang, does not use doxygen. Works in docker","archived":false,"fork":false,"pushed_at":"2024-10-30T14:06:59.000Z","size":61,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T15:20:31.359Z","etag":null,"topics":["cpp","documentation-generator","documentation-tool","libclang","markdown","mkdocs","python"],"latest_commit_sha":null,"homepage":"https://www.kfr.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kfrlib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.TXT","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":"2019-12-02T22:10:07.000Z","updated_at":"2024-10-30T14:07:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"e53dbb64-7259-482d-93b9-d231505f481d","html_url":"https://github.com/kfrlib/cxxdox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrlib%2Fcxxdox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrlib%2Fcxxdox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrlib%2Fcxxdox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrlib%2Fcxxdox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfrlib","download_url":"https://codeload.github.com/kfrlib/cxxdox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223590920,"owners_count":17170212,"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":["cpp","documentation-generator","documentation-tool","libclang","markdown","mkdocs","python"],"created_at":"2024-11-07T21:25:54.321Z","updated_at":"2024-11-07T21:25:54.958Z","avatar_url":"https://github.com/kfrlib.png","language":"Python","readme":"# CxxDox - Documentation Generator for C++ with Minimal Configuration\n\nCxxDox is a documentation generator for C++ projects that creates markdown files compatible with `mkdocs` or directly rendered HTML files. This tool is designed to be highly compatible with DOXYGEN syntax and is built with Python and libclang to run in a Docker environment.\n\nUsing `libclang` allows CxxDox to handle complex, template-heavy C++ projects and support the latest C++ standards. This integration ensures reliable parsing of advanced templates, metaprogramming, and new language features, allowing CxxDox to generate accurate documentation even for projects using cutting-edge C++ constructs.\n\nCurrent libclang version: `19` (C++20 and c++23 support)\n\n## Features\n\n- Parses C++ headers, extracting functions, variables, and types, and generates `mkdocs`-compatible Markdown files.\n- Autolinks to the repository (including commit hash).\n- Supports math rendering and syntax highlighting.\n- Generates code snippets, optionally runs them, and includes output in the documentation.\n- Automatically generates an alphabetical index.\n\n### Requirements\n\nTo use CxxDox, you’ll only need Docker.\n\nIf you want to render md files manually you’ll need mkdocs or mkdocs-material with the following plugins:\n  - `codehilite`\n  - `pymdownx.arithmatex` (uses KaTeX for fast math rendering)\n\n### Example Projects\n\nCxxDox is created and used for projects [KFR - C++ DSP library](https://kfr.dev) and [Brisk GUI framework](https://github.com/brisklib/brisk).\n\n## Getting Started\n\n### Building and Running the Docker Container\n\nTo build and run the Docker container for CxxDox:\n\n1. Clone your project and place it in the desired directory structure, as required by `run.sh`.\n2. Use the following Docker commands to build the image and run the container, specifying the necessary arguments to generate HTML documentation.\n\n#### Build Docker Image\n\n```bash\ndocker build -t cxxdox .\n```\n\n#### Run the Docker Container\n\n```bash\ndocker run --rm -v $(pwd)/src:/src -v $(pwd)/out:/out -v $(pwd)/data:/data cxxdox \u003cdoc_dir\u003e\n```\n\n- **`\u003cdoc_dir\u003e`**: Replace this with the path to your documentation directory inside `/src`, which contains the files to be documented along with the `cxxdox.yml` and `mkdocs.yml` config files.\n\n### Configuring `cxxdox.yml`\n\nThe `cxxdox.yml` file is the main configuration file used to customize the behavior of CxxDox for your project. Below is a guide on how to set up `cxxdox.yml`:\n\n#### Key Configuration Options\n\n- **title**: The title of the documentation. \n  ```yaml\n  title: Project Name\n  ```\n\n- **postprocessor.ignore**: A list of macros or qualifiers to ignore while parsing, ensuring specific elements aren't included in the documentation.\n  ```yaml\n  postprocessor:\n    ignore: \n      - ALWAYS_INLINE\n      - PUBLIC_EXPORT\n      - ...\n  ```\n\n- **clang.arguments**: Compiler arguments passed to `libclang` to configure parsing. This can include flags for specific standards or preprocessor definitions.\n  ```yaml\n  clang:\n    arguments: \n      - '-std=gnu++20'\n      - '-DENABLE_AWESOME_FEATURE=1'\n      - ...\n  ```\n\n- **input_directory**: Specifies the directory with the source files to document, relative to the `cxxdox.yml` location.\n  ```yaml\n  input_directory: ../include/your_project\n  ```\n\n- **masks**: Patterns to specify file types or names to be included in parsing (e.g., only header files).\n  ```yaml\n  masks: ['**/*.hpp']\n  ```\n\n- **repository**: Format for linking source files to the repository, enabling auto-linking to specific lines of code.\n  ```yaml\n  repository: https://github.com/your_project/repo/blob/{TAG}/path/to/file/{FILE}#L{LINE}\n  ```\n\n- **groups**: Defines categorized groups for organizing functions or classes within documentation.\n  ```yaml\n  groups:\n    filter: \"Filter API\"\n    array: \"Array functions\"\n    ...\n  ```\n\nFor a full example of a `cxxdox.yml`, refer to this configuration file: https://github.com/kfrlib/kfr/blob/main/docs/cxxdox.yml\n\n### Usage Examples\n\n#### Generating HTML Documentation for a Sample C++ Project\n\nAssuming your project is in a folder named `my_cpp_project`, the following commands will generate the documentation and output it to `./out/site`:\n\n```bash\ndocker run --rm -v $(pwd)/src:/src -v $(pwd)/out:/out -v $(pwd)/data:/data cxxdox my_cpp_project\n```\n\nThis command will:\n- Copy files from `/src/my_cpp_project/` to `/out`.\n- Parse headers, generate Markdown files in `/out/docs`, and then use `mkdocs` to build the site in `/out/site`.\n\n## Demo\n\nView a live demo of the generated documentation [here](https://www.kfrlib.com/newdocs/index.html).\n\n## Version\n\n0.2-beta\n\n## License\n\nLicensed under the Apache License. See `LICENSE.TXT` for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfrlib%2Fcxxdox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfrlib%2Fcxxdox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfrlib%2Fcxxdox/lists"}