sphinx-autodoc2 icon indicating copy to clipboard operation
sphinx-autodoc2 copied to clipboard

Inner exceptions are missing

Open davidselassie opened this issue 1 year ago • 0 comments

I have an exception defined as a nested inner class. It ends up being missing from the resulting documentation. Other exceptions and other nested inner classes do appear, though.

class OuterEx(Exception):
    """This exception is in the module.

    This is rendered.
    """
    pass

class ContainingCls:
    """This is the containing class.

    This is rendered.
    """

    class InnerCls:
        """This is an inner regular class.

        This is rendered."""
        pass

    class InnerEx(Exception):
        """This is an inner exception.

        This is missing!
        """
        pass

Resulting RST:

:py:mod:`test_pkg`
==================

.. py:module:: test_pkg

.. autodoc2-docstring:: test_pkg
   :allowtitles:

Package Contents
----------------

Classes
~~~~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`ContainingCls <test_pkg.ContainingCls>`
     - .. autodoc2-docstring:: test_pkg.ContainingCls
          :summary:

API
~~~

.. py:exception:: OuterEx()
   :canonical: test_pkg.OuterEx

   Bases: :py:obj:`Exception`

   .. autodoc2-docstring:: test_pkg.OuterEx

   .. rubric:: Initialization

   .. autodoc2-docstring:: test_pkg.OuterEx.__init__

.. py:class:: ContainingCls
   :canonical: test_pkg.ContainingCls

   .. autodoc2-docstring:: test_pkg.ContainingCls

   .. py:class:: InnerCls
      :canonical: test_pkg.ContainingCls.InnerCls

      .. autodoc2-docstring:: test_pkg.ContainingCls.InnerCls

davidselassie avatar Jan 10 '24 19:01 davidselassie