Module:Options

local p = {}

-- Show all options (using the "Options" template) which were passed to the calling template (either Storylet or Card) - no matter if there is only the "Option1" parameter, or if it goes to Option100. function p.main(frame) targs = frame:getParent.args res = "" list = {} for k, v in pairs(targs) do       optnum = string.match(k, "^Option(%d+)$") if (optnum) then table.insert(list, tonumber(optnum)) end end table.sort(list)

for i, optnum in ipairs(list) do       res = res .. frame:expandTemplate{ title = "Options", args = {targs["Option" .. optnum]} } end

return res end

return p