SectionDocumenter#

class SectionDocumenter(*args)#

Bases: ClassDocumenter

Documenter for Section objects.

Currently, custom class documenters are not working that well together with autosummary. Autosummary only works with hardcoded object types (the objtype) attribute: ‘class’, ‘function’, etc. Anything else will be listed as ‘data’. And we cannot use another directive than autoclass, since this is what autosummary will generate. For the moment, we override the class documenter. See <https://github.com/sphinx-doc/sphinx/issues/12021>.

Parameters:

args (Any)

_sort_members(members, order)#

Sort members.

The argument is a dict of tuple: (<trait or section>, <fullname>).

Parameters:
Return type:

list[ObjectMember]

document_members(want_all=False)#

Generate reST for member documentation.

If all_members is True, document all members, else those given by self.options.members.

Parameters:

want_all (bool)

get_object_members(want_all)#

Get object members.

I use my own thing here to get traits from all subsections. I explore the base class to get inherited members and keep the order of members of the source file.

Parameters:

want_all (bool)

Return type:

tuple[bool, list[ObjectMember]]

objtype = 'section'#

name by which the directive is called (auto…) and the default generated directive name

priority = 65#

priority if multiple documenters return True from can_document_member