Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Lemondoge/templatedata
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
require('strict'); local getArgs = require ('Module:Arguments').getArgs; local p = {} local function function_that_does_stuff (label, param, description, ptype, status) local result result = '"'..param..'": { "label": '..label..'", "description": "'..description..'", "type": "'..ptype..'", "required": '..status..' },' return result.."poof" end function p.templatedata (frame) local args=getArgs (frame) local final_result local i=1 while frame.args['label'..i] do local result = function_that_does_stuff (args['label'..i], args['param'..i], args['description'..i], args['type'..i], args['status'..i]) final_result = final_result..result i = i + 1; end return final_result end return p --[[local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) return p._main(args) end p._main = function(frame) local i = 1 local num = tonumber(frame.args["num"]) local result = {} while (i <= num) do local variable = frame.args["variable" .. tostring(i)] local description = frame.args["description" .. tostring(i)] local label = frame.args["label" .. tostring(i)] local type = frame.args["type" .. tostring(i)] local required = frame.args["required" .. tostring(i)] if i == num then result[i] = '"' .. variable .. '": {"description": "' .. description .. '", "label": "' .. label .. '", "type": "' .. type .. '", "required": ' .. required .. ' }' else result[i] = '"' .. variable .. '": {"description": "' .. description .. '", "label": "' .. label .. '", "type": "' .. type .. '", "required": ' .. required .. ' }, ' end i = i + 1 end return unpack(result) end --'{ "description": "' .. frame.args["description"] .. '", "params": {' .. unpack(result) .. "}" return p]]--
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/Lemondoge/templatedata/doc
(
edit
)