Breathe
Sphinx plugin providing beautifully integrated Doxygen output for C++ documentation in Sphinx.
cpp
About this Extension
Bridges Doxygen and Sphinx to combine C++ API documentation with user guides. Takes Doxygen’s excellent code parsing and presents it through Sphinx’s superior documentation system.
The workflow
- Doxygen parses your C++ source code and generates XML output
- Breathe reads that XML and creates Sphinx directives
- Sphinx renders everything together with your user documentation
This gives you the best of both worlds: Doxygen’s deep C++ understanding with Sphinx’s powerful documentation features.
What you can document
- C++ classes, functions, enums, and variables
- Function parameters and return values
- Code examples and usage snippets
- Cross-references between API and user guides
- Inheritance diagrams and call graphs
Basic usage
.. doxygenclass:: MyClass
:members:
.. doxygenfunction:: myFunction
.. doxygenstruct:: MyStruct
:members:
Configuration
# conf.py
extensions = ['breathe']
# Point to Doxygen XML output
breathe_projects = {"myproject": "path/to/doxygen/xml/"}
breathe_default_project = "myproject"
# Optional: customize output
breathe_default_members = ('members', 'undoc-members')
Typical project structure
docs/
├── conf.py
├── index.rst
├── api/ # Generated API docs
└── doxygen_xml/ # Doxygen XML output
src/
└── *.cpp, *.h # Your C++ code
Essential for C++ projects where you want comprehensive API documentation integrated with user guides, tutorials, and examples.