Module:icons
Jump to navigation
Jump to search
Documentation for this module may be created at Module:icons/doc
local p = {}
function p.main(frame)
local args = p.getArgs(frame)
local title = mw.title.new(args.item)
local text = title:getContent()
local games = p.extractGames(text)
return games
end
function p.getArgs(frame)
if p.argsCache then
return p.argsCache
else
local args = frame:getParent().args
p.argsCache = args
return args
end
end
function p.extractGames(text)
local games = text:match("|%s*games%s*=%s*([^|]+)")
if games then
games = games:match("^%s*(.-)%s*$") -- trim whitespace
end
return games
end
return p