Community Central
Community Central
m (→‎Navbox Implementations: added PortableNavbox)
Tag: Help
No edit summary
Tag: Help
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[File:Lua-logo-nolabel.png|250px|right|link=]]
+
[[File:Lua-logo-nolabel.png|120px|right|link=]]
'''Lua''' is available as a templating language on Fandom, helping to provide users with the ability to create more maintainable templates and to improve the performance of some of our slowest pages.
+
'''Lua''' is available as a templating language on Fandom, helping to provide users with the ability to create more maintainable templates and to improve the page performance.
   
Lua is a different coding experience to basic wikitext templates, resembling a more 'traditional' programming syntax. It offers two key advantages: first and foremost is that logical functionality – 'if', 'else', and 'while' statements along with arrays and variable definition, for instance - is built into the Lua language, making the implementation of basic logic much easier in Lua than via MediaWiki's [[Help:Parser functions|other methods]]. Second, because Lua is streamlined for logical operations, it performs better than its wikitext counterparts.
+
Lua is a different coding experience to basic wikitext templates, resembling a more ‘traditional’ programming syntax. It offers two key advantages:
  +
# Logical functionality is natively built into the Lua language, making the implementation of basic logic much easier in Lua than via [[Help:Parser functions|MediaWiki's methods]].
  +
# Because Lua is streamlined for logical operations, it performs better than its wikitext counterparts.
   
Lua (for wiki use) is not intended to replace JavaScript, CSS, or all wikitext templates.
+
Lua is not intended to replace JavaScript, CSS, or all wikitext templates.
   
==Enabling and support==
+
== Enabling and support ==
Lua is enabled by default on all wikis. When enabled, the general standard Lua libraries along with the specialized [[mw:Extension:Scribunto|Scribunto]] libraries are also available. Fandom's implementation of Scribunto uses most standard features, but not all functions are supported; the differences are detailed in the [[w:c:dev:Lua templating/Reference manual|reference manual]].
+
Lua is enabled by default on all wikis. The general standard Lua libraries along with the specialized [[mw:Extension:Scribunto|Scribunto]] libraries are also available. Fandom's  implementation of Scribunto on the legacy platform uses most standard features, but not all functions are supported. The differences are detailed in the [[w:c:dev:Lua templating/Reference manual|reference manual]].
   
For more background on the tool, read our [[w:User_blog:Grunny/Introducing_Lua,_for_faster_and_more_powerful_templates|introduction to Lua]].
+
For more background on the tool, read our [[w:User blog:Grunny/Introducing Lua, for faster and more powerful templates|introduction to Lua]].
   
==Lua module repository ==
+
== Lua module repository ==
Lua modules can also be loaded from the [[w:c:dev|Fandom Open Source Library]] using <code>require("Dev:ModuleName")</code>, as opposed to <code>require("Module:ModuleName")</code><ref>[[w:User_blog:Kirkburn/Technical_Update:_June_24,_2015|User blog:Kirkburn/Technical Update: June 24, 2015]]</ref>. These "global modules" are available for re-use Fandom-wide and are described in more detail [[w:c:dev:Global Lua Modules|here]].
+
Lua modules can also be loaded from the [[w:c:dev|Fandom Developers Wiki]] using <code>require("Dev:ModuleName")</code>, as opposed to <code>require("Module:ModuleName")</code><ref>[[w:User blog:Kirkburn/Technical Update: June 24, 2015|User blog:Kirkburn/Technical Update: June 24, 2015]]</ref>. These "global modules" are available for re-use Fandom-wide and are described in more detail [[w:c:dev:Global Lua Modules|here]].
   
 
== Documentation and further help ==
==Navbox Implementations==
 
 
[[w:c:dev:Help:Lua|Lua documentation]] on the Fandom Developers Wiki:
These are some Lua implementations for Navboxes:
 
 
* [[w:c:dev:Lua templating/Converting Wikitext templates|Converting wikitext templates]]
* [[w:c:americanhorrorstory|American Horror Story Wiki]]: [[w:c:americanhorrorstory:Template:Navbox|Template]]/[[w:c:americanhorrorstory:Module:Navbox|Module]]/[[w:c:americanhorrorstory:MediaWiki:Common.css|CSS]] - Port from Wikipedia. Uses deprecated HtmlBuilder. Uses old collapsible class.
 
** Module dependencies: ''[[w:c:americanhorrorstory:Module:HtmlBuilder|HtmlBuilder]]'', [[w:c:americanhorrorstory:Module:Navbar|Navbar]], [[w:c:americanhorrorstory:Module:Arguments|Arguments]]
 
* [[w:c:layton|Professor Layton Wiki]]: [[w:c:layton:Template:Navbox|Template]]/[[w:c:layton:Module:Navbox|Module]]/[[w:c:layton:User:Tjcool007/Navbox styles|CSS]] - Based on Wikipedia (same syntax), but redone from scratch.
 
** Module dependencies: None (VDE links need [[w:c:layton:Template:Vdelinks|Template:Vdelinks]])
 
* [[w:c:runescape|Runescape Wiki]]: [[w:c:runescape:Template:Navbox|Template]]/[[w:c:runescape:Module:Navbox|Module]]/[[w:c:runescape:MediaWiki:Common.css|CSS]] - Based on an older version of Wikipedia's template.
 
** Module dependencies: [[w:c:runescape:Module:Tnavbar|Tnavbar]], [[w:c:runescape:Module:Yesno|Yesno]]
 
* [[w:c:dev:Global Lua Modules/NavboxBuilder|NavboxBuilder]] in Fandom Developers Wiki repository: [[w:c:dev:Module:NavboxBuilder|Module]]/[[w:c:dev:MediaWiki:Global_Lua_Modules/NavboxBuilder.css|CSS]]
 
* [[w:c:dev:Global Lua Modules/PortableNavbox|PortableNavbox]] in Fandom Developers Wiki repository: [[w:c:dev:Module:PortableNavbox|Module]]/[[w:c:dev:MediaWiki:PortableNavbox.css|CSS]]
 
 
==Documentation and help==
 
[[w:c:dev:Lua templating|Lua documentation]] on the Fandom Open Source Library:
 
* [[w:c:dev:Lua templating/Converting_Wikitext_templates|Converting wikitext templates]]
 
 
* [[w:c:dev:Lua templating/Reference manual|Reference manual]], a comprehensive documentation page of Lua code
 
* [[w:c:dev:Lua templating/Reference manual|Reference manual]], a comprehensive documentation page of Lua code
 
* [[w:c:dev:Lua templating/Reference manual/Scribunto libraries|Scribunto libraries]]
 
* [[w:c:dev:Lua templating/Reference manual/Scribunto libraries|Scribunto libraries]]
* [[w:c:dev:Lua templating/Reference_manual/Standard_libraries|Standard Lua libraries]]
+
* [[w:c:dev:Lua templating/Reference manual/Standard libraries|Standard Lua libraries]]
 
* [[w:c:dev:Category:Lua|More help pages]]
 
* [[w:c:dev:Category:Lua|More help pages]]
   
 
In addition to this documentation, we have a [[w:c:dev:Board:Scribunto Help|forum board]] set up here to ask questions and get help.
 
In addition to this documentation, we have a [[w:c:dev:Board:Scribunto Help|forum board]] set up here to ask questions and get help.
   
==See also==
+
== See also ==
 
* [[wikipedia:Wikipedia:Lua|Lua on Wikipedia]]
 
* [[wikipedia:Wikipedia:Lua|Lua on Wikipedia]]
 
* [[wikipedia:Special:PrefixIndex/Module:|Lua modules on Wikipedia]]
 
* [[wikipedia:Special:PrefixIndex/Module:|Lua modules on Wikipedia]]
* [[wikipedia:Category:Lua-based_templates|Lua-based templates on Wikipedia]]
+
* [[wikipedia:Category:Lua-based templates|Lua-based templates on Wikipedia]]
 
* [[mw:Extension:Scribunto|Scribunto extension page]]
 
* [[mw:Extension:Scribunto|Scribunto extension page]]
 
* [http://tylerneylon.com/a/learn-lua/ Learn Lua in 15 Minutes]
 
* [http://tylerneylon.com/a/learn-lua/ Learn Lua in 15 Minutes]
 
* [https://lua.org/docs.html Official Lua documentation]
 
* [https://lua.org/docs.html Official Lua documentation]
   
;Fandom Developers Wiki (<code>dev.fandom.com</code>)
+
; Fandom Developers Wiki (<code>dev.fandom.com</code>)
 
* [[w:c:dev:Lua reference manual|Lua reference manual]]
 
* [[w:c:dev:Lua reference manual|Lua reference manual]]
** [[w:c:dev:Lua reference manual/Scribunto libraries|Scribunto libraries]]
 
 
** [[w:c:dev:Lua reference manual/Standard libraries|Standard libraries]]
 
** [[w:c:dev:Lua reference manual/Standard libraries|Standard libraries]]
 
** [[w:c:dev:Lua reference manual/Scribunto libraries|Scribunto libraries]]
 
* [[w:c:dev:Lua templating|Lua templating]]
 
* [[w:c:dev:Lua templating|Lua templating]]
 
** [[w:c:dev:Lua templating/Basics|Basics]]
 
** [[w:c:dev:Lua templating/Basics|Basics]]
 
** [[w:c:dev:Lua templating/Getting started|Getting started]]
 
** [[w:c:dev:Lua templating/Converting Wikitext templates|Converting Wikitext templates]]
 
** [[w:c:dev:Lua templating/Converting Wikitext templates|Converting Wikitext templates]]
 
** [[w:c:dev:Lua templating/Debug console|Debug console]]
 
** [[w:c:dev:Lua templating/Debug console|Debug console]]
** [[w:c:dev:Lua templating/Getting started|Getting started]]
 
 
** [[w:c:dev:Lua templating/Glossary|Glossary]]
 
** [[w:c:dev:Lua templating/Glossary|Glossary]]
 
** [[w:c:dev:Lua templating/Tips and tricks|Tips and tricks]]
 
** [[w:c:dev:Lua templating/Tips and tricks|Tips and tricks]]
   
==Further help and feedback==
+
== Further help and feedback ==
{{Help and feedback section}}[[es:Ayuda:Lua]]
+
{{Help and feedback section}}
  +
 
== References ==
 
<references/>[[de:Hilfe:Lua]]
 
[[es:Ayuda:Lua]]
 
[[fr:Aide:Lua]]
 
[[fr:Aide:Lua]]
 
[[it:Aiuto:Lua]]
 
[[it:Aiuto:Lua]]
Line 63: Line 58:
 
[[pl:Pomoc:Lua]]
 
[[pl:Pomoc:Lua]]
 
[[pt:Ajuda:Lua]]
 
[[pt:Ajuda:Lua]]
 
[[ru:Справка:Lua]]
  +
[[tr:Yardım:Lua]]
  +
[[vi:Trợ giúp:Lua]]
 
[[zh:Help:Lua]]
 
[[zh:Help:Lua]]
[[vi:Trợ giúp:Lua]]
 
[[ru:Справка:Lua]]
 
 
==References==
 
<references/>
 
 
[[Category:Help]]
 
[[Category:Help]]
 
[[Category:Extensions]]
 
[[Category:Extensions]]

Revision as of 19:45, 30 August 2020

Lua-logo-nolabel

Lua is available as a templating language on Fandom, helping to provide users with the ability to create more maintainable templates and to improve the page performance.

Lua is a different coding experience to basic wikitext templates, resembling a more ‘traditional’ programming syntax. It offers two key advantages:

  1. Logical functionality is natively built into the Lua language, making the implementation of basic logic much easier in Lua than via MediaWiki's methods.
  2. Because Lua is streamlined for logical operations, it performs better than its wikitext counterparts.

Lua is not intended to replace JavaScript, CSS, or all wikitext templates.

Enabling and support

Lua is enabled by default on all wikis. The general standard Lua libraries along with the specialized Scribunto libraries are also available. Fandom's  implementation of Scribunto on the legacy platform uses most standard features, but not all functions are supported. The differences are detailed in the reference manual.

For more background on the tool, read our introduction to Lua.

Lua module repository

Lua modules can also be loaded from the Fandom Developers Wiki using require("Dev:ModuleName"), as opposed to require("Module:ModuleName")[1]. These "global modules" are available for re-use Fandom-wide and are described in more detail here.

Documentation and further help

Lua documentation on the Fandom Developers Wiki:

In addition to this documentation, we have a forum board set up here to ask questions and get help.

See also

Fandom Developers Wiki (dev.fandom.com)

Further help and feedback

References