Module:Module sandbox
| Welcome to Module:Module sandbox, a Wikipedia module sandbox. This page is itself a module, and it allows you to carry out experiments related to module editing. If you wish to experiment with article editing, use the Wikipedia Sandbox or your own user sandbox.
To edit, click the edit tab above, make your changes and click the Publish changes button when finished. Click here to reset the sandbox. Please do not place malicious Lua code here, or copyrighted, offensive, illegal or libelous content in the sandboxes. For assistance with Lua coding, try the technical forum at the Village Pump. You can also conduct tests using the Wikipedia Sandbox. For instance, to invoke this module there, edit it so that it includes: |
Usage
{{#invoke:Module sandbox|function_name}}
Example
{{#invoke:Module sandbox|main}} yields:
Hello world!
Documentation
Package items
sandbox.hello_world( name )(function)- Prints hello world
- Parameter:
namePerson to address (string) - Returns: hello world string
- TODO: make it say "Hello, [name]".
sandbox.main( frame )(function)- Main entrypoint.
- Parameter:
framecalling frame (table) - Returns: output wikitext
--- {{Please leave this line alone (Module sandbox heading)}}
--
-- @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
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
