模組:Multiple releases
閱讀設定
模組解[開]
你可能想去為呢個Scribunto module開一個解版。 編者可以響呢個模組嘅沙盤 (開 | 鏡)同埋試例 (開)版度試驗佢。 請加個類到個/doc嘅細版度。 呢個模組嘅細版。 |
local infobox = require ('Module:Infobox').infobox
local getArgs = require ('Module:Arguments').getArgs
local p = {}
function p.main( frame )
local args = getArgs (frame)
InfoboxArgs = {}
InfoboxArgs["subbox"] = "yes"
local a = 1
local IsEmpty = true
local KeepCheckingForArgs = true
while KeepCheckingForArgs == true do
local thisBranch = "branch" .. a
local thisVersion = "version" .. a
local thisDate = "date" .. a
local CurLabel = "label" .. a
local CurData = "data" .. a
if args[thisBranch] and args[thisVersion] then
InfoboxArgs[CurLabel] = args[thisBranch]
InfoboxArgs[CurData] = args[thisVersion]
if args[thisDate] then InfoboxArgs[CurData] = InfoboxArgs[CurData] .. " / " .. args[thisDate] end
else
KeepCheckingForArgs = false
if a > 1 then IsEmpty = false end
end
a = a + 1
end
if IsEmpty == false then
return infobox(InfoboxArgs)
else
return nil
end
end
return p