From Ways of Darkness
Jump to navigation Jump to search

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

local countries_json = 'Demographics/Countries.json', 'Module' )
local countries_data = mw.text.jsonDecode( countries_json:getContent() )
local regions_json = 'Demographics/Regions.json', 'Module' )
local regions_data = mw.text.jsonDecode( regions_json:getContent() )
local p = {}

for i, row in ipairs(regions_data['regions']) do
	row['country'] = countries_data['countries'][row['countryID']]
	row['countryID'] = nil
	table.insert(p, row)

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