----local p = local plaintext = require("Module:Plain text")local yesno = require("Module:Yesno")local function split_into_threads(text, level3) local threads = local current_thread local header_pat text = "\n" .. text if level3 then header_pat = '\n
*\n' else header_pat = '\n
[]*\n' end local last = 1 while true do local start, endindex, topic = text:find(header_pat, last) if current_thread then current_thread.content = text:sub(last, start) threads[#threads + 1] = current_thread end current_thread = if start
"Archive index" then title = titleObj.nsText .. ":" .. titleObj.baseText end return title .. maskendfunction p._onemask(mask, frame) if frame
"/" then mask = resolve_relative(mask, frame) end local out = "" local leading_zeros = tonumber(frame.args.leading_zeros) or 0 if mask:find("<#>") then local archivecount = 0 while true do archivecount = archivecount + 1 local archivesuffix = tostring(archivecount) archivesuffix = string.rep("0", leading_zeros - #archivesuffix + 1) .. archivesuffix local title = mw.title.new(mask:gsub("<#>",tostring(archivesuffix))) if not title.exists then return out end out = parse_archive(title, out) end else local title = mw.title.new(mask) out = parse_archive(title, out) end return outendfunction p.main(frame) local out = "" out = out .. frame:extensionTag("templatestyles","",) out = out .. '\n
Discussion Topic | Replies (estimated) | Archive Link' if frame.args.mask then out = out .. p._onemask(frame.args.mask, frame) end local masknum = 1 while true do local maskArg = frame.args["mask" .. tostring(masknum)] if maskArg then out = out .. p._onemask(maskArg, frame) masknum = masknum + 1 else break end end if yesno(frame.args.indexhere) then out = parse_archive(mw.title.new(resolve_relative("", frame)), out) end return outendreturn p |
---|