Please join this new Discord server!

Merge notice

Module:Main

From Etrian Odyssey Wiki
Revision as of 01:40, 17 December 2018 by Moydow (talk | contribs) (Created page with "local p = {} function p.main(frame) local args = {} local labels = {} local output = ":''Main article" for i = 1, 10 do if frame:getParent().args[i] ~= nil then args...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This documentation is transcluded from Module:Main/doc. To edit this documentation, click here.

Builds the list of articles output by Template:Main. This module allows for an indefinite number of articles to be listed by the template.



local p = {}

function p.main(frame)
	local args = {}
	local labels = {}
	local output = ":''Main article"
	for i = 1, 10 do
		if frame:getParent().args[i] ~= nil then
			args[i] = frame:getParent().args[i]
			if frame:getParent().args["l" .. i] ~= nil then
				args[i] = args[i] .. "|" .. frame:getParent().args["l" .. i]
			end
		end
	end
	
	if #args > 1 then
		output = output .. "s: [[" .. mw.text.listToText(args, "]], [[", "]] and [[")
	else
		output = output .. ": [[" .. args[1]
	end
	
	return output .. "]]''"
end

return p