Jump to content

Module:Sandbox/ProcrastinatingReader

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ProcrastinatingReader (talk | contribs) at 15:51, 21 July 2020. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local data = mw.loadData('Module:Sandbox/ProcrastinatingReader/data')

function p.main(frame)
	local args = getArgs(frame, {
		wrappers = {
			--'Template:Sandbox/ProcrastinatingReader'
		}
	})
	return p.build(frame, args)
end

function p.build(frame, args)
	local criterion = args['criterion']
	local cdata = data[criterion]
	local tag = cdata.tag

	template = frame:expandTemplate{ title = 'db-meta', args = {
		-- Required
		' '..tag['message'],												-- Main text, in bold
		tag['extra'] or '',														-- Main text, in italics
		criterion = criterion,													-- Criteron

		-- Additional data
		notes = tag['notes'] or '',
		anotes = '',
		summary = data[criterion]['description'],
		temp = data[criterion]['warn_template'],

		-- Pass generic params onto db-meta
		bot = args['bot'] or '',
		raw = args['raw'] or '',
		['self'] = args['self'] or '',
		image = args['image'] or '',
		wiki = args['wiki'] or '',
		blanked = args['blanked'] or '',
		blankedtext = args['blanked-text'] or '',
		pleaseblank = args['pleaseblank'] or '',
		divblank = args['divblank'] or '',
		help = args['help'] or ''
	}}

	categorisation = '<includeonly>' .. frame:expandTemplate{
		title = 'cat handler',
		args = {
			['all'] = '{{NOINDEX}}[[:Category:Candidates for speedy deletion]][[:Category:'..cdata['tracking_category']..']]',
			['nocat'] = 'false'
		}
	} .. '</includeonly>'

	return template .. frame:preprocess(categorisation)
end

return p