This module defines standard interpreted text role functions, a registry for interpreted text roles, and an API for adding to and retrieving from the registry.
The interface for interpreted role functions is as follows:
def role_fn(name, rawtext, text, lineno, inliner,
options={}, content=[]):
code...
# Set function attributes for customization:
role_fn.options = ...
role_fn.content = ...
Parameters:
Function attributes for customization, interpreted by the "role" directive:
options: A dictionary, mapping known option names to conversion functions such as int or float. None or an empty dict implies no options to parse. Several directive option conversion functions are defined in the directives module.
All role functions implicitly support the "class" option, unless disabled with an explicit {'class': None}.
content: A boolean; true if content is allowed. Client code must handle the case where content is required but not supplied (an empty content list will be supplied).
Note that unlike directives, the "arguments" function attribute is not supported for role customization. Directive arguments are handled by the "role" directive itself.
Interpreted role functions return a tuple of two values: