Lua-only module which creates MediaWiki-compatible tables from other Lua modules.
makeMWModule(t, opts)
Replaces all functions in a Lua module with ones that take MediaWiki frame arguments, aliasing the original functions.
Parameters
- t
- Lua table with keys mapped to functions
- opts
- Table containing options to
Module:Arguments.getArgs
(optional)
- Table containing options to
Return values
- A new table
mwt
such that, for every functiont.f
present in the argument table:mwt.f
is a function that accepts a single MediaWiki frame argument, callsModule:Arguments.getArgs
on it (usingopts
as the options table), then forwards the result and the frame itself tot.f
mwt._f == t.f
The above documentation is transcluded from Module:MakeMWModule/doc. (edit | history)