Module:Sandbox/Ahecht/navboxtolua

This is an old revision of this page, as edited by Ahecht (talk | contribs) at 21:01, 24 December 2023 (update). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

return {[''] = function(frame)
	local args = require('Module:Arguments').getArgs(frame)
	local output = "{\n"
	for k,v in pairs(args) do
		if mw.ustring.find(v,'\n',1,true) then
			output = output .. k .. ' = [=['  .. v .. ']=],\n'
		else
			output = output .. k .. ' = "'  .. v .. '",\n'
		end
	end
	return frame:callParserFunction( '#tag', 'pre', output .. "}" )
	end
}