TraitDocumenter#
- class TraitDocumenter(*args, observers=None, validators=None, **kwargs)#
Bases:
AttributeDocumenterDocumenter for Trait objects.
- Parameters:
observers (abc.Sequence[ObjectMember] | None)
validators (abc.Sequence[ObjectMember] | None)
- __init__(*args, observers=None, validators=None, **kwargs)#
- add_directive_header(sig)#
Add directives to the object header.
Overwrite completely implementation from AttributeDocumenter to obtain the typehint from the trait itself, and remove the value directive (default value is documented elsewhere).
- Parameters:
sig (str)
- Return type:
None
- classmethod can_document_member(member, membername, isattr, parent)#
Can this class document this member.
‘_subsections’ attribute is not documented.
- property fixable: tuple[str, list[str]] | None#
If trait correspond to a fixable parameter.
ie a parameter defined in a filename pattern from
filefinder.
- get_doc()#
Return documentation paragraphs.
This overwrite gets the documentation from the help attribute of traits, and add metadata/information about the trait (default value, etc.).
The metadata is dictated by the properties listed in
metadata_properties.
- property max_length: tuple[str, list[str]] | None#
Maximum length of a list/set, if less than sys.maxsize (default).
- metadata_properties = ['default_value', 'accepted_values', 'per_key_traits', 'min_length', 'max_length', 'configurable', 'read_only', 'fixable', 'observed', 'validated']#
Metadata properties in the order they should appear in doc.
All properties should return a tuple of the name of the property, and a list of lines that document this property. It can return None if the property should be skipped. Formatting will be done elsewhere.
- property min_length: tuple[str, list[str]] | None#
Minimum length of a list/set, if greater than 0 (default).
- objtype = 'trait'#
name by which the directive is called (auto…) and the default generated directive name
- priority = 20#
priority if multiple documenters return True from can_document_member