FANDOM


-- Test module that implements Template:T
local p = {}
 
function p.main( frame )
	local a = frame:getParent().args
	if not a[1] then return '' end
 
	local prefix = a.prefix and a.prefix .. ':' or ''
	local out = { '{{',prefix,'[[Template:', a[1], '|', a[1], ']]' }
 
	local nums = {}
	for k,_ in pairs(a) do
		local num = tonumber(k)
		if num and num ~= 1 then
			nums[#nums+1] = num
		end
	end
 
	table.sort(nums)
 
	for i=1,#nums do
		local arg = a[nums[i]]
		if arg then
			out[#out+1] = '|<span style="color:grey;">&lt;' .. arg .. '&gt;</span>'
		end
	end
 
	out[#out+1] = '}}'
 
	if a.style == 'code' then
		return '<code>'..table.concat(out)..'</code>'
	end
 
	return table.concat(out)
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.