LLWiki正在建设中,欢迎加入我们!
“模块:Radio-list”的版本间差异
跳转到导航
跳转到搜索
小 |
小 |
||
第9行: | 第9行: | ||
end |
end |
||
return {skip, mw.ustring.gsub(string, "([年月])0?(%d+)", "%1<span class=\"countdown-num\">%2</span>")} |
return {skip, mw.ustring.gsub(string, "([年月])0?(%d+)", "%1<span class=\"countdown-num\">%2</span>")} |
||
end |
|||
function cell(string) |
|||
end |
|||
function rowspan(string) |
|||
return mw.ustring.match("rowspan= style=\"a:b\"{{!}}c", "rowspan%s*=%s*[\"\']?(%d+)") |
|||
end |
end |
||
function p.main(frame) |
function p.main(frame) |
||
local args = getArgs(frame, {removeBlanks = false}) |
local args = getArgs(frame, {removeBlanks = false}) |
||
-- Main module code goes here. |
|||
local result = "{|class=\"wikitable radio-list"..(args.comment and " radio-with-comment" or "").."\"\n!#!!配信日期" |
local result = "{|class=\"wikitable radio-list"..(args.comment and " radio-with-comment" or "").."\"\n!#!!配信日期" |
||
local cvcols = mw.text.split(args.cvcols, "、") |
local cvcols = args.cvcols and mw.text.split(args.cvcols, "、") or {} |
||
local ncols = 2 + (args.comment and 1 or 0) |
local ncols = 2 + (args.comment and 1 or 0) |
||
local ncvcols = 2 |
local ncvcols = 2 |
2020年10月10日 (六) 06:48的版本
local getArgs = require('Module:Arguments').getArgs local p = {} function date(string) local skip = 1 if string:sub(1, 1) == 's' then skip = 0 string = mw.ustring.gsub(string, "^%D+", "") end return {skip, mw.ustring.gsub(string, "([年月])0?(%d+)", "%1<span class=\"countdown-num\">%2</span>")} end function cell(string) end function rowspan(string) return mw.ustring.match("rowspan= style=\"a:b\"{{!}}c", "rowspan%s*=%s*[\"\']?(%d+)") end function p.main(frame) local args = getArgs(frame, {removeBlanks = false}) local result = "{|class=\"wikitable radio-list"..(args.comment and " radio-with-comment" or "").."\"\n!#!!配信日期" local cvcols = args.cvcols and mw.text.split(args.cvcols, "、") or {} local ncols = 2 + (args.comment and 1 or 0) local ncvcols = 2 for k,v in ipairs(cvcols) do ncols = ncols + 1 ncvcols = ncvcols + 1 result = result.."!!"..v end result = result.."!!视频资料"..(args.comment and "!!備註" or "") local id = args.start or 1 for k,v in ipairs(args) do local i = k % ncols if i == 1 then local date = date(v) 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 result = result.."||"..(v == "" and "class=\"table-none\"| " or frame:expandTemplate{title = "memberlink/cv", args = mw.text.split(v, "、")}) 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 result = result.."||"..v end end return result.."\n|}" end return p