Lua templating/FAQ

This page contains some frequent questions related to Lua templating.

What is lua?
Lua is a programming language made available through Extension:Scribunto, that allows for the creation of powerful templates.

Can I access lua modules stored in another wiki?
Yes, all wikis can use any module stored in dev.wikia.com, but not any other wiki.

Can I do anything with modules that I can with templates?

Yes, generally speaking. One can use modules to do "almost everything" that is done with templates, in fact there are things that can only be done with modules.

Are there any limits?

Yes. Lua can only execute for 10 seconds on Wikia, and it also has memory limits.

Can I pass a variable to another module on the same page?
No. Scribunto is purposely designed to prevent this.

Are there any built-in mediawiki libraries available for use?Yes.

Are there tools for debugging a module?
Yes, there is a builtin debug console in every module page, and there are lua modules that facilitate debugging.

Can I access the name of the page that contains the lua invocation ( {{ #invoke) ?
Yes. One can use the something like "frame.getParent:getTitle" to do so.

Can I access the parent page's arguments?
Yes. One can get those arguments using "frame.getParent.args".

Is it compatible with extensions?
While most extensions may work directly, some are not fully compatible. For example, one cannot use the mw.html library to create Portable infoboxes.

Can lua retrieve pages within a category like dpl?
No. As of 2016/07, Scribunto does not have this capability.