Module:template: Difference between revisions

From Laenkea
Jump to navigation Jump to search
(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")
(No difference)

Revision as of 18:01, 5 August 2023

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