There's a large number of useful libraries sitting around inside MoinMoin which provide a way to create robust macro code which pays attention to system wide configuration and styles.
Here I try to explore and document these libraries - or at least make reference to them so you don't need to go searching through the code every time you want to work out how to do something.
Macros are defined by creating a file named macro_name.py within which a function execute must be defined. The execute function takes two parameters: macro and arguments.
arguments is a string (yes a string, it is not a list) which is defined by the value specified between the ( and ) characters in the macro call.
macro is a MoinMoin.wikimacro.Macro instance which contains all sorts of useful information about the request being made.
parser: MoinMoin.parser instance
- form: CGI Form dictionary
cfg = MoinMoin.wikiconfig.config instance
The following modules can be imported into macro code.