If supplied, this fuction will be called when macro markup is found, unless the macro is in one of macro dictionaries above. The function must accept the following postional arguments:
- macro name (string)
- the argument, including any delimter (string)
- the macro body (string or None for a macro without a body)
- macro type (boolean, True for block macros, False for normal macros)
The function may return a string (which will be subject to further wiki processing) or a Genshi object (Stream, Markup, builder.Fragment, or builder.Element). If None is returned, the markup will be rendered unchanged.
- the environ object (see creoleparser.core.Parser.parse())
Dictionary of macros (functions). If a bodied macro is found that is not in this dictionary, macro_func (below) will be called instead. Each function must accept the following positional arguments:
If the found macro includes arguments, they will be included in the function call. Creoleparser will handle exceptions by returning an error message in place of the macro (possibly including a traceback). Python’s syntax for accepting arbitrary arguments is often used for macros (e.g.,def mymacro(macro, env, *pos, **kw)).
For information on return values, see macro_func (below).