模块:沙盒:修订间差异
跳到导航
跳到搜索
无编辑摘要 |
无编辑摘要 |
||
(未显示同一用户的1个中间版本) | |||
第17行: | 第17行: | ||
local args = getArgs(frame) | local args = getArgs(frame) | ||
return mw.dumpObject(args) | 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 | 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