Jump to content

Module:Bold list/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ahecht (talk | contribs) at 15:29, 8 September 2022 (Create, support gaps and blank values). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- Written by User:Ahecht in response to a thread at [[WP:VPI]]
return { main = function(frame)
	index = {}
	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)
	args = {}
	for _, v in ipairs(index) do table.insert(args, frame:getParent().args[v])	end
	conj = "'''" .. (#args > 2 and ", " or " ") .. (frame.args.conj or "or") .. " '''"
	return "'''"..mw.text.listToText(args, "''', '''", conj).."'''"
end }