lib.roles.types

Typings for Django Docutils roles for Docutils.

class django_docutils.lib.roles.types.UrlHandlerFn

Bases: Protocol

Protocol for role handler callback maps directly to a URL patern.

class django_docutils.lib.roles.types.RemoteUrlHandlerFn

Bases: Protocol

Protocol for role handler callback that retrieve from external data sources.

django_docutils.lib.roles.types.RoleFnReturnValue
data

Role function return value.

See also

From

:py:obj:`<https://docutils.sourceforge.io/docs/howto/rst-roles.html>`_:`

Role functions return a tuple of two values: - A list of nodes which will be inserted into the document tree at the point where the interpreted role was encountered (can be an empty list). - A list of system messages, which will be inserted into the document tree immediately after the end of the current block (can also be empty).

alias of tuple[list[reference], list[Any]]