Cross-Linking
A good API reference reads like a connected graph: click a parameter’s type and land on its page. docsgen builds those links automatically.
What gets linked
Section titled “What gets linked”Before rendering, docsgen builds an index from every public symbol’s name to its generated file. It then resolves references in:
- Parameter types in the Parameters table.
- Return types in the Returns line.
- Member and field types on struct/class pages.
@seeentries that name a symbol.- Base classes / related types surfaced in See Also.
A reference like const Endpoint& renders as const [Endpoint](/net_endpoint)& — the type name becomes a link, the qualifiers stay as text.
URLs and --base-url
Section titled “URLs and --base-url”A symbol’s URL is derived from its qualified name: lowercased, with :: flattened to _. So:
| Symbol | URL |
|---|---|
net::Socket | /net_socket |
net::SocketOptions::keepAlive | /net_socketoptions_keepalive |
By default links are rooted at /. If your docs are served under a sub-path, set a prefix:
docsgen --base-url /api# or in config.docsgen.yamlapi_base_url: /apiTrailing slashes are stripped, so /api/ and /api behave the same. Every generated link is then prefixed (/api/net_socket).
@see resolution order
Section titled “@see resolution order”For each @see entry, docsgen tries, in order:
- URL — starts with
http://orhttps://⇒ rendered as a plain link. - Symbol — matches a known symbol name ⇒ linked to its page (the raw, unescaped name is used for the lookup so it matches the index).
- Plain text — no match ⇒ rendered as-is.
/// @see Endpoint // -> link to /net_endpoint/// @see https://datatracker.ietf.org/doc/html/rfc793 // -> external link/// @see the design notes in DESIGN.md // -> plain textIf a @see you expected to link renders as plain text, the name didn’t match a documented symbol — usually because it’s private, in an excluded namespace, or spelled differently than its qualified name. Check Public API Surface.
Stable links across runs
Section titled “Stable links across runs”Because URLs are derived deterministically from qualified names, links don’t churn between runs unless you rename a symbol. That keeps your generated docs diff-friendly and safe to commit.