Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Template redirect regex: Difference between revisions

From Neodyland Wiki
m Protected "Module:Template redirect regex": High-risk Lua module ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
-non-existing taxonbar
Line 17: Line 17:
},
},
['Taxonbar'] = {
--the following 6 pages (3 condensed) redirect to [[Template:Taxonbar]], as of 2023/8:
'{{ *[Tt]axon?[ _-]?[bB]ar', --parent+50+11+2+2 transclusions
'{{ *[Tt]axon[Ii]ds', --45
'{{ *[Tt]axon[ _]*[iI]dentifiers', --1
--detect direct calls to [[Module:Taxonbar]]
'{{ *#invoke *: *[Tt]axonbar',
},
}
}

Revision as of 07:15, 4 June 2024

Module documentation[ view · edit · history · purge ]
local p = {}

--returns a table of regular expressions, sorted by descending popularity, for a parent template and all redirects to it as of a certain date, or nil
--regex for the 1st pipe and surrounding whitespace are purposefully omitted to give the calling modules more flexibility
function p.main( template )

	--expand the following table as-needed, following the same format
	local tCanonical_templates = {
		['Category redirect'] = { 
			--the following 11 pages (6 condensed) redirect to [[Template:Category redirect]], as of 2022/9:
			'{{ *[Cc]ate?g?o?r?y?[ _]*[rR]edirect',	--parent+505+312+243+1 transclusions
			'{{ *[Cc]atr',							--21
			'{{ *[Cc]at[ _]*[rR]edir',				--5+3
			'{{ *[Cc]at[ _]*[rR]ed',				--3+2
			'{{ *[Cc]at[ _]*[mM]ove',				--1
			'{{ *[Cc]ategory[ _]*[mM]ove',			--0
		},
		
	}
	
	return tCanonical_templates[template] or nil
end

return p
Contents
Cookies help us deliver our services. By using our services, you agree to our use of cookies.