1

Using the defgroup Doxygen keyword in a Doxygen comment block, it is possible to define a "module". Then, using the ingroup Doxygen keyword in any other Doxygen comment block, even in other source files, it is possible to add cpp classes and enums to the defined module.

Then, running doxygen doxyfile, the documentation is generated, and it has a nice modules tab, where all the defined modules are listed, one per line.

I have a C++ project and I would like to also have this module list that Doxygen generates in Sphinx. I activated the autodoc, breathe and exhale sphinx extensions.

Running make html runs Doxygen and generates the sphinx documentation, but the list of modules generated by Doxygen is missing in sphinx. In conf.py I have

# Setup the `exhale` extension
exhale_args = {
# These arguments are required.
"containmentFolder":     "./api",
"rootFileName":          "library_root.rst",
"rootFileTitle":         "Library API",

the api/library_root.html generated by sphinx/exhale has a nice expandable list of all namespaces, each containing all its classes and enums. It also has another nice expandable list of all directories in the project, each with all its files.

So my question is this - how can I get sphinx to also generate the list of modules which doxygen has no trouble generating? It doesn't matter if in the library_root.html or another HTML file.

I found that if I use the name Doxygen keyword, like this: name module1 in a Doxygen comment (with leading backslash or at symbol) breathe seems to recognize it, whereas it seems to not recognize and ignore defgroup/ingroup. So, in an rst file, I can then manually say

.. doxygengroup:: module1
   :outline:
.. doxygengroup:: module2
   :outline:
.. doxygengroup:: module3
   :outline:

to get the list of modules, (they are labeled group not module) but I want this to be autogenerated, like in Doxygen, where I just define the modules in Doxygen comments in the source, and then they all appear in the modules tab in the Doxygen output without having to do anything else. I would prefer that they are labeled module, but I can live with group as long as it works.

I also tried adding in index.rst

.. automodule:: My Project
   :members:

before .. toctree:: but that has no effect, it probably only works in Python. I use Linux and have Sphinx 1.6.7 on one machine and 1.8.5 on another, Python 2.7

bad_coder
  • 11,289
  • 20
  • 44
  • 72
jmarina
  • 333
  • 1
  • 2
  • 8
  • I was looking for the same feature, but looks like it's not there. I see in the [Exhale](https://github.com/svenevs/exhale) repo, in `exhale/graphs.py`, what appears to be a comment about `groups` list being populated, but not being used. – NameRakes Jan 09 '21 at 06:19

0 Answers0