| Vorlagen- programmierung |
Diskussionen | Lua | Unterseiten | ||||||
| Modul | Deutsch | English | Esperanto | Dolnoserbski | Hornjoserbsce | Modul: | WP:Lua | ||
LuaWiki – Module with functions for Lua programming in context of a Wiki project.
No direct usage by templates.
Transclusion into own module via require() as follows:
local LuaWiki = require( "Module:LuaWiki" )
if type( LuaWiki ) == "table" then
LuaWiki.setFrame( frame )
else
-- appropriate error management; e.g. message within functions for templates
end
Thereafter the functions can be accessed; do not forget initialization.
arg – string or number; argument identifierassign – optional; default value of any type, if not provided in template transclusion{{{<arg>}}}seek – string; name of variable, like "PAGENAME"numeric – boolean, optional; true: seek is numeric (else string)request – table; selection of variables
"PAGENAME"true#ifexist
seek – string; full page nameframe – frame objects – string; full page name (if namespace not provided Template: will be used)args – table, optional; arguments
The initialization is important: On start the frame object of current template environment needs to be set by LuaWiki.setFrame( frame ) – this won’t be checked any more.
General library; no limitations.
None.