#
7f932642 |
| 12-Jul-2024 |
Juraj Linkeš <juraj.linkes@pantheon.tech> |
dts: add API doc generation
The tool used to generate DTS API docs is Sphinx, which is already in use in DPDK. The same configuration is used to preserve style with one DTS-specific configuration (s
dts: add API doc generation
The tool used to generate DTS API docs is Sphinx, which is already in use in DPDK. The same configuration is used to preserve style with one DTS-specific configuration (so that the DPDK docs are unchanged) that modifies how the sidebar displays the content. There's other Sphinx configuration related to Python docstrings which doesn't affect DPDK doc build. All new configuration is in a conditional block, applied only when DTS API docs are built to not interfere with DPDK doc build.
Sphinx generates the documentation from Python docstrings. The docstring format is the Google format [0] which requires the sphinx.ext.napoleon extension. The other extension, sphinx.ext.intersphinx, enables linking to objects in external documentations, such as the Python documentation.
There is one requirement for building DTS docs - the same Python version as DTS or higher, because Sphinx's autodoc extension imports the code.
The dependencies needed to import the code don't have to be satisfied, as the autodoc extension allows us to mock the imports. The missing packages are taken from the DTS pyproject.toml file.
And finally, the DTS API docs can be accessed from the DPDK API doxygen page.
[0] https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech> Acked-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Jeremy Spewock <jspewock@iol.unh.edu> Reviewed-by: Dean Marx <dmarx@iol.unh.edu> Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
show more ...
|