Module:Description

local p = {}

-- Grabs args from the parent frame -- Trims and parses the args into a table, then returns the table function norm local origArgs = mw.getCurrentFrame:getParent.args local args = {} for k, v in pairs( origArgs ) do       v = mw.text.trim( tostring( v ) ) if v ~= '' then args[k] = v       end end return args end

-- Main entry point for the Module function p.main -- get args from the Template local args = norm

-- Check if an item is given, return its description from -- Module:ItemData if it item is specified if args.item then local itemData = require( "Module:ItemData" ) if itemData.items[args.item] == nil then return 'None' elseif itemData.items[args.item].description == '' then return 'None' else return itemData.items[args.item].description end -- Check if text was given, return the text if so   elseif args.text then return args.text -- Error condition, item and text are not given else local errormsg = 'Improper usage. Please see Template:Description for help' return errormsg end end

return p