Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 01:39, 29 September 2024 by PoolloverNathan (talk | contribs) (lua doin a little trollin)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  • Not to be confused.
  • Not to be confused with Foo.
  • Not to be confused with Foo or Bar.
  • Not to be confused with Foo, Bar, or Baz.

function hatnoteDistinguish(frame)
	local args = frame:getParent().args
    if not args[1] then return frame:expandTemplate { title = [[Hatnote]]; args = { [[Not to be confused. ]]; }; }; end;
	local final = {}
	
	for k, v in ipairs(args) do
		table.insert(final, "[[" .. v .. "]]")
	end
	local sep = " "
	if #final > 1 then
		final[#final] = "or " .. final[#final]
		if #final > 2 then
			sep = ", "
		else
			sep = " "
		end
	end
	return frame:expandTemplate{title = "Hatnote", args = {"Not to be confused with " .. table.concat(final, sep) .. "."}}
end

return {["hatnote"] = hatnoteDistinguish}