Module:Item

local function plural(str, postfix) if postfix == '' then return str end if postfix == 's' or postfix == 'es' then return str .. postfix end if postfix == 'ies' then return str:sub(0, -2) .. postfix end if postfix == 'ves' then return str:sub(0, -3) .. postfix end return postfix end

-- main return object return { go = function(frame) local _arg1 = mw.text.trim(frame.args[1]) local _arg2 = mw.text.trim(frame.args[2]) local _link = mw.text.trim(frame.args['link']) local _image = mw.text.trim(frame.args['image']) local _ext = mw.text.trim(frame.args['ext']) local _size = mw.text.trim(frame.args['size']) local _note = mw.text.trim(frame.args['note']) local _id = mw.text.trim(frame.args['id']) local _warp = mw.text.trim(frame.args['warp']) local _icon = mw.text.trim(frame.args['icon']) local _small = mw.text.trim(frame.args['small']) local _versions = mw.text.trim(frame.args['v'])

if _id ~= '' then _warp = '' _small = true end

if _warp ~= '' then _small = true end

if _icon == 'n' or _icon == 'no' then _icon = false else _icon = true end

if _ext == '' then _ext = 'png' end if _image == '' then _image = _arg1 .. '.' .. _ext end

local image_output = ''

local text = plural(_arg1, _arg2)

if _link ~= '' then text = ..text.. end

local icon = '' if _icon then local name if _link ~= '' then name = _link else name = _arg1 end icon = tostring(require('Module:eicons').icons(_versions, _small, frame)) end

local content = text if _warp ~= '' then if icon ~= '' then if _note ~= '' then content = content .. mw.text.tag('span',{class='eico'}, icon) else content = content .. mw.text.tag('div',{class='eico'}, icon) end end if _note ~= '' then content = content .. mw.text.tag('div',{class='note'}, _note) end else if _note ~= '' then content = content .. mw.text.tag('span',{class='note'}, _note) end if icon ~= '' then content = content .. mw.text.tag('span',{class='eico'}, icon) end if _id ~= '' then content = content .. mw.text.tag('div', {class='id'}, 'Internal Item ID: ' .. _id) end end

return mw.text.tag('span',{class='item-link'}, image_output .. mw.text.tag('span',{class='text'}, content)) end }