Module:Aside

From Terra Nostra
Revision as of 01:33, 9 September 2024 by Maria (talk | contribs) (Created page with "local p = {} function p.show(frame) local args = frame:getParent().args local pieces = {} for _, a_full in ipairs(args) do a_delim = mw.ustring.find(":") if a_delim then a_pre = mw.ustring.sub(a_full, 1, a_delim - 1) a_post = mw.ustring.sub(a_full, a_delim + 1) table.insert(pieces, "<small>" .. a_pre .. ":</small> " .. a_post) else table.insert(pieces, a_full) end end return "(" .. table.concat(pieces, ", ") .. ")" end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local p = {}

function p.show(frame)
	local args = frame:getParent().args
	local pieces = {}
	for _, a_full in ipairs(args) do
		a_delim = mw.ustring.find(":")
		if a_delim then
			a_pre = mw.ustring.sub(a_full, 1, a_delim - 1)
			a_post = mw.ustring.sub(a_full, a_delim + 1)
			table.insert(pieces, "<small>" .. a_pre .. ":</small> " .. a_post)
		else
			table.insert(pieces, a_full)
		end
	end
	return "(" .. table.concat(pieces, ", ") .. ")"
end

return p