docutils.parsers.rst.directives.parts module

Directives for document parts.

class Contents(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: Directive

Table of contents.

The table of contents is generated in two passes: initial parse and transform. During the initial parse, a ‘pending’ element is generated which acts as a placeholder, storing the TOC title and any options internally. At a later stage in the processing, the ‘pending’ element is replaced by a ‘topic’ element, a title and the table of contents proper.

optional_arguments = 1

Number of optional arguments after the required arguments.

final_argument_whitespace = True

May the final argument contain whitespace?

option_spec = {'backlinks': <function Contents.backlinks>, 'class': <function class_option>, 'depth': <function nonnegative_int>, 'local': <function flag>}

Mapping of option names to validator functions.

run()[source]
class Sectnum(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: Directive

Automatic section numbering.

option_spec = {'depth': <class 'int'>, 'prefix': <function unchanged_required>, 'start': <class 'int'>, 'suffix': <function unchanged_required>}

Mapping of option names to validator functions.

run()[source]
class Header(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: Directive

Contents of document header.

has_content = True

May the directive have content?

run()[source]
class Footer(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: Directive

Contents of document footer.

has_content = True

May the directive have content?

run()[source]