Help:Lua
Jump to navigation
Jump to search
The integration of the Lua programming language into MediaWiki software is done through Extension:Scribunto
Modules
Lua scripts are stored as wiki pages in the Module namespace. These modules can contain functions, data, or anything else that can be scripted, which other wiki pages can then invoke.
Templates
Instead of complex wikitext and parser functions, templates can now call Lua functions for more sophisticated logic or data processing, making them easier to maintain and more powerful.
Advantages
- Performance: Lua scripts are generally faster than parsing complex wikitext or using parser functions because Lua execution is more efficient than the wikitext parser.
- Simplicity: Lua is known for its simplicity and ease of learning, which makes it accessible for wiki editors who might not be professional programmers.
- Safety: The Lua environment in MediaWiki is sandboxed, which means the scripts run in a controlled environment where they can't access file systems or network resources directly, reducing security risks.
- Reusability: Functions written in Lua can be reused across multiple pages, reducing redundancy and making wiki maintenance easier.