From Ways of Darkness
Jump to navigation Jump to search

Documentation for this module may be created at Module:Demographics/Areas/doc

local regions = require( 'Module:Demographics/Regions' )
local areas_json = 'Demographics/Areas.json', 'Module' )
local areas_data = mw.text.jsonDecode( areas_json:getContent() )
local p = {}

for i, row in ipairs(areas_data['areas']) do
	row['region'] = regions[row['regionID']]
	row['regionID'] = nil
	table.insert(p, row)

return p
-- Don't forget to use this - - to convert your tables to JSON, mkay?