This page in a nutshell: Scribbling is a way to create complex templates and is more robust than parser functions. A scribbled template consists of only {{#invoke:Name1|Name2}}, which invokes the script at Module:Name1, where the code is written. To get started, refer to Module:Example. Try the module by using Template:Basic scribbling example in your sandbox. |
This is the Guide to Scribbling. Scribbling, also known as Luafication, is the act of writing a template, or converting a template, so that it uses the Scribunto extension to MediaWiki. The Scribunto extension[a] was developed by Tim Starling and Victor Vasiliev, and allows for embedding scripting languages in MediaWiki. Currently the only supported scripting language is Lua. This Guide aims to give you a broad overview of Scribbling, and pointers to further information in various places.
Scribbled templates come in two parts: the template itself and one or more back-end modules — in the Module:
namespace — that contain programs that are run on the wiki servers to generate the wikitext that the template expands to. The template invokes a function within a module using a new parser function named {{#invoke:}}
.
The idea of Scribbling is to improve template processing performance. Scribbling eliminates any need for template parser function programming using parser functions such as {{#if}}
, {{#ifeq}}
, {{#switch}}
and {{#expr}}
. All of this is instead done in the module, in a language that was actually designed to be a programming language, rather than a template system onto which was bolted various extensions over time to try to make it into a programming language.[b] Scribbling also eliminates any need for templates to expand to further templates and potentially hit the expansion depth limit. A fully Scribbled template should never need to transclude other templates.[c]
Cite error: There are <ref group=lower-alpha>
tags or {{efn}}
templates on this page, but the references will not show without a {{reflist|group=lower-alpha}}
template or {{notelist}}
template (see the help page).