This page contains some frequent questions related to Lua templating.
What is Lua?
How do I convert templates to modules?
How do I document Lua modules?
Unlike the template namespace, the whole module namespace is only meant for valid Lua code. So a module should be documented elsewhere, e.g. Module:mymodule -> Template:mymodule/doc or simply on the talk page.
Can I access Lua modules stored in another wiki?
- Main article: Global Lua Modules
Yes, all wikis can use any module stored in dev.fandom.com, but not any other wiki.
Can I do everything with modules that I can with templates?
Are there things that can only be done with modules?
Are there any limits?
Yes. Lua can only execute for 10 seconds on Fandom, and it also has memory limits .
Can I pass a variable to another module on the same page?
Are there any built-in mediawiki libraries available for use?
- Main article: Lua templating/Reference manual/Scribunto libraries
Are there tools for debugging a module?
- Main article: Lua templating/Debug console
Yes, there is a built-in debug console on every module page, and there are modules that facilitate debugging.
Can I access the name of the page that contains the Lua invocation?
Yes, using "frame.getParent():getTitle".
Can I access the parent page's parameters?
Yes, using "frame.getParent().args".
How do I view the Lua errors?
It depends. If the error is on a page it will get added to Category:Pages with script errors. The text containing "script error" is a clickable link that will make it possible to view the Stack trace.
Is it compatible with extensions?
Can Lua retrieve pages within a category?
No. As of 2016/07, Scribunto does not have this capability, and this is only available in extensions.