Module:Status

local getArgs = require('Module:Arguments').getArgs local Wdstt = require('Module:Wdstt').main local p = {}

function p.main(frame) local args = getArgs(frame) return p._main(args) end

function p._main(args) local arg = args[1] local pages = mw.loadData('Module:Status/pages') --Load table of pages with status conditions

if arg then arg = string.lower(arg) for _, page in pairs(pages) do --For page in pages table for k, s in pairs(page.status) do --For Key, Status in the page's table of status if arg == k then if args[2] then return ""..args[2].."" else return ""..args[1].."" end end end end error("No matching status found", 0) end end

return p