Jump to content

Module:Bold list/sandbox

From Wikipedia, the free encyclopedia
-- Written by User:Ahecht in response to a thread at [[WP:VPI]]
return { main = function(frame)
	index, output = {}, ""
	for k, v in pairs(frame:getParent().args) do
		if type(k) == 'number' and (v or "") ~= "" then table.insert(index, k) end
	end
	table.sort(index)
	for i, v in ipairs(index) do
		output = output .. frame:getParent().args[v] .. ((i == #index - 1) and ("'''" .. (#index > 2 and ", " or " ") .. (frame.args.conj or "or") .. " '''") or ((#index > 1 and i < #index) and "''', '''" or ""))
	end
	return  "'''" .. output .. "'''"
end }