Module:also: Difference between revisions

From Laenkea
Jump to navigation Jump to search
No edit summary
m (Sorting, hopefully)
Tags: Mobile edit Mobile web edit
Line 11: Line 11:
i = i + 1
i = i + 1
end
end
table.sort(links, function(a,b) return a < b end)
return "<dt><dd>''See also:'' " .. table.concat(links, ", ") .. "</dd></dt>"
return "<dt><dd>''See also:'' " .. table.concat(links, ", ") .. "</dd></dt>"
end
end


return export
return export

Revision as of 02:25, 3 December 2023

{{also}}


local export = {}

local m_links = require("Module:links")

function export.show(frame)
	local args = frame:getParent().args
	local links = {}
	local i = 1
	while args[i] do
		table.insert(links, "'''" .. m_links.full_link{term = args[i]} .. "'''")
		i = i + 1
	end
	table.sort(links, function(a,b) return a < b end)
	return "<dt><dd>''See also:'' " .. table.concat(links, ", ") .. "</dd></dt>"
end

return export