This module allows wikitext to read values from data modules.

{{#invoke:Data|main|ModuleName|key1|key2|key3|...}}

Read data value key1.key2.key3 from Module:ModuleName.



local p = {}

function p.main(frame)
	local data
	for k, v in ipairs(frame.args) do
		if k == 1 then
			data = mw.loadData('Module:' .. v)
		else
			data = data[v]
		end
	end
	return data
end

return p