Module:Example

local p = {} local getArgs = require('Module:Arguments').getArgs local multiRequire = require('Module:MultiRequire') local string, table = multiRequire.multiRequire('Module:String', 'Module:Table')

- -- function: main(frame: table|frame) -- -- Creates an example of the input template. - function p.main(frame) table.log(table.deepCopy(getArgs(frame, { trim=false, removeBlanks=false }))) local args = getArgs(frame, { trim=false, removeBlanks=false }) local templateToInvoke = string.trim(args[1]) for i, v in ipairs(args) do		args[i-1] = args[i] args[i] = nil end args[0] = nil local ret = {} local isNamed = false for k, v in pairs(args) do		local isNumber = type(k) == 'number' if not isNamed and not isNumber then isNamed = true end table.push(ret, table.concat{ isNumber and  or '\n', '|', isNumber and  or k, isNumber and '' or '=', v }) end local frame = mw.getCurrentFrame local res = frame:expandTemplate{ title=templateToInvoke, args=args } local pre = mw.html.create('pre') :wikitext(			''		) :done return table.concat{ tostring(pre), '\n;Produces:', '\n', res } end

return p