(+) |
m (Removed protection from "Terraria Wiki:Lua": This page is not a policy page, is not highly transcluded, and hasn't experienced any vandalism.) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | '''[[wikipedia:Lua (programming language)|Lua]]''' is a programming language made available at Terraria Wiki |
+ | '''[[wikipedia:Lua (programming language)|Lua]]''' is a programming language made available at the Terraria Wiki through the [[mw:Extension:Scribunto|Scribunto]] MediaWiki extension. It is a powerful scripting language that can extend the functionality of wiki templates beyond the capabilities usually ascribed to wiki code alone. It is embedded into wikitext via the {{tc|#invoke:}} parser function. |
− | Lua source code is stored on pages called '''modules''' ( |
+ | Lua source code is stored on pages called '''modules''' which reside in their own [[mw:Manual:Namespace|namespace]] (e.g. [[Module:Bananas]], a test script). The documentation for a module is stored at each module's {{code|/doc}} subpage (e.g. [[Module:Bananas/doc]]). |
+ | The {{tc|#invoke:}} parser function is rarely used in articles directly. Instead, it is usually included in templates, a list of which can be found in the [[:Category:Templates using Lua]]. |
||
⚫ | |||
+ | |||
⚫ | |||
⚫ | |||
⚫ | |||
* See [[Module:BananasArgs]] for extended basic code examples. |
* See [[Module:BananasArgs]] for extended basic code examples. |
||
== See also == |
== See also == |
||
− | * [[wikipedia:Lua|Lua documentation at Wikipedia]] |
+ | * [[wikipedia:Wikipedia:Lua|Lua documentation at Wikipedia]] |
+ | * [https://www.lua.org/pil/contents.html Online version of Programming in Lua (first edition)] |
||
+ | |||
⚫ | |||
+ | [[de:Terraria Wiki:Lua]] |
||
⚫ | |||
+ | [[ru:Terraria Wiki:Lua]] |
Revision as of 22:02, 28 May 2021
Lua is a programming language made available at the Terraria Wiki through the Scribunto MediaWiki extension. It is a powerful scripting language that can extend the functionality of wiki templates beyond the capabilities usually ascribed to wiki code alone. It is embedded into wikitext via the Template:Tc parser function.
Lua source code is stored on pages called modules which reside in their own namespace (e.g. Module:Bananas, a test script). The documentation for a module is stored at each module's
subpage (e.g. Module:Bananas/doc).
/doc
The Template:Tc parser function is rarely used in articles directly. Instead, it is usually included in templates, a list of which can be found in the Category:Templates using Lua.
Examples
- Use Template:Tc to print the text "Hello, world!".
- See Module:BananasArgs for extended basic code examples.