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.5

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.5
File Size Uploaded Provenance Actions
cpdocs-0.5.5.tar.gz 596.8 kB Without provenance Details for cpdocs-0.5.5.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / cpdocs-0.5.5.tar.gz

Download URL cpdocs-0.5.5.tar.gz
Size 596.8 kB
Tags Source
SHA-256 checksum
How to use checksums
130d4cfdd8d481c0cf3bac56f3383c4da2529a958deb6742bc188d661e26958f
BLAKE2b-256 checksum
How to use checksums
160faddb7b4a687a8cc28b70cd4c1704a818fc4d5eb4bcbde179f2022a8c6dd4
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.9"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.6.5 29 Sep 2026","python":"3.14.9","system":{"name":"Linux","release":"6.18.60-1-lts"}} HTTPX2/2.13.1

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

Download URL cpdocs-0.5.5-py3-none-any.whl
Size 465.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cdca737a86925641fc2ee98d71b58bc3b8269086918a912052b86efc2ac56f1
BLAKE2b-256 checksum
How to use checksums
de39204dbfe189c06d0f2fce0dd3162a6ff16497ad4fe5da9b0e220f114afa76
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.9"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.6.5 29 Sep 2026","python":"3.14.9","system":{"name":"Linux","release":"6.18.60-1-lts"}} HTTPX2/2.13.1

Security for cpdocs 0.5.5

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