Skip to main content

cpdocs

cpdocs generates semantic, versioned API documentation for C, C++, CUDA, HIP, Fortran, Python and Rust projects.

  • Semantic. cpdocs reads the source with each language's own tools, Clang for the C family, Python's ast, rustdoc for Rust and a module reader for Fortran, and works from the resulting comment-preserving syntax tree. The reference shows declarations as the compiler sees them: namespaces, types, overloads, templates and their documentation, rendered as HTML.
  • Versions. It documents the branches and tags you list, each as its own version of the reference, with a version switcher between them.
  • Build variants. Projects often expose different APIs in different builds, for example with or without MPI. Two hooks, commands run by cpdocs, connect it to the project's build system: the first lists every variant worth documenting, and the second builds one variant and describes its API. cpdocs runs the second hook once per variant.
  • One merged reference. The APIs of all variants are merged into one reference. Every declaration and every overload shows the variants it is available in, and definitions in different languages, such as a C++ and a CUDA implementation, stay separate entries.
  • Language standards. The same project can be documented for several language standards or versions, such as C++17, C++20 and C++23 or Python 3.11 and 3.12, with availability marked the same way.
  • ProperDocs. The reference is a standalone HTML site, and cpdocs integrates with ProperDocs for the project website around it.
  • Versioned API in an unversioned website. The cpdocs ProperDocs plugin embeds the versioned API reference in the project website. Every version of the API lives below one mount point, so the website itself needs no versioning and links such as @apidocs::demo::solve resolve to the right page.

cpdocs keeps no knowledge of the project's features or build: everything it knows about a variant comes from the build system through the hooks.

Quick start

docs/cpdocs.yml names the two hooks and the versions to publish:

contract: 3

build:
  feature-sets: >
    cmake -S "{{source}}" -B "{{tmpdir}}" -G Ninja
    -DCPDOCS_FEATURE_SETS_OUTPUT="{{output-file}}"
  build: >
    cmake -S "{{source}}" -B "{{tmpdir}}" -G Ninja
    -DCPDOCS_FEATURE_SET="{{feature-set}}"
    -DCPDOCS_MANIFEST_OUTPUT="{{output-file}}"

versions: [main, v2.0.0, v1.0.0]
cpdocs build          # document the working tree into build/cpdocs/current
cpdocs versions       # document every listed version into build/cpdocs/versions
properdocs build      # build the project website with the versioned API mounted

The documentation starts with a tutorial and explains each capability in a how-to guide. The examples/ directory holds standalone projects, all built by the test suite, covering plain CMake, generated headers, build variants, language standards, Python, Fortran and Rust.

Development

uv sync
uv run pytest
uv run ruff check && uv run ruff format --check

The C and C++ tests need clang++, cmake and ninja. Building the Rust example also needs the nightly toolchain pinned by examples/rust-basic/rust-toolchain.toml. How the code is organized is described in the architecture page.

Metadata

Release files for cpdocs 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cpdocs 0.5.3
File Size Uploaded Provenance Actions
cpdocs-0.5.3.tar.gz 595.6 kB Without provenance Details for cpdocs-0.5.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cpdocs 0.5.3
File Interpreter ABI Platform Actions
cpdocs-0.5.3-py3-none-any.whl Python 3 none any Details for cpdocs-0.5.3-py3-none-any.whl

Total release size: 1.1 MB

Release files / cpdocs-0.5.3.tar.gz

Download URL cpdocs-0.5.3.tar.gz
Size 595.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e83ef56d7d7fa60a4309d91ea5661527352d42a219dd66a4151eba1b884fea06
BLAKE2b-256 checksum
How to use checksums
156295c48c6b2f3a8ec0192cc5719674706df3065f8bcc4e5644fdf6f9b00d0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":null,"cpu":"x86_64","distro":{"libc":{"lib":"glibc","version":"2.44"},"name":"Arch Linux"},"implementation":{"name":"CPython","version":"3.14.8"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.6.5 29 Sep 2026","python":"3.14.8","system":{"name":"Linux","release":"6.18.57-2-lts"}} HTTPX2/2.13.1

Release files / cpdocs-0.5.3-py3-none-any.whl

Download URL cpdocs-0.5.3-py3-none-any.whl
Size 465.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8970aee7ab22a38cdb1fc6de58738e0911bef66dde66fe446f9f3d41b2fced1e
BLAKE2b-256 checksum
How to use checksums
2da4bbf3b056b85fb1134ca14ebb230ef9ab9a95084df5a4269a42258a07e82b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":null,"cpu":"x86_64","distro":{"libc":{"lib":"glibc","version":"2.44"},"name":"Arch Linux"},"implementation":{"name":"CPython","version":"3.14.8"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.6.5 29 Sep 2026","python":"3.14.8","system":{"name":"Linux","release":"6.18.57-2-lts"}} HTTPX2/2.13.1

Security for cpdocs 0.5.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page