Jump to content

Help:Lua: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
new key for Category:Module help: " " using HotCat
 
(30 intermediate revisions by 18 users not shown)
Line 1: Line 1:
{{WikiProject Lua/header|sc1=HELP:LUA}}
{{WikiProject Lua header|sc1=HELP:LUA}}


== "Hello world" ==
== "Hello world" ==
* See [[Module:Example]]
* [[Module:Bananas]]: The simplest possible script: say "hello world". Providing a single function with no arguments.
* [[Module:BananasArgs]]: Demonstrates how to access and use parameters.


==Documentation==
==Documentation==
* [[Help:Lua for beginners]]
* [[mw:Extension:Scribunto/Lua reference manual|Scribunto Lua reference manual]] (Manual for the Mediawiki implementation)
* [[mw:Extension:Scribunto/Lua reference manual|Scribunto Lua reference manual]] (Manual for the Mediawiki implementation)
* [http://www.lua.org/pil/contents.html#P1 Programming in Lua] (Official book/introduction to Lua)
* [http://www.lua.org/pil/contents.html#P1 Programming in Lua] (Official book/introduction to Lua)
* [http://lua-users.org/wiki/TutorialDirectory Lua tutorials at lua-users.org]
* [http://lua-users.org/wiki/TutorialDirectory Lua tutorials at lua-users.org]
* [[wikt:Wiktionary:Scribunto|Wiktionary:Lua]] on English Wiktionary: contains notes on efficiency and on dealing with Unicode and UTF-8
===Highlighting Lua code===
* Lua code can be highlighted using tags <source> or <syntaxhighlight> with attrribute {{code|1=lang="lua"}}:
<pre>
<source lang="lua">
--code snippet
function p.main()
return "Hello world"
end
</source>
</pre>
''or''
<pre>
<syntaxhighlight lang="lua">
--code snippet
function p.main()
return "Hello world"
end
</syntaxhighlight>
</pre>
Produces:
<syntaxhighlight lang="lua">
--code snippet
function p.main()
return "Hello world"
end
</syntaxhighlight>


==How-to guides==
==How-to guides==
* [[Help:Lua for beginners]]
* [[Wikipedia:Lua style guide]] &ndash; standards to improve the readability of code through consistency
* [[Wikipedia:Lua style guide]] &ndash; standards to improve the readability of code through consistency
* [[:File:WMF Tech Talk 2013-02-28 slides - Scribunto presentation.pdf|"What do converted templates look like?" (slideshow)]]
* [[:File:WMF Tech Talk 2013-02-28 slides - Scribunto presentation.pdf|"What do converted templates look like?" (slideshow)]]
* [[Help:Lua debugging]] &ndash; a how-to guide about [[debugging]] Lua modules
* [[Help:Lua for beginners]]
* [[Wikipedia:Lua string functions]]
* [[Wikipedia:Lua string functions]]
* [[Wikipedia:Guide to Scribbling]]
* [[Wikipedia:Guide to Scribbling]]

==Debugging modules==
* [[Module:SimpleDebug]] - It allows to collect and view the values of one or several variables and/or customized labels of several points of a lua program.


== Testing modules ==
== Testing modules ==
* [[Module:UnitTests]] - used to power many module unit tests, which are usually found by the name "Module:(your-module-Sample [[unit test]]s for the "Hello world" modules:
* [[Module:UnitTests]] - used to power many module [[unit test]]s, which are usually found by the name "Module:(your-module-name)/tests".
* [[Module:Bananas/testcases]] &ndash; [[Module talk:Bananas/testcases|Results]]
* [[Module:Example/testcases]] &ndash; [[Module talk:Example/testcases|Results]] - Unit tests for [[Module:Example]] (the "hello world" module)

* [[Module:BananasArgs/testcases]] &ndash; [[Module talk:BananasArgs/testcases|Results]]name)
== Profiling modules and functions ==
* [[Module:Timing]] &ndash; module to do some simple probing of timing issues, mostly to spot and fix load problems

==Patterns==
* [[:mw:Extension:Scribunto/Lua_reference_manual#Patterns]]
* [[:mw:Extension:Scribunto/Lua_reference_manual#Ustring_patterns]]
* [http://lua-users.org/wiki/PatternsTutorial PatternsTutorial]
* REGEX (as applied by [[WP:AWB]]): [[WP:REGEX]]


==Wikipedia resources==
==Wikipedia resources==
* [[Special:PrefixIndex/Module:Sandbox]] - allows you to work on a set of files within a sandbox prefix.
* [[Special:PrefixIndex/Module:Sandbox]] - allows you to work on a set of files within a sandbox prefix.


{{Wikipedia technical help|collapsed}}
{{Lua programming language}}

[[Category:Module help| ]]

Latest revision as of 15:03, 16 June 2024

  • Help:Lua for beginners
  • Help:Lua debugging – about debugging Lua modules
  • Wikipedia:Lua style guide – standards to improve the readability of code through consistency
  • Module:Sandbox provides a pseudo-namespace for experimenting with Lua modules

"Hello world"[edit]

Documentation[edit]

How-to guides[edit]

Debugging modules[edit]

  • Module:SimpleDebug - It allows to collect and view the values of one or several variables and/or customized labels of several points of a lua program.

Testing modules[edit]

Profiling modules and functions[edit]

  • Module:Timing – module to do some simple probing of timing issues, mostly to spot and fix load problems

Patterns[edit]

Wikipedia resources[edit]