打开/关闭菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模块:Documentation/wrapper

来自高中笔记
https://en.wikipedia.org/wiki/$1>SunAfterRain2023年8月6日 (日) 20:23的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

此模块的文档可以在模块:Documentation/wrapper/doc创建

脚本错误:Lua错误:内部错误:解释器以状态1退出。

-- 包裹[[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 mDocumentation[method]
			or method:match('^_') -- reject private function
		then
			return require('Module:Error').error({'Can\'t find method "' .. method .. '" in [[Module:Documentation]].'})
		elseif
			mDocumentation['_' .. method] -- reject private function
		then
			return require('Module:Error').error({'Please use <code>{{#invoke:[[Module:Documentation|Documentation]]|' .. method .. '|...}}</code> instead.'})
		end
		local env = mDocumentation.getEnvironment(args)
		return mDocumentation[method](args, env)
	end
}