Home
Integration

Doxygen / C++ Docs

Generate API reference from Doxygen XML output.

Sourcey can generate documentation from Doxygen XML output, making it possible to document C and C++ libraries alongside markdown guides in a single site.

Prerequisites

  • Doxygen installed and configured to output XML
  • Your Doxygen XML output directory (usually xml/ inside the Doxygen output directory)

Setup

1

Generate Doxygen XML

Ensure your Doxyfile has XML output enabled:

GENERATE_XML = YES
XML_OUTPUT   = xml

Run Doxygen:

doxygen Doxyfile
2

Configure a Doxygen tab

Add a tab with the doxygen field pointing to your XML output directory:

import { defineConfig } from "sourcey";

export default defineConfig({
  name: "My C++ Library",
  navigation: {
    tabs: [
      {
        tab: "Documentation",
        slug: "",
        groups: [
          { group: "Getting Started", pages: ["introduction"] },
        ],
      },
      {
        tab: "C++ API",
        slug: "cpp-api",
        doxygen: {
          xml: "./doxygen-output/xml",
        },
      },
    ],
  },
});
3

Build

npx sourcey build

The C++ API tab renders classes, functions, enums, and type definitions from the Doxygen output.

Configuration options

doxygen: {
  xml: "./path/to/xml",     // path to Doxygen XML directory (required)
  language: "cpp",           // language hint (default: "cpp")
  groups: false,             // use Doxygen @defgroup for navigation (default: false)
}

How it works

Sourcey uses Moxygen internally to parse Doxygen's XML output into structured documentation. Moxygen is bundled as a dependency; you don't need to install it separately. It extracts classes, functions, enums, typedefs, and their documentation comments from the XML, and sourcey renders them using the same layout, styling, and search indexing as all other pages.

When groups is set to true, sourcey uses Doxygen's @defgroup / @ingroup annotations to organize the sidebar navigation. When false (the default), it organizes by file and namespace.