lib.roles.types

Typings for Django Docutils roles for Docutils.

class django_docutils.lib.roles.types.UrlHandlerFn(*args, **kwargs)[source]

Bases: Protocol

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

_abc_impl = <_abc._abc_data object>
_is_protocol = True
class django_docutils.lib.roles.types.RemoteUrlHandlerFn(*args, **kwargs)[source]

Bases: Protocol

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

_abc_impl = <_abc._abc_data object>
_is_protocol = True
django_docutils.lib.roles.types.RoleFnReturnValue

Role function return value.

See also

From Docutils: How to: RST Roles:

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]]