Home

Scribunto

Scribunto is a MediaWiki extension that adds a Lua scripting engine and a module system to MediaWiki. It enables authors to implement template logic in Lua rather than in complex wikitext templates, improving maintainability and rendering performance for repetitive tasks. The extension provides a sandboxed Lua interpreter and a modular environment in which code is organized into modules stored in the Module: namespace. Template authors invoke module functions using the #invoke parser function, for example: {{#invoke:MyModule|MyFunction|arg1|arg2}}. Functions return strings, numbers, or tables that templates can render.

Modules can access a built-in mw library to interact with MediaWiki data and utilities, such as page

Installation requires adding the Scribunto extension to the MediaWiki server and enabling it in LocalSettings.php. After

Security controls enforce a sandbox with restricted I/O and resource usage to protect the wiki server from

Impact and usage: Scribunto has become widely adopted on Wikimedia projects for infoboxes, navigation templates, and

titles,
page
content,
and
formatting
helpers.
This
enables
tasks
such
as
data
processing,
generating
complex
outputs,
and
retrieving
page
metadata
without
embedding
all
logic
directly
in
each
template.
installation,
contributors
create
Module:...
pages
containing
Lua
code.
Submodules
may
be
organized
under
Module:Foo/Bar
and
invoked
accordingly.
untrusted
code.
The
extension
provides
APIs
to
access
wiki
data
while
isolating
the
Lua
environment
from
direct
server
access.
data-driven
rendering.
While
it
can
greatly
simplify
template
logic,
it
requires
careful
module
design
and
performance
considerations.