<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fa">
	<id>https://wiki.ahlolbait.com/index.php?action=history&amp;feed=atom&amp;title=%D9%BE%D9%88%D8%AF%D9%85%D8%A7%D9%86%3AMain</id>
	<title>پودمان:Main - تاریخچهٔ ویرایش‌ها</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ahlolbait.com/index.php?action=history&amp;feed=atom&amp;title=%D9%BE%D9%88%D8%AF%D9%85%D8%A7%D9%86%3AMain"/>
	<link rel="alternate" type="text/html" href="https://wiki.ahlolbait.com/index.php?title=%D9%BE%D9%88%D8%AF%D9%85%D8%A7%D9%86:Main&amp;action=history"/>
	<updated>2026-04-20T17:54:56Z</updated>
	<subtitle>تاریخچهٔ ویرایش‌های این صفحه در ویکی</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>https://wiki.ahlolbait.com/index.php?title=%D9%BE%D9%88%D8%AF%D9%85%D8%A7%D9%86:Main&amp;diff=104758&amp;oldid=prev</id>
		<title>Zamani: صفحه‌ای تازه حاوی «--[[ -- This module produces a link to a main article or articles. It implements the -- template {{main}}. --  -- If the module is used in...» ایجاد کرد</title>
		<link rel="alternate" type="text/html" href="https://wiki.ahlolbait.com/index.php?title=%D9%BE%D9%88%D8%AF%D9%85%D8%A7%D9%86:Main&amp;diff=104758&amp;oldid=prev"/>
		<updated>2019-05-28T06:28:26Z</updated>

		<summary type="html">&lt;p&gt;صفحه‌ای تازه حاوی «--[[ -- This module produces a link to a main article or articles. It implements the -- template {{main}}. --  -- If the module is used in...» ایجاد کرد&lt;/p&gt;
&lt;p&gt;&lt;b&gt;صفحهٔ تازه&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
-- This module produces a link to a main article or articles. It implements the&lt;br /&gt;
-- template {{main}}.&lt;br /&gt;
-- &lt;br /&gt;
-- If the module is used in category or category talk space, it produces &amp;quot;The&lt;br /&gt;
-- main article for this category is xxx&amp;quot;. Otherwise, it produces&lt;br /&gt;
-- &amp;quot;Main article: xxx&amp;quot;.&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local mHatnote = require('Module:Hatnote')&lt;br /&gt;
local mTableTools -- lazily initialise&lt;br /&gt;
local mArguments -- lazily initialise&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	mTableTools = require('Module:TableTools')&lt;br /&gt;
	mArguments = require('Module:Arguments')&lt;br /&gt;
	local args = mArguments.getArgs(frame, {parentOnly = true})&lt;br /&gt;
	local pages = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if type(k) == 'number' then&lt;br /&gt;
			local display = args['l' .. tostring(k)]&lt;br /&gt;
			local page = {v, display}&lt;br /&gt;
			pages[k] = page&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	pages = mTableTools.compressSparseArray(pages)&lt;br /&gt;
	local options = {&lt;br /&gt;
		selfref = args.selfref&lt;br /&gt;
	}&lt;br /&gt;
	return p._main(options, unpack(pages))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(options, ...)&lt;br /&gt;
	-- Get the list of pages. If no first page was specified we use the current&lt;br /&gt;
	-- page name.&lt;br /&gt;
	local pages = {...}&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	local firstPageTable = pages[1]&lt;br /&gt;
	local firstPage&lt;br /&gt;
	if firstPageTable then&lt;br /&gt;
		firstPage = firstPageTable[1]&lt;br /&gt;
	else&lt;br /&gt;
		firstPage = currentTitle.text&lt;br /&gt;
		firstPageTable = {firstPage}&lt;br /&gt;
		pages[1] = firstPageTable&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find the pagetype.&lt;br /&gt;
	local firstPageNs = mHatnote.findNamespaceId(firstPage)&lt;br /&gt;
	local pagetype = firstPageNs == 0 and 'نوشتار' or 'صفحه'&lt;br /&gt;
&lt;br /&gt;
	-- Make the formatted link text&lt;br /&gt;
	local links = mHatnote.formatPageTables(unpack(pages))&lt;br /&gt;
	links = mw.text.listToText(links)&lt;br /&gt;
&lt;br /&gt;
	-- Build the text.&lt;br /&gt;
	local isPlural = #pages &amp;gt; 1&lt;br /&gt;
	local currentNs = currentTitle.namespace&lt;br /&gt;
	local isCategoryNamespace = currentNs - currentNs % 2 == 14&lt;br /&gt;
	local stringToFormat&lt;br /&gt;
	if isCategoryNamespace then&lt;br /&gt;
		if isPlural then&lt;br /&gt;
			stringToFormat = '%s‌های اصلی این'&lt;br /&gt;
				.. ' [[ویکی‌پدیا:رده‌بندی|رده]] %s هستند'&lt;br /&gt;
		else&lt;br /&gt;
			stringToFormat = '%s اصلی این'&lt;br /&gt;
				.. ' [[ویکی‌پدیا:رده‌بندی|رده]] %s است'&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		if isPlural then&lt;br /&gt;
			stringToFormat = '%s‌های اصلی: %s'&lt;br /&gt;
		else&lt;br /&gt;
			stringToFormat = '%s اصلی: %s'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local text = string.format(stringToFormat, pagetype, links)&lt;br /&gt;
&lt;br /&gt;
	-- Process the options and pass the text to the _rellink function in&lt;br /&gt;
	-- [[Module:Hatnote]].&lt;br /&gt;
	options = options or {}&lt;br /&gt;
	local hnOptions = {&lt;br /&gt;
		extraclasses = 'relarticle mainarticle',&lt;br /&gt;
		selfref = options.selfref&lt;br /&gt;
	}&lt;br /&gt;
	return mHatnote._hatnote(text, hnOptions)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zamani</name></author>
		
	</entry>
</feed>