Jump to content

Help:Lua: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 6: Line 6:


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

Revision as of 09:15, 11 April 2014

Template:WikiProject Lua/header

"Hello world"

  • 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

Highlighting Lua code

  • Lua code can be highlighted using tags <source> or <syntaxhighlight> with attrribute lang="lua":
<source lang="lua">
--code snippet
    function p.main()
        return "Hello world"
    end
</source>

or

<syntaxhighlight lang="lua">
--code snippet
    function p.main()
        return "Hello world"
    end
</syntaxhighlight>

Produces:

--code snippet
    function p.main()
        return "Hello world"
    end

How-to guides

Testing modules

Wikipedia resources