Please join this new Discord server!

Merge notice

Module:TemplateT

From Etrian Odyssey Wiki
Revision as of 10:48, 13 January 2019 by Moydow (talk | contribs) (Created page with "local p = {} function p.template_t(frame) -- Name input for convenience local in_args = frame:getParent().args -- Start with a link to the template page, and nowiki the {...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This documentation is transcluded from Module:TemplateT/doc. To edit this documentation, click here.

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



local p = {}

function p.template_t(frame)
	-- Name input for convenience
	local in_args = frame:getParent().args

	-- Start with a link to the template page, and nowiki the {{ }}
	output_text = mw.text.nowiki("{{") .. "[[Template:" .. in_args[1] .. "|" .. in_args[1] .. "]]"
	-- Iterate over the parameters, skipping the first one
	for i, param in ipairs(in_args) do
		if i ~= 1 then
			output_text = output_text .. "|" .. param
		end
	end
	
	output_text = output_text .. mw.text.nowiki("}}")
	
	return output_text
end

return p