You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to document a private (name begins with 2 underscores) inner class.
"""A module to test Sphinx... autoclass:: _Foo :members:.. autoclass:: sphinxtest._Foo._Foo__Bar :members:"""importenumclass_Foo(object):
"""A class to test Sphinx. :param name: The name of the Foo. :type name: str """def__init__(self, name):
self.__name=nameclass__Bar(enum.Enum):
"""A private inner class."""BAZ=None"""A ``BAZ`` is a baz."""
Note that the class name in the autoclass directive is the mangled name.
The only mention of the inner class in the generated HTML is:
<dlclass="py attribute"><dtclass="sig sig-object py" id="sphinxtest._Foo._Foo__Bar"><spanclass="sig-prename descclassname"><spanclass="pre">sphinxtest._Foo.</span></span><spanclass="sig-name descname"><spanclass="pre">_Foo__Bar</span></span><aclass="headerlink" href="#sphinxtest._Foo._Foo__Bar" title="Permalink to this definition">¶</a></dt><dd><p>alias of <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">__Bar</span></code></p></dd></dl>
Neither the docstring of the inner class nor its member are documented.
How to Reproduce
See Python module (sphinxtest.py) above.
index.rst:
.. SphinxTest documentation master file, created by sphinx-quickstart on Mon Feb 6 10:28:42 2023. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive.
Welcome to SphinxTest's documentation!
======================================
.. toctree::
:maxdepth:2:caption:Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
conf.py:
# Configuration file for the Sphinx documentation builder.## This file only contains a selection of the most common options. For a full# list see the documentation:# https://www.sphinx-doc.org/en/master/usage/configuration.html# -- Path setup --------------------------------------------------------------# If extensions (or modules to document with autodoc) are in another directory,# add these directories to sys.path here. If the directory is relative to the# documentation root, use os.path.abspath to make it absolute, like shown here.#importosimportsyssys.path.insert(0, os.path.abspath('../..'))
# -- Project information -----------------------------------------------------project='SphinxTest'copyright='2023, Ian Pilcher'author='Ian Pilcher'# -- General configuration ---------------------------------------------------# Add any Sphinx extension module names here, as strings. They can be# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom# ones.extensions= [ 'sphinx.ext.autodoc' ]
# Add any paths that contain templates here, relative to this directory.templates_path= [ '_templates' ]
# List of patterns, relative to source directory, that match files and# directories to ignore when looking for source files.# This pattern also affects html_static_path and html_extra_path.exclude_patterns= []
# -- Options for HTML output -------------------------------------------------# The theme to use for HTML and HTML Help pages. See the documentation for# a list of builtin themes.#html_theme='alabaster'#import sphinx_py3doc_enhanced_theme#html_theme = 'sphinx_py3doc_enhanced_theme'#html_theme_path = [ sphinx_py3doc_enhanced_theme.get_html_theme_path() ]# Add any paths that contain custom static files (such as style sheets) here,# relative to this directory. They are copied after the builtin static files,# so a file named "default.css" will overwrite the builtin "default.css".html_static_path= [ '_static' ]
Describe the bug
I am attempting to document a private (name begins with 2 underscores) inner class.
Note that the class name in the
autoclass
directive is the mangled name.The only mention of the inner class in the generated HTML is:
Neither the docstring of the inner class nor its member are documented.
How to Reproduce
See Python module (
sphinxtest.py
) above.index.rst
:conf.py
:Environment Information
Sphinx extensions
Additional context
No response
The text was updated successfully, but these errors were encountered: