API¶
autodoc directive for Python APIs¶
Use the sphinx feature autodoc to automatically document an API by using the docstrings of related python based objects (modules, classes, functions, …).
|
Connected objects
Flowchart
How can I document the API of my Python based application? |
Documentation generation framework for “Doc-As-Code” approach. |
No needs passed the filters
Doxygen + breathe for C++ APIs in Sphinx¶
Doxygen must be installed on the system! And Breathe must be installed as Python package on the used virtual environment. # conf.py
# Executes doxygen.
# This makes sure that the extension "breathe" has access to the latest API information.
extensions = ['breathe']
if shutil.which("doxygen"):
breathe_projects = {
"doxygen_example": "_build/doxygen/xml"
}
breathe_default_project = "doxygen_example"
if not os.environ.get("SKIP_DOXYGEN", None) == "True":
for prjname, prjdir in breathe_projects.items():
print("Generating doxygen files for {}...".format(prjname))
os.makedirs(prjdir, exist_ok=True)
cmd = "cd code && doxygen {}.dox".format(prjname)
subprocess.call(cmd, shell=True)
else:
for prjname, prjdir in breathe_projects.items():
assert os.path.exists(prjdir) == True, \
"Regenerate doxygen XML for {}".format(prjname)
.. index.rst
.. doxygenfile:: doxygen_example.hpp
:project: doxygen_example
|
Connected objects
Flowchart
I document my C++ APIs via Doxygen. Is there a way to do the API documentation of C++ inside Sphinx? |
Documentation generation framework for “Doc-As-Code” approach. |
Breathe provides a bridge between the Sphinx and Doxygen documentation systems. |
Demo documents a C++ based API. The API docs gets first generated by |
||