Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.

Responsive image


Wikipedia:Guide to Scribbling

"Shh! I'm reading about how to Scribble templates."

This is a guide to Scribbling, also known as Luafication. Scribbling is an informal term used to describe the process of creating a new template or converting an existing one so that it invokes a module containing functions written in Lua script. The Scribunto[a] extension enables the embedding of scripting languages in MediaWiki. Currently, Lua is the only supported scripting language. This guide provides an overview of Scribbling and points to additional resources for further learning.

Scribbled templates consist of two components: The template itself, and one or more back-end modules, stored in the Module: namespace. These modules contain Lua programs that are executed on the wiki servers to generate the wikitext that the template expands to. Templates invoke a function within a module using the {{#invoke:}} parser function.

The main purpose and primary advantage of Scribbling is improved template processing performance, as Lua scripts are significantly more efficient than traditional template parser functions. Another benefit is simplified code. By using Lua, Scribbling eliminates the need for complex parser function programming, such as {{#if}}, {{#ifeq}}, {{#switch}} and {{#expr}}, which were originally designed as extensions to a template system rather than a true programming language.[b] By handling complex logic within the module, Scribbling reduces clutter in the template itself, making it easier to maintain and update. Additionally, Scribbling addresses the issue of expansion depth limits by eliminating the need for templates to transclude other templates.[c]

  1. ^ MW 2003a, p. 1116.


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).


Previous Page Next Page






Wikipedia:Panduan Scribble Malay Википедия:Использование Lua Russian විකිපීඩියා:Guide to Scribbling SI

Responsive image

Responsive image