Module:Module sandbox
Appearance
Welcome to the module sandbox! Feel free to experiment with Lua and LDoc syntax within this sandbox. Content written here will not stay permanently. -->
Usage
{{#invoke:Module sandbox|function_name}}
Example
{{#invoke:Module sandbox|main}}
yields:
Hello world!
Documentation
Package items
module_sandbox.hello_world(name)
(function)- Prints hello world
- Parameter:
name
Person to address (string) - Returns: hello world string
- TODO: make it say "Hello, [name]".
module_sandbox.main(frame)
(function)- Main entrypoint.
- Parameter:
frame
calling frame (table) - Returns: output wikitext
--- {{Please leave this line alone (Module sandbox heading)}} <!--
-- Welcome to the module sandbox!
-- Feel free to experiment with Lua and LDoc syntax within this sandbox.
-- Content written here will not stay permanently.
-- -->
--- This module prints hello world.
--
-- @module sandbox
-- @alias p
local p = {}
--- Prints hello world
-- @function p.hello_world
-- @todo make it say "Hello, [name]".
-- @param {string} name Person to address
-- @return hello world string
p.hello_world = function(name)
return "Hello world!"
end
--- Main entrypoint.
-- @function p.main
-- @param {table} frame calling frame
-- @return output wikitext
p.main = function(frame)
local args = frame.args
return p.hello_world(args[1] or "")
end
return p