Module:Pokemon/Shop

local getArgs = require('Module:Arguments').getArgs

local p = {} local root

local function _shop local title = args.title or 'Poké Mart' local itemList = mw.loadJsonData( 'Module:Pokemon/ShopPricing.json' )

root = mw.html.create( 'table' ) root :addClass( 'wikitable' ) :tag( 'tr' ) :tag( 'th' ) :attr( 'colspan', 2 ) :css( { ['background-color'] = '#0000BD', color = 'white' } ) :wikitext( title )

for k, v in ipairs(args) do		if itemList[v] == nil then root:tag( 'tr' ) :tag( 'td' ) :attr( 'colspan', 2 ) :css( 'text-align', 'center' ) :wikitext( v ) else root:tag( 'tr' ) :tag( 'td' ):wikitext( v ) :tag( 'td' ):wikitext( '', itemList[v] ) end end

return tostring( root ) end

function p.shop( frame ) args = getArgs( frame, { wrappers = 'Template:Pokemon/Shop' } )

return _shop end

return p