autoclasstoc.PublicDataAttrs

class autoclasstoc.PublicDataAttrs(state, cls)

Include a “Public Data Attributes” section in the class TOC.

Note that only data attributes defined at the class level will be included in the TOC. Data attributes defined in __init__() (for example) will not be found.

Public Data Attributes:

key

title

Inherited from Section

key

title

include_inherited

exclude_pattern

exclude_section

Public Methods:

predicate(name, attr, meta)

Return true if the given attribute should be included in this section.

Inherited from Section

__init__(state, cls)

Create a section for a specific class.

__init_subclass__()

Keep track of any Section subclasses that are defined.

check()

Raise ConfigError if the section has not been configured correctly, e.g.

format()

Return a list of docutils nodes that will compose the section.

predicate(name, attr, meta)

Return true if the given attribute should be included in this section.

Private Methods:

Inherited from Section

_make_container()

Create the container node that will contain the entire section.

_make_rubric()

Create the section header node.

_make_links(attrs, cls)

Make a link to the full documentation for each attribute.

_make_inherited_details(parent)

Make a collapsible node to contain links to inherited attributes.

_filter_attrs(attrs)

Return only those attributes that match the predicate.

_find_attrs()

Return all attributes associated with this class.

_find_inherited_attrs()

Find attributes that this class has inherited from other classes.


Full Documentation:

key = 'public-attrs'
predicate(name, attr, meta)[source]

Return true if the given attribute should be included in this section.

Parameters:
  • name (str) – The name of the attribute. In most cases, this is identical to attr.__name__.

  • attr (object) – The attribute object itself.

  • meta (dict) – Any :meta: fields present in the attribute’s docstring, as parsed by sphinx.util.docstrings.separate_metadata().

title = 'Public Data Attributes:'