I have a three-layered class structure like this:
class Super(object):
"""This class is documented."""
class Intermediate(Super):
pass
class Sub(Intermediate):
"""This is also documented."""
My index.rst
file looks as follows:
.. automodule:: mymodule
:show-inheritance:
:inherited-members:
Sphinx generates a nice API documentation for me. It includes the classes Super
and Sub
, with the appropriate comments. It does not include Intermediate
, because it doesn't have a comment and I did not supply the undoc-members
flag. This is because I don't want Intermediate
to show up in the documentation.
My problem is this: Because I supply the show-inheritance
flag, Sphinx displays the bases for each class; object
for Super
and Intermediate
for Sub
. Since Intermediate
is undocumented, I do not want it to show up in the list of base classes. Instead, I'd like Sphinx to display the next documented class up in the inheritance tree, Super
. In other words: I want Sphinx to display Super
, not Intermediate
as the base class of Sub
.
Does anybody know how to do this?