16,874
个编辑
LLWiki正在建设中,欢迎加入我们!
小 |
小 |
||
local getArgs = require('Module:Arguments').getArgs
local p = {}
function date(
local skip = 1
if
skip = 0
end
return {skip, mw.ustring.gsub(
end
function cell(
local property, value = mw.ustring.match(str, "([^|]*)|(.*)")
return {property, value or str}
end
function
end
function p.main(frame)
local args = getArgs(frame, {removeBlanks = false})
ncvcols = ncvcols + 1
▲ ncvcols = ncvcols + 1
result = result.."!!"..v▼
end▼
end
result = result.."!!视频资料"..(args.comment and "!!備註" or "")
local id = args.start or 1
local rowspan = {}
for k,v in ipairs(args) do
local i = k % ncols
if i == 1 then
result = result.."\n|-\n|"..(date[1] == 1 and id or "<div style=\"text-align:center\">–</div>").."||"..date[2]
id = id + date[1]
elseif (i > 1 and i < ncvcols) then
rowspan[i] = rowspan[i] or 0
result = result.."||"..(v == "" and "class=\"table-none\"| " or frame:expandTemplate{title = "memberlink/cv", args = mw.text.split(v, "、")})▼
if rowspan[i] > 0 then
rowspan[i] = rowspan[i] - 1
else
local td = cell(v)
if td[1] then
rowspan[i] = span(td[1]) - 1
end
if td[1] or td[2] == "" then
(td[2] == "" and "class=\"table-none\"| " or ("|"..
frame:expandTemplate{title = "memberlink/cv", args = mw.text.split(v, "、")}))
else
▲ result = result.."||"..
end
▲ end
elseif i == ncvcols then
local video = string.match(v, "[%l%u%d]+")
result = result.."||"..(video and "[https://www.bilibili.com/video/"..video.." "..v.."]" or "–")
elseif i == 0 then
if rowspan[i] > 0 then
rowspan[i] = rowspan[i] - 1
else
local td = cell(v)
if td[1] then
rowspan[i] = span(td[1]) - 1
end
result = result.."||"..(td[1] and td[1].."|" or "")..td[2]
end
end
end
return result.."\n|}"
end
|