Search code examples
python-sphinxdoxygen

How to exclude Private members while generating Doxygen


I am trying to use Doxygen and Sphinx to generate documentation for some code. Both are running successfully, and the HTML is generated, but the HTML includes all the private members of the classes. Is it possible to exclude the private members and include only the private functions.

My Doxyfile has these configurations:

EXTRACT_ALL            = NO
EXTRACT_PRIVATE        = YES
EXTRACT_PRIV_VIRTUAL   = YES
EXTRACT_PACKAGE        = NO
EXTRACT_STATIC         = NO
EXTRACT_LOCAL_CLASSES  = YES
EXTRACT_LOCAL_METHODS  = NO

The api.rst file is

.. doxygenindex:: 
   :project: <ProjectName>

Index.rst

.. toctree::
   :maxdepth: 2
   :caption: Contents:


   api

I have tried changing the Doxyfile to exclude all private members which did not work. Also tried excluding it in the conf.py of the sphinx project which also failed.


Solution

  • The private members (variables) are hidden after changing the api.rst file to

    .. doxygenclass:: <class1 name>
        :project: project
    .. doxygenclass:: <class2 name>
        :project: project