Module:template

Revision as of 18:01, 5 August 2023 by Maria (talk | contribs) (Created page with "local export = {} function export.show(frame) frame = frame:getParent() or frame local out = {"{{", frame.args[1]} local i = 2 while frame.args[i] do table.insert(out, "|" .. frame.args[i]) i = i + 1 end for key, value in ipairs(frame.args) do if type(key) == "string" then table.insert(out, "|" .. key .. "=" .. value) end end table.insert("}}") return table.concat(out) end return export")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:template/documentation

local export = {}

function export.show(frame)
	frame = frame:getParent() or frame
	local out = {"{{", frame.args[1]}
	local i = 2
	while frame.args[i] do
		table.insert(out, "|" .. frame.args[i])
		i = i + 1
	end
	for key, value in ipairs(frame.args) do
		if type(key) == "string" then
			table.insert(out, "|" .. key .. "=" .. value)
		end
	end
	table.insert("}}")
	return table.concat(out)
end

return export