<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://chabadpedia.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ANoinclude_tfd</id>
	<title>Module:Noinclude tfd - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://chabadpedia.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ANoinclude_tfd"/>
	<link rel="alternate" type="text/html" href="https://chabadpedia.com/index.php?title=Module:Noinclude_tfd&amp;action=history"/>
	<updated>2026-04-27T02:47:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://chabadpedia.com/index.php?title=Module:Noinclude_tfd&amp;diff=5499&amp;oldid=prev</id>
		<title>Shia.k: Created page with &quot;local redr = require(&quot;Module:Redirect&quot;) local function stringCount(string, pattern) 	local _dump, cnt = mw.ustring.gsub(string, pattern, &quot;&quot;) 	return cnt end local function parse(frame, links) 	local missing = &quot;&quot; 	local hidden = &quot;&quot; 	local bogus = &quot;&quot; 	for _, object in ipairs(links) do 		if object then 			local title = &quot;Template:&quot; .. object; 			local rtarget; 			errorvalue, rtarget = pcall(redr.getTarget, title) 			if errorvalue then 				title = rtarget or title 			end 			l...&quot;</title>
		<link rel="alternate" type="text/html" href="https://chabadpedia.com/index.php?title=Module:Noinclude_tfd&amp;diff=5499&amp;oldid=prev"/>
		<updated>2025-03-20T13:27:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local redr = require(&amp;quot;Module:Redirect&amp;quot;) local function stringCount(string, pattern) 	local _dump, cnt = mw.ustring.gsub(string, pattern, &amp;quot;&amp;quot;) 	return cnt end local function parse(frame, links) 	local missing = &amp;quot;&amp;quot; 	local hidden = &amp;quot;&amp;quot; 	local bogus = &amp;quot;&amp;quot; 	for _, object in ipairs(links) do 		if object then 			local title = &amp;quot;Template:&amp;quot; .. object; 			local rtarget; 			errorvalue, rtarget = pcall(redr.getTarget, title) 			if errorvalue then 				title = rtarget or title 			end 			l...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local redr = require(&amp;quot;Module:Redirect&amp;quot;)&lt;br /&gt;
local function stringCount(string, pattern)&lt;br /&gt;
	local _dump, cnt = mw.ustring.gsub(string, pattern, &amp;quot;&amp;quot;)&lt;br /&gt;
	return cnt&lt;br /&gt;
end&lt;br /&gt;
local function parse(frame, links)&lt;br /&gt;
	local missing = &amp;quot;&amp;quot;&lt;br /&gt;
	local hidden = &amp;quot;&amp;quot;&lt;br /&gt;
	local bogus = &amp;quot;&amp;quot;&lt;br /&gt;
	for _, object in ipairs(links) do&lt;br /&gt;
		if object then&lt;br /&gt;
			local title = &amp;quot;Template:&amp;quot; .. object;&lt;br /&gt;
			local rtarget;&lt;br /&gt;
			errorvalue, rtarget = pcall(redr.getTarget, title)&lt;br /&gt;
			if errorvalue then&lt;br /&gt;
				title = rtarget or title&lt;br /&gt;
			end&lt;br /&gt;
			local code&lt;br /&gt;
			local title = mw.title.new(title)&lt;br /&gt;
			if title == nil then&lt;br /&gt;
				bogus = bogus .. &amp;quot;\n* &amp;quot; .. title&lt;br /&gt;
				code = nil&lt;br /&gt;
			else&lt;br /&gt;
				code = title:getContent()&lt;br /&gt;
			end&lt;br /&gt;
			if code then&lt;br /&gt;
				local unsubstified = mw.ustring.match(code, &amp;quot;#invoke:Unsubst|&amp;quot;);&lt;br /&gt;
			    local nmg = stringCount(code, &amp;quot;&amp;lt;noinclude&amp;gt;[^/]*{{Tfm&amp;quot;)&lt;br /&gt;
			    local ndel = stringCount(code, &amp;quot;&amp;lt;noinclude&amp;gt;[^/]*{{Template for discussion&amp;quot;) &lt;br /&gt;
			    local disabled = stringCount(code,&amp;quot;type=disabled&amp;quot;)&lt;br /&gt;
			    local safesubst = mw.ustring.match(code,&amp;quot;{{{|safesubst:}}}&amp;quot;) or mw.ustring.match(code, &amp;quot;&amp;lt;includeonly&amp;gt;safesubst:&amp;lt;/includeonly&amp;gt;&amp;quot;);&lt;br /&gt;
			    safesubst = safesubst or mw.ustring.match(code,&amp;quot;[Ss][Aa][Ff][Ee][Ss][Uu][bB][sS][Tt]:%s*&amp;lt;noinclude%s*/&amp;gt;&amp;quot;);&lt;br /&gt;
			    local oldstylesubst = mw.ustring.match(code, &amp;quot;{{{subst|}}}&amp;quot;) or mw.ustring.match(code, &amp;quot;&amp;lt;includeonly&amp;gt;[Ss]ubst:&amp;lt;/includeonly&amp;gt;&amp;quot;);&lt;br /&gt;
			    local tagCnt = stringCount(code,&amp;quot;{{Tfm&amp;quot;) + stringCount(code,&amp;quot;{{Template for merging&amp;quot;)&lt;br /&gt;
			    tagCnt = tagCnt + stringCount(code,&amp;quot;{{Template for discussion&amp;quot;);&lt;br /&gt;
			    if tagCnt == 0 then&lt;br /&gt;
			    	if title.contentModel == &amp;quot;sanitized-css&amp;quot; then&lt;br /&gt;
			    		tagCnt = tagCnt + stringCount(code, &amp;quot;subst:[Tt]emplate for discussion|help=off&amp;quot;) -- What twinkle does&lt;br /&gt;
						tagCnt = tagCnt + stringCount(code, &amp;quot;This template is being discussed in accordance with Wikipedia&amp;#039;s&amp;quot;) -- What the instructions say&lt;br /&gt;
			    	end&lt;br /&gt;
					if tagCnt == 0 then&lt;br /&gt;
				    	missing = missing .. &amp;quot;\n* {{tfd links|&amp;quot; .. object .. &amp;quot;}}&amp;quot;;&lt;br /&gt;
				    end&lt;br /&gt;
				elseif (nmg + ndel + disabled &amp;gt;= tagCnt) and (unsubstified or not (safesubst or oldstylesubst)) then&lt;br /&gt;
					hidden = hidden .. &amp;quot;\n* {{tfd links|&amp;quot; .. object .. &amp;quot;}}&amp;quot;;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local output = &amp;quot;&amp;quot;&lt;br /&gt;
	if #bogus &amp;gt; 0 then&lt;br /&gt;
		output = output .. &amp;quot;=== Bogus listings at TfD === \n&amp;quot; .. bogus .. &amp;quot;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if #missing &amp;gt; 0 then&lt;br /&gt;
		output = output .. &amp;quot;=== Pages with no TfD tag === \n&amp;quot; .. missing .. &amp;quot;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if #hidden &amp;gt; 0 then&lt;br /&gt;
		output = output .. &amp;quot;=== Pages with noincluded TfD tags === &amp;quot; .. hidden&lt;br /&gt;
	end&lt;br /&gt;
	return frame:preprocess(output);&lt;br /&gt;
end&lt;br /&gt;
local function parseDay(day, links)&lt;br /&gt;
	local daytext = mw.title.new(day):getContent();&lt;br /&gt;
	daytext = mw.ustring.gsub(daytext,&amp;quot;Please do not modify it&amp;quot;,&amp;quot;{{tfd links|this is closed}}&amp;quot;);&lt;br /&gt;
	daytext = mw.ustring.gsub(daytext,&amp;quot;{{[tT]fd links|([^}|]+)[^}]-|module=Module:[^}]-}}&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
	daytext = mw.ustring.gsub(daytext,&amp;quot;{{[tT]fd links|([^}|]+)[^}]-|module=yes[^}]-}}&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
	local daymatcher = mw.ustring.gmatch(daytext, &amp;quot;{{[tT]fd links|([^}|]+)[^}]-}}&amp;quot;)&lt;br /&gt;
	local closed = false&lt;br /&gt;
	while true do&lt;br /&gt;
		local link = daymatcher();&lt;br /&gt;
		if not link then&lt;br /&gt;
			return links;&lt;br /&gt;
		end&lt;br /&gt;
		if link == &amp;quot;this is closed&amp;quot; then&lt;br /&gt;
			closed = not closed&lt;br /&gt;
		elseif link:sub(1, 7) == &amp;quot;S-line/&amp;quot; then&lt;br /&gt;
			-- &amp;quot;S-line/&amp;quot; nominations are almost always for unused templates that don&amp;#039;t merit my attention.&lt;br /&gt;
		elseif not closed then&lt;br /&gt;
			links[#links+1] = link;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
local p = {}&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local links = {};&lt;br /&gt;
	local lang = mw.getContentLanguage()&lt;br /&gt;
	local logpage = &amp;quot;Wikipedia:Templates for discussion/Log/&amp;quot;&lt;br /&gt;
	for a = 0, 40 do&lt;br /&gt;
		parseDay(logpage .. lang.formatDate(lang, &amp;quot;Y F j&amp;quot;, &amp;quot;-&amp;quot; .. tostring(a) .. &amp;quot;days&amp;quot;), links)&lt;br /&gt;
	end&lt;br /&gt;
	return parse(frame, links)&lt;br /&gt;
end&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Shia.k</name></author>
	</entry>
</feed>