Module:User:Mr. Stradivarius/icon explained

-- This module implements .

local getArgs = require('Module:Arguments').getArgslocal data = mw.loadData('Module:User:Mr. Stradivarius/icon/data')

local p =

function p.main(frame) local args = getArgs(frame) local code = args[1] return p._main(code)end

function p._main(code) -- Look the icon up in the icons table. local icons = data.icons local icon = icons[code] if icon then -- We found the icon first time, so return it. return icon else -- See if we were passed an alias and return the icon for that alias if everything checks out. code = data.aliases[code] if code then icon = icons[code] if icon then return icon end end end -- If all else fails, return the default value. return ''end

return p