更多操作
因为以下原因,您没有权限编辑该页面:
您可以查看和复制此页面的源代码。
local getArgs = require('Module:Arguments').getArgs;
local p = setmetatable({},{
__index = function (t, k)
local rawFunc = t['_' .. k];
if rawFunc then
local rtnFunc = function(frame)
return rawFunc(getArgs(frame))
end
rawset(t,k,rtnFunc)
return rtnFunc;
end
return nil;
end
})
local function getCap(txt,color,bgcolor,padding,margin)
-- 其实可以考虑改成使用TemplateStyle。
return string.format(
'<span style="width: max-content;text-align:center;display:inline-block;border-radius:1em;color:%s;background-color:%s;padding:0 %.2fem;margin:0.1em %.2fem;">%s</span>',
color or 'white',
bgcolor or 'black',
000
1:0
该页面使用的模板:
返回模块:Caps。