Package
docutils.parsers.rst.directives

This package contains directive implementation modules.

The interface for directive functions is as follows:

def directive_fn(name, arguments, options, content, lineno,
                 content_offset, block_text, state, state_machine):
    code...

# Set function attributes:
directive_fn.arguments = ...
directive_fn.options = ...
direcitve_fn.content = ...

Parameters:

Function attributes, interpreted by the directive parser (which calls the directive function):

Directive functions return a list of nodes which will be inserted into the document tree at the point where the directive was encountered (can be an empty list).

See Creating reStructuredText Directives for more information.