跳转到内容

模組:Documentation/wrapper

维基百科,自由的百科全书

这是本页的一个历史版本,由SunAfterRain留言 | 贡献2023年8月6日 (日) 12:20 建立内容为“-- 包裹Module:Documentation不能直接被模板呼叫的函數 local mDocumentation = require('Module:Documentation') local getArgs = require('Module:Arguments').getArgs return { wrapper = function (frame) local args = frame.args local method = args.method if not method or not p[method] or method:match('^_') -- reject private function then return require('Module:Error').error({'Can\'t find method "' .. method .. '"…”的新页面)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
-- 包裹[[Module:Documentation]]不能直接被模板呼叫的函數
local mDocumentation = require('Module:Documentation')
local getArgs = require('Module:Arguments').getArgs

return {
	wrapper = function (frame)
		local args = frame.args
		local method = args.method
		if
			not method
			or not p[method]
			or method:match('^_') -- reject private function
		then
			return require('Module:Error').error({'Can\'t find method "' .. method .. '" in [[Module:Documentation]].'})
		elseif method:match('^_') then
			
		end
		local env = p.getEnvironment(args)
		return p[method](args)
	end
}