5,121 Pages

-- <pre>
--- Returns the static maintenance data.
--- Used by [[Template:Current maintenance data]]
--- Syntax: {{cmd|<keyword>}} or {{current maintenance data|<keyword>}}
local p         = {}
local lib       = require('Module:Feature')
local userError = require('Dev:User error')
local keyword   = mw.loadData('Module:Maintenance data/data')
--% Entry point to use module
--@ frame (table) A scribunto frame
--: (string) The return content of the keyword or "N/A"
function p.main(frame)
    local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end
    local s = keyword[args[1]]
    if s == nil then
        return userError("Unrecognized parameter: ''" .. args[1] .. "''", "LuaError")
    if type(s) == "table" then
        return s[tonumber(args[2])]
        return s
return p
-- </pre>
-- [[Category:Lua]]
Community content is available under CC-BY-SA unless otherwise noted.