Module:Attribute ID

local cap = require( 'Module:Capitalize' ).main local getArgs = require( 'Module:Arguments' ).main local p = {} local attributedict = { ["FIRE"] = "Fire", ["ELECTRIC"] = "Electric", ["WIND"] = "Wind", ["STUN"] = "Stun", ["EXPLOSION"] = "Explosion", ["ICE"] = "Ice", ["BLIND"] = "Blind", ["POISON"] = "Poison", ["NULL"] = "None", ["NONE"] = "None", }

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

function p._main(args) if args[1] then local attribute = string.upper(args[1]) local pageName for key, value in pairs(attributedict) do           if string.match(attribute, key) then output = attribute:gsub(key,value) if output == "None" then pageName = "Null" else pageName = output end local formattedImage local formattedLink if args[2] == "text" then formattedImage = string.format('', output, '20px', pageName) formattedLink = string.format('%s', args['link'] or pageName) return string.format(' %s %s ', formattedImage, formattedLink) else if args[3] == "text" then formattedImage = string.format('', output, args[2] or '20px', pageName) formattedLink = string.format('%s', args['link'] or pageName, args[text] or pageName) return string.format(' %s %s ', formattedImage, formattedLink) else formattedImage = string.format('', output, args[2] or 'x36px', pageName) return formattedImage end end end end end end

return p