mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #5029 from kmaehashi/autosummary-inherited-docs
autosummary: expose inherited_members to template
This commit is contained in:
commit
40ee7cd0c4
@ -205,6 +205,11 @@ The following variables available in the templates:
|
||||
List containing names of all members of the module or class. Only available
|
||||
for modules and classes.
|
||||
|
||||
.. data:: inherited_members
|
||||
|
||||
List containing names of all inherited members of class. Only available for
|
||||
classes.
|
||||
|
||||
.. data:: functions
|
||||
|
||||
List containing names of "public" functions in the module. Here, "public"
|
||||
|
@ -203,6 +203,8 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
|
||||
get_members(obj, 'exception', imported=imported_members)
|
||||
elif doc.objtype == 'class':
|
||||
ns['members'] = dir(obj)
|
||||
ns['inherited_members'] = \
|
||||
set(dir(obj)) - set(obj.__dict__.keys())
|
||||
ns['methods'], ns['all_methods'] = \
|
||||
get_members(obj, 'method', ['__init__'])
|
||||
ns['attributes'], ns['all_attributes'] = \
|
||||
|
Loading…
Reference in New Issue
Block a user