Toggle menu
15
236
70
27.5K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 04:55, 22 February 2025 by Prd (talk | contribs) (Created page with "--Module to implement an unordered list with a generalised separator. Use TemplateStyles with an associated template to style the list. It will recognise "hr" as the horizontal rule. -- p = {} p.makelist = function(frame) local args = frame.args if not args[1] then args = frame:getParent().args if not args[1] then return end end local sep = (args.sep or "") if sep == "hr" then sep = "<hr>" end local out = {} for k, v in ipairs(args) do v = mw.text.tri...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Implements {{Seplist}}.



--[[
Module to implement an unordered list with a generalised separator.
Use TemplateStyles with an associated template to style the list.
It will recognise "hr" as the horizontal rule.
--]]

p = {}

p.makelist = function(frame)
	local args = frame.args
	if not args[1] then
		args = frame:getParent().args
		if not args[1] then return end
	end
	local sep = (args.sep or "")
	if sep == "hr" then sep = "<hr>" end
	local out = {}
	for k, v in ipairs(args) do
		v = mw.text.trim(v)
		table.insert(out, "<li>" .. v .. "</li>")
	end
	if #out > 0 then
		return '<ul class="seplist">' .. table.concat(out, sep) .. '</ul>'
	end
end

return p