Content deleted Content added
neater titles for xfd |
quick spin with param replacement |
||
Line 8:
local function getDeletionDiscussions()
local namespaceMap = {
[""] = "Articles for deletion",
["Category"] = "Categories for discussion",
["File"] = "Files for discussion",
["Template"] = "Templates for discussion",
["Module"] = "Templates for discussion",
}
--local current_page = mw.title.getCurrentTitle()
Line 14 ⟶ 19:
local n = 1
local current_page = mw.title.new("Premadasa Hegoda")
local
while true do -- possibly expensive if lots of noms
page = mw.title.makeTitle('Wikipedia',
if page.exists then
output = output ..(n > 1 and ", " or "").."[["..page.prefixedText.."|XfD"..(n > 1 and " ("..n..")" or "").."]]"
Line 41 ⟶ 46:
end
local function buildMsgParams(criterion, key, data, args)
local msg = substituteMsgParams(criterion..'.'..key, data[key])
local appendMsg = ""
local extraParams = data['params']
if extraParams then
for k,param in pairs(extraParams) do
local keys = param.keys
for j,paramkey in pairs(keys) do
if args[paramkey] and param['append'][key] then -- check if we have a defined param given, and it matches what we're processing
-- assign to msg if we have appends
appendMsg = substitute(param['append'][key], args[paramkey])
end
end
end
end
return msg .. appendMsg
end
-- Returns
function p.build(frame, args)
local criterion = args['criterion']
Line 56 ⟶ 82:
template = frame:expandTemplate{ title = 'db-meta', args = {
-- Required
' '..frame:preprocess(
frame:preprocess(
criterion = criterion, -- Criteron
Line 91 ⟶ 117:
function p.main(frame)
local args = getArgs(frame
return p.build(frame, args)
end
|