Jump to content

Module:Articles by class

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by MSGJ (talk | contribs) at 17:37, 19 December 2024 (try find). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

require('strict')
local p = {}
local class = {'FA', 'A', 'GA', 'B', 'C', 'Start', 'Stub', 'FL', 'AL', 'BL', 'CL', 'List', 'SIA', 'Future', 'Category', 'Disambig', 'Draft', 'FM', 'File', 'Needed', 'Portal', 'Project', 'Redirect', 'Template', 'User', 'NA'}

p.main = function(frame)
	local args = require('Module:Arguments').getArgs(frame)
	local title = args.page and mw.title.new(page) or mw.title.getCurrentTitle()
	local class, topic = args.topic or title.text:find('^(%a+)-Class (%a+) articles$')
	return class .. topic
end

return p