Mr.Docs

MrDocsBanner

Mr.Docs is a C++ reference documentation generator built on Clang/LLVM. It reads your project’s source through a compilation database, builds a complete symbol corpus from the real Clang AST, and emits documentation in several formats. The same corpus feeds rendered documents intended for human readers and structured data intended for downstream tools.

graph LR classDef input fill:#D1E8FF,stroke:#005CFF,stroke-width:2; classDef stage fill:#FFF5D1,stroke:#C97A00,stroke-width:2; classDef output fill:#D1FFD1,stroke:#1C7C1C,stroke-width:2; classDef ext fill:#F0E2F0,stroke:#7A4A8E,stroke-width:2,stroke-dasharray:4 2; CPP["C++ source
doc comments"]:::input CFG[Configuration]:::input CORPUS([Symbol corpus]):::stage GENS([Generators]):::stage RENDERED[Rendered documentation]:::output DATA[Structured data]:::output EXT[Extensions]:::ext CPP --> CORPUS CFG --> CORPUS CORPUS --> GENS GENS --> RENDERED GENS --> DATA EXT <-.-> CORPUS EXT <-.-> GENS

What Mr.Docs reads

Real C++ through Clang. Namespaces, classes and structs, function and class templates, concepts, deduction guides, enumerations, type aliases, variables, and using declarations all come through; partial and explicit specializations come along because the parser has resolved them already.

Doc comments in the Javadoc and Doxygen tradition. Block-level commands describe parameters, return values, exceptions, preconditions, and the surrounding prose. Inline commands handle emphasis, code spans, links, math, and the small markup pieces between sentences. The Documenting the Code section spells out which comments Mr.Docs understands and how each one renders.

A function-object template
struct sqrt_fn
{
    /** Compute the integer square root.

        Returns the integer square root of `value`
        via bit manipulation.

        @par Complexity
        Logarithmic in `value`.

        @note Returns zero for zero input.

        @tparam T An integral type.
        @param value The integral value, which must be non-negative.
        @pre `value >= 0`.
        @return The integer square root of `value`.
    */
    template <typename T>
    [[nodiscard]] constexpr
    std::enable_if_t<std::is_integral_v<T>, T>
    operator()(T value) const noexcept;
};

constexpr sqrt_fn sqrt = {};

What Mr.Docs produces

  • Several generators emit documentation in formats ranging from rendered documents for human readers to structured data for downstream tooling.

  • Customizable templates for the rendering generators, so the visual layout and the content shape of the output can be changed without touching the binary.

  • An extension surface that lets users plug in custom generators, register helpers used by the templates, and transform the corpus before it reaches a generator.

The Configuration Options section covers how to select a generator and shape its output. The Generators section covers how templates are organized and how to override or replace them.

PreviewยทThe same declaration, rendered
sqrt

Compute the integer square root.

Synopsis

Declared in <sqrt.cpp>

template<typename T>
[[nodiscard]]
constexpr
T
sqrt(T value) noexcept
requires std::is_integral_v<T>;

This function is defined as an Algorithm Function Object (AFO).

Description

Returns the integer square root of value via bit manipulation.

Complexity

Logarithmic in value.

Returns zero for zero input.

Return Value

The integer square root of value.

Template Parameters

Name

Description

T

An integral type.

Parameters

Name

Description

value

The integral value, which must be non‐negative.

Preconditions
  • value >= 0.

What Mr.Docs makes of the declaration above.

See it in action

The Demo Gallery hosts Mr.Docs-generated reference documentation for several third-party libraries in every supported output format.