Module:Automarkup

From Wooly Moon Books
Revision as of 05:53, 8 March 2023 by Wendyulmer (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Automarkup/doc

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	
	local templateArgs = { }
	for key, value in pairs(args) do
		if type(key) == "number" then
			templateArgs[2 * key - 1] = value
			templateArgs[2 * key] = frame:preprocess(value)
		else
			templateArgs[key] = value
		end
	end
	
	return frame:expandTemplate{ title = "Markup", args = templateArgs }
end

return p