autoclasstoc.AutoClassToc

class autoclasstoc.AutoClassToc(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Generate a succinct TOC for automatically documented classes.

This class implements the autoclasstoc directive. More specifically, it implements the run function as expected by docutils. However, most of the actual logic is delegated to other classes and functions.

Public Data Attributes:

optional_arguments

Number of optional arguments after the required arguments.

option_spec

Mapping of option names to validator functions.

Inherited from SphinxDirective

env

Reference to the BuildEnvironment object.

config

Reference to the Config object.

Inherited from Directive

required_arguments

Number of required directive arguments.

optional_arguments

Number of optional arguments after the required arguments.

final_argument_whitespace

May the final argument contain whitespace?

option_spec

Mapping of option names to validator functions.

has_content

May the directive have content?

Public Methods:

run()

Create the nodes that will represent the class TOC.

Inherited from SphinxDirective

get_source_info()

Get source and line number.

set_source_info(node)

Set source and line number to the node.

get_location()

Get current location info for logging.

Inherited from Directive

__init__(name, arguments, options, content, ...)

run()

directive_error(level, message)

Return a DirectiveError suitable for being thrown as an exception.

debug(message)

info(message)

warning(message)

error(message)

severe(message)

assert_has_content()

Throw an ERROR-level DirectiveError if the directive doesn't have contents.

add_name(node)

Append self.options['name'] to node['names'] if it exists.


Full Documentation:

option_spec = {'exclude-sections': <function comma_separated_list>, 'sections': <function comma_separated_list>}

Mapping of option names to validator functions.

optional_arguments = 1

Number of optional arguments after the required arguments.

run()[source]

Create the nodes that will represent the class TOC.