Add option include-subclasses to inheritance-diagram #8191
Labels
extensions:graphviz
The `sphinx.ext.graphviz` or `sphinx.ext.inheritance_diagram` extensions
type:enhancement
enhance or introduce a new feature
Milestone
Is your feature request related to a problem? Please describe.
When I have a module that contains many classes and some of them are related through inheritance and some are not, then I have the following problem: I'd like to create an inheritance diagram for one of the classes in this module and all of its subclasses. However when I specify the module in
inheritance-diagram
the diagram will contain the unrelated classes too.top-classes
doesn't work either. The only working approach is to list each of the subclasses individually.Describe the solution you'd like
I'd like an option to specify that any subclass of classes in the list of classes for the
inheritance-diagram
should be included in the diagram too.I.e. if I have a module
m
with the following classes:Then the following Sphinx code:
will create an inheritance diagram including the classes
B
,C
andD
.Additional context
I have this problem in the following project:
http://python.livinglogic.de/XIST_Howto.html
The class
Node
has 25 subclasses, so to showNode
and all of its subclasses the Sphinx code looks like this:With this its likely that I might miss a class when typing this list, or might forget to add it when a new subclass gets added. With the
include-subclasses
option the code would look like this:which IMHO is much simpler and saver.
Pull request
A pull request that implements this feature can be found here:
#8159
The text was updated successfully, but these errors were encountered: