模块:沙盒:修订间差异
跳到导航
跳到搜索
(创建页面,内容为“local getArgs = require('Module:Arguments').getArgs local p = {} function p._greet(who) if not who or who == "" then who = "world" end return "Hello, " .. who .. "!" end function p.greet(frame) local args = getArgs(frame) return p._greet(args[1]) end return p”) |
无编辑摘要 |
||
(未显示同一用户的2个中间版本) | |||
第13行: | 第13行: | ||
return p._greet(args[1]) | return p._greet(args[1]) | ||
end | end | ||
function p.args_test(frame) | |||
local args = getArgs(frame) | |||
return mw.dumpObject(args) | |||
end | |||
function p.args_test_orig(frame) | |||
local args = getArgs(frame, { trim=false, removeBlanks=false }) | |||
return mw.dumpObject(args) | |||
end | |||
local count = 0 | |||
function p.count(frame) | |||
count = count + 1 | |||
return count | |||
end | |||
return p | return p |
2025年3月20日 (四) 06:46的最新版本
可在模块:沙盒/doc创建此模块的帮助文档
local getArgs = require('Module:Arguments').getArgs
local p = {}
function p._greet(who)
if not who or who == "" then
who = "world"
end
return "Hello, " .. who .. "!"
end
function p.greet(frame)
local args = getArgs(frame)
return p._greet(args[1])
end
function p.args_test(frame)
local args = getArgs(frame)
return mw.dumpObject(args)
end
function p.args_test_orig(frame)
local args = getArgs(frame, { trim=false, removeBlanks=false })
return mw.dumpObject(args)
end
local count = 0
function p.count(frame)
count = count + 1
return count
end
return p