Modulis:Infokastes parametru noformēšana

Lua kļūda Modulis:Documentation, 144. rinda: message: type error in message cfg.container (string expected, got nil).

local getArgs = require('Module:Arguments').getArgs
local p = {}

function getmax(args)
	local maxlen = 0
	for k,v in ipairs(args) do
		local title = v
		local len = mw.ustring.len(title)
		if len>maxlen then
			maxlen=len
		end
	end
	return maxlen
end

function p._main(args)
	out = {}
	name = args.nos
	maxlenght = getmax(args)
	for k,v in ipairs(args) do
		local param = v
		local spaces = maxlenght-mw.ustring.len(param)
		out[k] = " | " .. string.rep( ' ', spaces ) .. param .. " = "
	end
	return '<pre>{{' .. name .. "\n" .. table.concat(out,"\n") .. '\n}}</pre>'
end

function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end

return p