Module:Icon

local p = {} function p.icon( frame ) local iconName = frame:getParent.args[1] or '' local size = frame:getParent.args[2] or '25' local customText = frame:getParent.args[3] or ''

local sizeStr = size .. "x" .. size .. "px" return p._icon(iconName, sizeStr, customText ) end

function p._icon( iconName, sizeStr, customText ) local iconData = mw.loadData( 'Module:icon/data' ) local iconString

iconName = string.lower( iconName )

if iconData[iconName] then iconString = "" .. sizeStr .. "|" .. iconData[iconName].name .. "|" .. customText .. "" else local syscat = require( "Module:syscat" )

if mw.title.new( syscat._syscat( iconName ) .. " icon.png", 'File' ).exists == true then iconString = "" end end return iconString or "Deprecated template usage" end

return p