该模块实现{{Akitem}}的功能。请不要直接调用此模块。
-- Module:Akitem
-- Made with ♥ by User:Leranjun
-- This module implements {{tl|Akitem}}.
-- Please refrain from invoking this module directly.
local p = {}
local getArgs = require("Module:Arguments").getArgs
local function notempty(s)
return (s and s ~= "")
end
function p.main(frame)
return p._main(getArgs(frame), frame)
end
function p._main(args, frame)
if (not notempty(args[2])) then
error("Akitem 错误:参数 2 不能为空")
end
local t = mw.ustring.lower(args[1])
frame = frame or mw.getCurrentFrame()
if (t == "mat") then
return frame:expandTemplate {
title = "akmat",
args = {
args[2],
size = args.size or 75,
unit = args.unit or "px",
num = args.num,
size2 = args.size2 or "11.2pt",
dt = args.dt,
link = args.link
}
}
elseif (t == "skin") then
return frame:expandTemplate {
title = "akskin",
args = {
args[2],
args[3],
size = args.size or args[4] or 75,
unit = args.unit or "px",
isnav = args.isnav
}
}
elseif (t == "con") then
return frame:expandTemplate {
title = "akcon",
args = {
args[2],
args[3],
size = args.size or args[4] or 75,
unit = args.unit or "px",
dt = args.dt
}
}
elseif (t == "fur") then
return frame:expandTemplate {
title = "akfurni",
args = {
args[2],
args.size or args[3] or 75,
unit = args.unit or "px",
dt = args.dt
}
}
else
error("Akitem 错误:模式代码不合法。请检查参数 1 是否为 mat 、 skin 、 con 、 fur 之一")
end
end
return p