Breathe

4.36.0 · active · verified Sat Apr 11

Breathe is a Sphinx plugin that provides a bridge between the Sphinx documentation system and Doxygen's XML output. It allows users to integrate Doxygen's comprehensive technical documentation of C, C++, and other languages directly into Sphinx-generated documentation, offering an 'autodoc'-like experience for non-Python projects. The current stable version is 4.36.0, with releases typically occurring a few times a year to maintain compatibility with Sphinx and Doxygen updates.

Warnings

Install

Imports

Quickstart

To use Breathe, first configure Doxygen to generate XML output (`GENERATE_XML = YES`). Then, in your Sphinx `conf.py`, add `breathe` to your `extensions` list and configure `breathe_projects` to point to your Doxygen XML output directory. Finally, use Breathe's reStructuredText directives (e.g., `.. doxygenclass::`, `.. doxygenfunction::`) in your `.rst` files to include the Doxygen documentation.

# 1. In your Doxyfile (generated by Doxygen -g), ensure:
#    GENERATE_XML = YES
# 2. In your Sphinx conf.py:
import os

project = 'MyProject'
copyright = '2026, MyName'
author = 'MyName'

extensions = [
    'sphinx.ext.autodoc',
    'breathe'
]

# Path to the directory containing Doxygen's XML output
breathe_projects = {
    "myproject": os.path.abspath(os.path.join(os.path.dirname(__file__), "_build/doxygen/xml"))
}

breathe_default_project = "myproject"

# 3. In an .rst file (e.g., index.rst or a new file like api.rst):
# .. doxygenclass:: MyNamespace::MyClass
#    :project: myproject
#    :members:
#
# .. doxygenfunction:: my_function(int, int)
#    :project: myproject

view raw JSON →