Doxygen / C++ Docs
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
Generate Doxygen XML
Ensure your Doxyfile has XML output enabled:
GENERATE_XML = YES
XML_OUTPUT = xmlRun Doxygen:
doxygen DoxyfileConfigure 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",
},
},
],
},
});Build
npx sourcey buildThe 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.
