模組:沙盒/Cwek/test2
模块文档[创建]
您可能想要创建本Scribunto模块的文档。 编者可以在本模块的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模块的子页面。 |
local p={}
p.main=function(frame)
local pFrame1 = frame:getParent()
local pFrame2 = ( pFrame1~=nil and pFrame1:getParent() ) or nil
if pFrame1~= nil then
local checkNS = frame:preprocess('{{NAMESPACE}}')
mw.log(checkNS)
if checkNS=='Template' then
return '[[Category:Bar]]'
else
return '[[Category:Foo]]'
end
else
mw.log('no Parent')
return ''
end
end
return p