Module:Itemref

local p = {}

local g = require("Module:Common")

function p.makeItemref(name, link, text, size, right) local image = "Grid " .. name .. ".png" link = link or name text = text or name size = g.px(size or "32px") local out = '"	if g.isGiven(right) then out = out .. g.link(link, text) out = out .. " "		out = out .. g.img(image, size, link, text) else out = out .. g.img(image, size, link, text) out = out .. " "		out = out .. g.link(link, text) end out = out .. " "	return out end

function p.main(frame) local frame, args = g.getFrameAndArgs(frame) return p.makeItemref(args[1], args.link, args.text, args[2], args.right) end

return p