Template:Lua
Uses Lua: |
{{#ifeq:lua |doc
|
{{#ifeq:show |show
|This is a documentation subpage for Template:Lua. It contains usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if: | | {{#ifexist:Template:Lua | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]] | }} }} | }}
{{Lua{{#if:x |
{{#if:{{#titleparts:{{#if:| | Template:Lua }}|0|2}} | | }}
}}|Module:Lua banner}}
This template is used to show that templates have been converted to Lua. It is placed at the top of the template's /doc page. It automatically adds the template to Category:Lua-based templates, or to one of its subcategories.
Usage[edit]
- Basic
{{{{#if: |subst:}}Lua{{#if:module name ||module name}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||�}}}}
- All parameters
{{{{#if: |subst:}}Lua{{#if:module 1 ||module 1}}{{#if:module 2 ||module 2}}{{#if:module 3 ||module 3}}{{#if:... ||...}}{{#if:category=custom category ||category=custom category}}{{#if:nocat=true ||nocat=true}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||�}}}}
The first module name is required.
Examples[edit]
{{{{#if: |subst:}}Lua{{#if:Module:Bananas ||Module:Bananas}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||�}}}}
{{Lua{{#if:x |
{{#if:{{#titleparts:{{#if:| | Template:Lua }}|0|2}} | | }}
}}|Module:Bananas|nocat=true}}
{{{{#if: |subst:}}Lua{{#if:Module:Bananas ||Module:Bananas}}{{#if:Module:BananasArgs ||Module:BananasArgs}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||�}}}}
{{Lua{{#if:x |
{{#if:{{#titleparts:{{#if:| | Template:Lua }}|0|2}} | | }}
}}|Module:Bananas|Module:BananasArgs|nocat=true}}
{{{{#if: |subst:}}Lua{{#if:Module:Bananas ||Module:Bananas}}{{#if:Module:BananasArgs ||Module:BananasArgs}}{{#if:Module:HelloWorld ||Module:HelloWorld}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||�}}}}
{{Lua{{#if:x |
{{#if:{{#titleparts:{{#if:| | Template:Lua }}|0|2}} | | }}
}}|Module:Bananas|Module:BananasArgs|Module:HelloWorld|nocat=true}}
{{{{#if: |subst:}}Lua{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||�}}}}
{{Lua{{#if:x |
{{#if:{{#titleparts:{{#if:| | Template:Lua }}|0|2}} | | }}
}}|nocat=true}}
Categorisation[edit]
Template category[edit]
This template adds pages to Category:Lua-based templates if the page is in the template namespace, and it is not on any of the subpages /doc, /sandbox, /sandbox2 or /testcases. You can specify a different category with the |{{#if:category|category=}}
parameter, e.g. |{{#if:category|category=}}Lua String-based templates
.
Some modules have a default category other than Category:Lua-based templates:
- Module:String has the default category Category:Lua String-based templates.
- Module:Math has the default category Category:Templates based on the Math Lua module.
- Module:BaseConvert has the default category Category:Templates based on the BaseConvert Lua module.
- Module:Citation and Module:Citation/CS1 both have the default category Category:Lua-based citation templates.
Error category[edit]
If no modules are specified, the transcluded page will be added to Category:Lua templates with errors.
Category suppression[edit]
To suppress all categorisation, use |{{#if:nocat|nocat=}}true
. (As well as "true", the values "yes", "y", and "1" will also work.)
See also[edit]
{{#ifeq:Lua|sandbox | | }}
The above documentation is transcluded from Template:Lua/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |
{{#if:|
[[Category:Template documentation pages{{#translation:}}]] }}