Zelda Wiki

OoT Navi.png

Hey! Listen!

This wiki contains spoilers! Read at your own risk!

READ MORE

Zelda Wiki
Advertisement
Zelda Wiki
10,304
pages

Documentation for this module may be created at Module:UtilsPackage/Documentation

local p = {}

local utilsTable = require("Module:UtilsTable")

function p.submodules(submodules, sectionHeadings)
	local module = {}
	local moduleDoc = {}
	for i, submodulePage in ipairs(submodules) do
		local submodule = require(submodulePage)
		for exportKey, export in pairs(submodule) do
			if module[exportKey] and exportKey ~= "Documentation" and exportKey ~= "Schemas" then
				mw.addWarning(string.format("Module conflict: <code>%s</code> is exported by more than one submodule.", exportKey))
			end
			module[exportKey] = export
		end
		moduleDoc[i] = {
			heading = sectionHeadings and sectionHeadings[i],
			section = submodulePage,
		}
	end
	module.Documentation = { sections = moduleDoc }
	return module
end

return p
Advertisement