autodoc_trait#

Autodoc extension for automatic documentation of Traits.

Add the extension to your sphinx config (in conf.py):

extensions = [
    ...,
    "data_assistant.autodoc_trait",
]

This adds a new autodoc directive for sections (and applications):

.. autosection:: my_module.MySection

It will list traits from all subsections. It will not document any other attribute or methods.

Note

This uses the legacy autodoc implementation but it does not require you to activate it in your configuration.

Options#

Other autodoc options apply, but not all may work.

:inherited-members: (comma separated list)#

Works the same as for autodoc. If present, document traits the section inherits from parent classes. If a comma separated list, do not document traits inherited from those classes.

:member-order: (alphabetical, bysource or traits-first)#
  • alphabetical: Sort every trait and section in alphabetical order.

  • bysource: Keep the order from the source files.

  • traits-first: Keep the order from the source files, but put the traits of a section before its subsections.

:only-configurable:#

Only document configurable traits.

Functions

member_order_option(arg)

setup(app)

skip_trait_member(app, what, name, obj, ...)

Decide whether to skip trait autodoc.

Classes

PyAttributeFullkeyTOC(name, arguments, ...)

Attribute that displays the full key in TOC.

PyAttributeSubsection(name, arguments, ...)

Attribute that adds 'subsection' before signature.

SectionDocumenter(*args)

Documenter for Section objects.

SubsectionDocumenter(directive, name[, indent])

Document for subsections.

TraitDocumenter(*args[, observers, validators])

Documenter for Trait objects.