<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ar">
	<id>https://3rabica.org/index.php?action=history&amp;feed=atom&amp;title=%D9%88%D8%AD%D8%AF%D8%A9%3ARef_info</id>
	<title>وحدة:Ref info - تاريخ المراجعة</title>
	<link rel="self" type="application/atom+xml" href="https://3rabica.org/index.php?action=history&amp;feed=atom&amp;title=%D9%88%D8%AD%D8%AF%D8%A9%3ARef_info"/>
	<link rel="alternate" type="text/html" href="https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Ref_info&amp;action=history"/>
	<updated>2026-06-05T13:23:15Z</updated>
	<subtitle>تاريخ التعديل لهذه الصفحة في الويكي</subtitle>
	<generator>MediaWiki 1.43.7</generator>
	<entry>
		<id>https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Ref_info&amp;diff=1364&amp;oldid=prev</id>
		<title>عبد العزيز في 06:52، 13 مارس 2018</title>
		<link rel="alternate" type="text/html" href="https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Ref_info&amp;diff=1364&amp;oldid=prev"/>
		<updated>2018-03-13T06:52:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;صفحة جديدة&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module counts the number of times that various reference tags and cs1|2 templates appear.&lt;br /&gt;
-- {{#invoke:ref_count|ref_count}}&lt;br /&gt;
-- {{ref info}}&lt;br /&gt;
-- {{ref info|aristotle}}&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- these are the cannonical names.  What to do about redirects? Lua patterns?&lt;br /&gt;
&lt;br /&gt;
local cs1_template_list = {&amp;#039;ar[Xx]iv&amp;#039;, &amp;#039;[Aa][Vv] media&amp;#039;, &amp;#039;[Aa][Vv] media notes&amp;#039;, &amp;#039;book&amp;#039;, &amp;#039;conference&amp;#039;, &amp;#039;[Dd][Vv][Dd] notes&amp;#039;, &amp;#039;encyclopedia&amp;#039;,&lt;br /&gt;
	&amp;#039;episode&amp;#039;, &amp;#039;interview&amp;#039;, &amp;#039;journal&amp;#039;, &amp;#039;magazine&amp;#039;, &amp;#039;mailing list&amp;#039;, &amp;#039;map&amp;#039;, &amp;#039;news&amp;#039;, &amp;#039;newsgroup&amp;#039;, &amp;#039;podcast&amp;#039;, &amp;#039;press release&amp;#039;,&lt;br /&gt;
	&amp;#039;report&amp;#039;, &amp;#039;sign&amp;#039;, &amp;#039;speech&amp;#039;, &amp;#039;serial&amp;#039;, &amp;#039;techreport&amp;#039;, &amp;#039;thesis&amp;#039;, &amp;#039;web&amp;#039;,&lt;br /&gt;
	&amp;#039;بحلقة&amp;#039; , &amp;#039;بخبر&amp;#039; , &amp;#039;بخريطة&amp;#039; , &amp;#039;بموسوعة&amp;#039; , &amp;#039;كتاب&amp;#039; , &amp;#039;ويب&amp;#039; , &amp;#039;ويكي مصدر&amp;#039;};&lt;br /&gt;
&lt;br /&gt;
local cs1_1 = {&amp;#039;[Cc]ite&amp;#039;, &amp;#039;استشهاد&amp;#039;, &amp;#039;مرجع&amp;#039; }&lt;br /&gt;
&lt;br /&gt;
local cleanup_template_list = {&amp;#039;[Cc]itation needed&amp;#039;, &amp;#039;[Cc]itation-needed&amp;#039;	&lt;br /&gt;
		, &amp;#039;[Dd]isputed inline&amp;#039;&lt;br /&gt;
		, &amp;#039;[Dd]ubious&amp;#039;&lt;br /&gt;
		, &amp;#039;يحتاج لمصدر&amp;#039;&lt;br /&gt;
		, &amp;#039;يحتاج لمصدر&amp;#039;&lt;br /&gt;
		, &amp;#039;بحاجة لمصدر&amp;#039;&lt;br /&gt;
		, &amp;#039;مصدر ناقص&amp;#039;&lt;br /&gt;
		, &amp;#039;تأكيد رأي&amp;#039;&lt;br /&gt;
		, &amp;#039;تأكيد مصدر&amp;#039;&lt;br /&gt;
		, &amp;#039;محل شك&amp;#039;&lt;br /&gt;
		, &amp;#039;مصدر&amp;#039;&lt;br /&gt;
		, &amp;#039;مصادر أكثر&amp;#039;&lt;br /&gt;
		, &amp;#039;غير موثق&amp;#039;&lt;br /&gt;
		, &amp;#039;حقيقة&amp;#039;&lt;br /&gt;
		, &amp;#039;غير مؤكد&amp;#039;&lt;br /&gt;
		, &amp;#039;[Ff]ailed verification&amp;#039;&lt;br /&gt;
		};&lt;br /&gt;
&lt;br /&gt;
local dead_link_template_list = {&amp;#039;وصلة مكسورة&amp;#039; , &amp;#039;[Dd]ea?d[%- ]?[Ll]inks?&amp;#039;, &amp;#039;[Dd]ead ?cite&amp;#039;, &amp;#039;[Dd]ead page&amp;#039;, &amp;#039;[Dd]ead ?url&amp;#039;, &amp;#039;[Dd]ead%-inline&amp;#039;,&lt;br /&gt;
	&amp;#039;404&amp;#039;, &amp;#039;[Bb]ad ?link&amp;#039;, &amp;#039;[Bb]roken ?link&amp;#039;, &amp;#039;[Dd][Ll]&amp;#039;,&amp;#039;مرجع مكسور&amp;#039; , &amp;#039;[Ll]ink ?broken&amp;#039;, &amp;#039;[Dd]ead&amp;#039; , &amp;#039;مصدر مكسور&amp;#039;}&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C O U N T _ P A T T E R N &amp;gt;----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
this is a general purpose function used to count occurrences of patterns in the unparsed article text&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function count_pattern (text, pattern)&lt;br /&gt;
	local _;&lt;br /&gt;
	local count;&lt;br /&gt;
	_, count = mw.ustring.gsub (text, pattern, &amp;#039;%1&amp;#039;);&lt;br /&gt;
	--mw.log(pattern .. count)&lt;br /&gt;
	return count;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C O U N T _ C S 1 &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Using the list of cs1 templates, make a count of just those references or templates as dictated by base_pattern.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function count_cs1 (text, base_pattern)&lt;br /&gt;
	local _;&lt;br /&gt;
	local count, total = 0, 0;&lt;br /&gt;
	&lt;br /&gt;
	for o, tee in ipairs (cs1_1) do&lt;br /&gt;
		for i, template in ipairs (cs1_template_list) do&lt;br /&gt;
			--mw.log(base_pattern)&lt;br /&gt;
			pattern = string.format	(base_pattern, tee , template);						-- make a pattern for the selected cs1 template&lt;br /&gt;
			_, count = mw.ustring.gsub (text, pattern, &amp;#039;%1&amp;#039;);						-- count occurences of that pattern&lt;br /&gt;
			--mw.log(pattern .. count)&lt;br /&gt;
			total = total + count;													-- accumulate a total&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return total;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C O U N T _ C L E A N U P &amp;gt;----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Using the list of cleanup templates, make a count of those templates as dictated by base_pattern.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function count_cleanup (text, base_pattern)&lt;br /&gt;
	local _;&lt;br /&gt;
	local count, total = 0, 0;&lt;br /&gt;
	&lt;br /&gt;
	for i, template in ipairs (cleanup_template_list) do&lt;br /&gt;
		pattern = string.format	(base_pattern, template);						-- make a pattern for the selected cleanup template&lt;br /&gt;
		_, count = mw.ustring.gsub (text, pattern, &amp;#039;%1&amp;#039;);						-- count occurences of that pattern&lt;br /&gt;
		total = total + count;													-- accumulate a total&lt;br /&gt;
	end&lt;br /&gt;
	return total;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C O U N T _ D E A D _ L I N K S &amp;gt;----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Using the list of dead link templates, make a count of those templates as dictated by base_pattern.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function count_dead_links (text, base_pattern)&lt;br /&gt;
	local _;&lt;br /&gt;
	local count, total = 0, 0;&lt;br /&gt;
	&lt;br /&gt;
	for i, template in ipairs (dead_link_template_list) do&lt;br /&gt;
		pattern = string.format	(base_pattern, template);						-- make a pattern for the selected cleanup template&lt;br /&gt;
		_, count = mw.ustring.gsub (text, pattern, &amp;#039;%1&amp;#039;);						-- count occurences of that pattern&lt;br /&gt;
		total = total + count;													-- accumulate a total&lt;br /&gt;
	end&lt;br /&gt;
	return total;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; H A S _ L D R &amp;gt;----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
returns a string set to &amp;#039;yes&amp;#039; if the article uses list defined references.  ldr uses {{reflist |refs=...}} or&lt;br /&gt;
&amp;lt;references&amp;gt;...&amp;lt;/references&amp;gt;.  Here we do simple &amp;#039;find&amp;#039;s to make the determination.&lt;br /&gt;
&lt;br /&gt;
It is also possible to do ldr with {{refbegin}} ... {{refend}} &lt;br /&gt;
&lt;br /&gt;
the pattern value is passed to this function but ignored&lt;br /&gt;
]]&lt;br /&gt;
local function has_ldr (text, pattern)&lt;br /&gt;
	c = false&lt;br /&gt;
	rr = { &amp;#039;مراجع&amp;#039; , &amp;#039;[Rr]eflist&amp;#039;, &amp;#039;المراجع&amp;#039;  }&lt;br /&gt;
	for i, template in ipairs (rr) do&lt;br /&gt;
		if mw.ustring.find (text, &amp;#039;{{%s*&amp;#039; .. template .. &amp;#039;[^}]*|%s*refs%s*=%s*[^}|]+&amp;#039;) then	-- does page use {{Reflist |refs=...}}?&lt;br /&gt;
			c = true&lt;br /&gt;
		elseif mw.ustring.find (text, &amp;#039;{{%s*&amp;#039; .. template .. &amp;#039;[^}]*|%s*مراجع%s*=%s*[^}|]+&amp;#039;) then	&lt;br /&gt;
			c = true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if c == true then&lt;br /&gt;
		return &amp;#039;نعم&amp;#039;&lt;br /&gt;
	elseif mw.ustring.find (text, &amp;#039;&amp;lt;references&amp;gt;[^&amp;lt;]+&amp;#039;) then						-- does page use &amp;lt;references&amp;gt;...&amp;lt;/references&amp;gt;?&lt;br /&gt;
		return &amp;#039;نعم&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;no&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; O B J E C T S   T A B L E &amp;gt;----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Here we define various properties and values necessary to the counting of referencing objects&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local objects = {&lt;br /&gt;
	[&amp;#039;unnamed_refs&amp;#039;] = {														-- count unnamed ref tags&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,												-- the function that does the work for this object&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref&amp;gt;)&amp;#039;,												-- a pattern that the function uses to find and count this object&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,															-- the returned result (called count because that is the most common but can be &amp;#039;yes&amp;#039; or &amp;#039;no&amp;#039; etc&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;بدون اسم&amp;#039;										-- a label and marckup for displaying the result; used with string.format()&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;named_refs&amp;#039;] = {															-- count named ref tags&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref%s+name%s*=%s*[%a%d%p ]+&amp;gt;)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;مراجع مسماة&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;self_closed_refs&amp;#039;] = {													-- count self closed ref tags&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref%s*name%s*=%s*[&amp;quot;%a%d%p ]+/&amp;gt;)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;مغلقة ذاتياً&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;r_templates&amp;#039;] = {															-- count R templates (wrapper for self closed refs)&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Rr]%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب R&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;refn_templates&amp;#039;] = {															-- count R templates (wrapper for self closed refs)&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Rr]efn%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب Refn&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;bare_url_refs&amp;#039;] = {														-- count bare url refs&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,												-- TODO: separate function to detect protocol relative urls?&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref[^&amp;gt;]*&amp;gt;%s*http[^&amp;lt;%s]+%s*&amp;lt;/ref&amp;gt;)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;&amp;lt;span style=&amp;quot;font-size:inherit&amp;quot; class=&amp;quot;error&amp;quot;&amp;gt;وصلات عارية&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;ext_link_refs&amp;#039;] = {														-- count unlabeled external link refs&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,												-- TODO: separate function to detect protocol relative urls?&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref[^&amp;gt;]*&amp;gt;%[%s*http[^%]&amp;lt;%s]+%][^&amp;lt;]*&amp;lt;/ref&amp;gt;)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;&amp;lt;span style=&amp;quot;font-size:inherit&amp;quot; class=&amp;quot;error&amp;quot;&amp;gt;وصلات خارجية عارية&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;cs1_like_refs&amp;#039;] = {														-- count cs1 refs and refs that look like cs1 (cite something)&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref[^&amp;gt;]*&amp;gt;[^&amp;lt;{]*{{%s*[Cc]ite%s+[^|]+)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;مراجع تشبه cs1&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;cs1_refs&amp;#039;] = {															-- count cs1 refs only&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_cs1,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref[^&amp;gt;]*&amp;gt;[^&amp;lt;{]*{{%%s*%s%%s+%s%%s*|)&amp;#039;,				-- will be modified in the func by string.format()&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;مراجع cs1&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;cs1_like_templates&amp;#039;] = {													-- count cs1 templates and templates that look like cs1&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Cc]ite%s+[^|]+)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب تشبه cs1&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;cs1_templates&amp;#039;] = {														-- count cs1 templates only&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_cs1,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%%s*%s%%s+%s%%s*|)&amp;#039;,								-- will be modified in the func by string.format()&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب cs1&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;cs2_refs&amp;#039;] = {															-- count cs2 refs&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref[^&amp;gt;]*&amp;gt;[^&amp;lt;{]*{{%s*[Cc]itation%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;مراجع cs2&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;cs2_templates&amp;#039;] = {														-- count cs2 templates&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Cc]itation%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب cs2&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;vcite_refs&amp;#039;] = {															-- count vancite, vcite, and vcite2 refs&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref[^&amp;gt;]*&amp;gt;[^&amp;lt;{]*{{%s*[Vv]a?n?cite2?%s+[^|]+)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;مراجع vcite&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;vcite_templates&amp;#039;] = {														-- count vancite, vcite, and vcite2 templates&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Vv]a?n?cite2?%s+[^|]+)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب vcite&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;wikicite_templates&amp;#039;] = {													-- count wikicite templates&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Ww]ikicite%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب wikicite&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;harv_refs&amp;#039;] = {															-- count harv refs&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;(&amp;lt;ref[^&amp;gt;]*&amp;gt;[^&amp;lt;{]*{{%s*[Hh]arv[nbcolptx]*%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;مراجع harv&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;harv_templates&amp;#039;] = {														-- count harv templates&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Hh]arv[nbcolptx]*%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب harv&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;sfn_templates&amp;#039;] = {														-- count sfn templates&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Ss]fn[mp]?%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب sfn&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;rp_templates&amp;#039;] = {														-- count rp templates&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Rr]p%s*|)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب rp&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;ldr&amp;#039;] = {																	-- does this article use list defined references?&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = has_ldr,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;&amp;#039;,														-- uses multiple patterns which are defined in the function&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = &amp;#039;no&amp;#039;,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;يستخدم ldr&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;refbegin_templates&amp;#039;] = {													-- count refbegin templates - bibliography lists&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_pattern,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%s*[Rr]efbegin|{{%s*بداية المراجع)&amp;#039;,&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قالب بداية المراجع&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;cleanup_templates&amp;#039;] = {													-- count cleanup templates&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_cleanup,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%%s*%s)&amp;#039;,												-- will be modified in the func by string.format()&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب صيانة&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	[&amp;#039;dead_link_templates&amp;#039;] = {													-- count deadlink templates (includes redirects)&lt;br /&gt;
		[&amp;#039;func&amp;#039;] = count_dead_links,&lt;br /&gt;
		[&amp;#039;pattern&amp;#039;] = &amp;#039;({{%%s*%s%%s*|)&amp;#039;,										-- will be modified in the func by string.format()&lt;br /&gt;
		[&amp;#039;count&amp;#039;] = 0,&lt;br /&gt;
		[&amp;#039;label&amp;#039;] = &amp;#039;قوالب وصلة مكسورة&amp;#039;&lt;br /&gt;
		},&lt;br /&gt;
	}&lt;br /&gt;
																				-- here we set the order in which the objects are processed&lt;br /&gt;
local order = {&amp;#039;unnamed_refs&amp;#039;, &amp;#039;named_refs&amp;#039;, &amp;#039;self_closed_refs&amp;#039;,				-- these three are always output&lt;br /&gt;
	&amp;#039;r_templates&amp;#039;,																-- this and the others only produce output when ...&lt;br /&gt;
	&amp;#039;refn_templates&amp;#039;,															-- ... their count is not 0 or not &amp;#039;no&amp;#039;&lt;br /&gt;
	&amp;#039;bare_url_refs&amp;#039;,&lt;br /&gt;
	&amp;#039;ext_link_refs&amp;#039;,&lt;br /&gt;
	&amp;#039;cs1_refs&amp;#039;,&lt;br /&gt;
	&amp;#039;cs1_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;cs1_like_refs&amp;#039;,&lt;br /&gt;
	&amp;#039;cs1_like_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;cs2_refs&amp;#039;, &amp;#039;cs2_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;vcite_refs&amp;#039;, &amp;#039;vcite_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;wikicite_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;harv_refs&amp;#039;, &amp;#039;harv_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;sfn_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;rp_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;ldr&amp;#039;,&lt;br /&gt;
	&amp;#039;refbegin_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;cleanup_templates&amp;#039;,&lt;br /&gt;
	&amp;#039;dead_link_templates&amp;#039;&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; P . R E F _ I N F O &amp;gt;----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
the working part of Template:Ref info&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p.ref_info(frame)&lt;br /&gt;
	local text;																	-- unparsed page content&lt;br /&gt;
	local title;																-- page title without namespace or interwiki references&lt;br /&gt;
	local nstitle;																-- page title with namespace and interwiki references&lt;br /&gt;
	local page_title_object;													-- &lt;br /&gt;
	local output = {};&lt;br /&gt;
	local i=1;&lt;br /&gt;
	local style = frame.args.style or &amp;#039;&amp;#039;;										-- styling css for output table&lt;br /&gt;
	&lt;br /&gt;
	if frame.args[1] then&lt;br /&gt;
		page_title_object = mw.title.new(frame.args[1]);						-- title object for the page specified in the template call&lt;br /&gt;
	else&lt;br /&gt;
		page_title_object = mw.title.getCurrentTitle();							-- title object for the current page&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	text = page_title_object:getContent();										-- the unparsed content of the selected page&lt;br /&gt;
	nstitle = page_title_object.prefixedText;									-- the title of the page (with namespace)&lt;br /&gt;
	title = page_title_object.text;												-- the title of the page (without namespace)&lt;br /&gt;
&lt;br /&gt;
	if nil == text then&lt;br /&gt;
		return string.format (&amp;#039;&amp;lt;span style=&amp;quot;font-size:100%%&amp;quot; class=&amp;quot;error&amp;quot;&amp;gt;{{ref info}} – page is empty or does not exist: %s&amp;lt;/span&amp;gt;&amp;#039;, frame.args[1] or &amp;#039;no page&amp;#039;);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	while order[i] do															-- loop through order and search for the related objects&lt;br /&gt;
		object = order[i];														-- the selected object&lt;br /&gt;
		objects[object].count = objects[object].func (text, objects[object].pattern)	-- do the search and store the result&lt;br /&gt;
		i=i+1;																	-- bump to the next object&lt;br /&gt;
	end&lt;br /&gt;
																				-- for those that count duplicates remove the duplicates from the counts&lt;br /&gt;
	objects[&amp;#039;named_refs&amp;#039;].count = objects[&amp;#039;named_refs&amp;#039;].count - objects[&amp;#039;self_closed_refs&amp;#039;].count;&lt;br /&gt;
	objects[&amp;#039;cs1_like_refs&amp;#039;].count = objects[&amp;#039;cs1_like_refs&amp;#039;].count - objects[&amp;#039;cs1_refs&amp;#039;].count;&lt;br /&gt;
	objects[&amp;#039;cs1_like_templates&amp;#039;].count = objects[&amp;#039;cs1_like_templates&amp;#039;].count - objects[&amp;#039;cs1_templates&amp;#039;].count ;&lt;br /&gt;
&lt;br /&gt;
	table.insert (output, string.format (&amp;#039;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:right; %s&amp;quot;\n|+ معلومات مراجع [[%s|%s]]&amp;#039;, style, nstitle, title));	-- output table header&lt;br /&gt;
&lt;br /&gt;
	i=1;																		-- reset the indexer&lt;br /&gt;
	while order[i] do															-- loop through order and output from the related objects&lt;br /&gt;
		object = order[i];														-- the selected object&lt;br /&gt;
		mw.log(object)&lt;br /&gt;
		if i&amp;lt;=3 or object == &amp;#039;dead_link_templates&amp;#039; or object == &amp;#039;cleanup_templates&amp;#039;  then															-- first three (reference tags) are always output&lt;br /&gt;
			table.insert (output, string.format (&amp;#039;%s\n|%s&amp;#039;, objects[object].label, objects[object].count));&lt;br /&gt;
		elseif &amp;#039;string&amp;#039; == type (objects[object].count) then					-- objects[object].count can be a string or a number&lt;br /&gt;
			if &amp;#039;no&amp;#039; ~= objects[object].count then								-- if a string and not &amp;#039;no&amp;#039; ...&lt;br /&gt;
				table.insert (output, string.format (&amp;#039;%s\n|%s&amp;#039;, objects[object].label, objects[object].count));	-- output the result&lt;br /&gt;
			end&lt;br /&gt;
		elseif &amp;#039;number&amp;#039; == type (objects[object].count) then					-- if a number ...&lt;br /&gt;
		 	if 0 &amp;lt; objects[object].count then									-- ... and count is greater than zero ...&lt;br /&gt;
				table.insert (output, string.format (&amp;#039;%s\n|%s&amp;#039;, objects[object].label, objects[object].count));	-- ... output the result&lt;br /&gt;
		--- تجربة&lt;br /&gt;
		 	--elseif 0 == objects[object].count then									-- ... and count is greater than zero ...&lt;br /&gt;
				--table.insert (output, string.format (&amp;#039;%s\n|%s&amp;#039;, objects[object].label, objects[object].count));	-- ... output the result&lt;br /&gt;
			end&lt;br /&gt;
		--- تجربة&lt;br /&gt;
		end&lt;br /&gt;
		i=i+1;																	-- bump the indexer&lt;br /&gt;
	end&lt;br /&gt;
	local result = table.concat (output,&amp;#039;\n|-\n! scope=&amp;quot;row&amp;quot; | &amp;#039;);&lt;br /&gt;
	return result .. &amp;#039;\n|-\n|scope=&amp;quot;row&amp;quot; colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align:center&amp;quot;|[[Template:Ref_info#Output_meanings|شرح]]\n|-\n|}&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>عبد العزيز</name></author>
	</entry>
</feed>