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

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.2
File Size Uploaded Provenance Actions
cpdocs-0.5.2.tar.gz 595.2 kB Without provenance Details for cpdocs-0.5.2.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / cpdocs-0.5.2.tar.gz

Download URL cpdocs-0.5.2.tar.gz
Size 595.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a800c42633e3469c71b15038abc50b5415dca91bdf0b5cd62998abef6aad1760
BLAKE2b-256 checksum
How to use checksums
e1ce43a39af80a73e0f64d511bbccadcd161cbb2c71237d6d4a80977f9a4f170
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.2-py3-none-any.whl

Download URL cpdocs-0.5.2-py3-none-any.whl
Size 464.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e0cf0d60fb4cf72f2984afe7e4b07a02d7a58ec6ba0b8e7f6766742262b7d11
BLAKE2b-256 checksum
How to use checksums
e3c32d4902706fc6e217d36e18c7e12e7b9f5d4f50bc0f4ff9838016954e50d5
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.2

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