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.
Contents
Objects
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.
macro object
Attributes:
parser: MoinMoin.parser instance
- form: CGI Form dictionary
request: MoinMoin.request.requestcgi
formatter: MoinMoin.formatter.text_html.formatter
cfg = MoinMoin.wikiconfig.config instance
Modules
The following modules can be imported into macro code.
MoinMoin.widget.*
TODO
MoinMoin.formatter.*
TODO
MoinMoin.i18n.*
TODO