Site notice
Welcome! Please check To-Do List to see what pages need help, who is working on what, etc.

Module:TemplateT

From Mega Man Wiki

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

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