<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bharatpedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AArchive</id>
	<title>Module:Archive - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.bharatpedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AArchive"/>
	<link rel="alternate" type="text/html" href="https://en.bharatpedia.org/w/index.php?title=Module:Archive&amp;action=history"/>
	<updated>2026-11-14T02:39:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://en.bharatpedia.org/w/index.php?title=Module:Archive&amp;diff=565963&amp;oldid=prev</id>
		<title>Bharatwiki Socrates: Created page with &quot;------------------------------------------------------------------------------- --                       Automatic archive navigator -- -- This module produces a talk archive banner, together with an automatically- -- generated list of navigation links to other archives of the talk page in -- question. It implements {{Archive}}. -------------------------------------------------------------------------------  local yesno = require(&#039;Module:Yesno&#039;)  ------------------------...&quot;</title>
		<link rel="alternate" type="text/html" href="https://en.bharatpedia.org/w/index.php?title=Module:Archive&amp;diff=565963&amp;oldid=prev"/>
		<updated>2026-10-06T07:54:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;------------------------------------------------------------------------------- --                       Automatic archive navigator -- -- This module produces a talk archive banner, together with an automatically- -- generated list of navigation links to other archives of the talk page in -- question. It implements {{Archive}}. -------------------------------------------------------------------------------  local yesno = require(&amp;#039;Module:Yesno&amp;#039;)  ------------------------...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-------------------------------------------------------------------------------&lt;br /&gt;
--                       Automatic archive navigator&lt;br /&gt;
--&lt;br /&gt;
-- This module produces a talk archive banner, together with an automatically-&lt;br /&gt;
-- generated list of navigation links to other archives of the talk page in&lt;br /&gt;
-- question. It implements {{Archive}}.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeWikilink(page, display)&lt;br /&gt;
	if display then&lt;br /&gt;
		return string.format(&amp;#039;[[%s|%s]]&amp;#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;#039;[[%s]]&amp;#039;, page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function escapePattern(s)&lt;br /&gt;
	-- Escape punctuation in a string so it can be used in a Lua pattern.&lt;br /&gt;
	s = s:gsub(&amp;#039;%p&amp;#039;, &amp;#039;%%%0&amp;#039;)&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeTable(width)&lt;br /&gt;
	local archiveTable = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
	archiveTable&lt;br /&gt;
		:css({&lt;br /&gt;
			[&amp;#039;max-width&amp;#039;] = width,&lt;br /&gt;
			[&amp;#039;margin&amp;#039;] = &amp;#039;0 auto 0.5em&amp;#039;,&lt;br /&gt;
			[&amp;#039;text-align&amp;#039;] = &amp;#039;center&amp;#039;&lt;br /&gt;
		})&lt;br /&gt;
		-- Set width so that the table doesn&amp;#039;t spill out on narrower skins&lt;br /&gt;
		-- or when zooming in. It has to be defined multiple times because &lt;br /&gt;
		-- &amp;quot;stretch&amp;quot; is experimental.&lt;br /&gt;
		:cssText(&amp;#039;width:100%;width:-moz-available;width:-webkit-fill-available;width:stretch&amp;#039;)&lt;br /&gt;
	return archiveTable&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Check to see if the page is likely an annual archive. No talk pages exist &lt;br /&gt;
-- before 2001. Some pages have the next year created in advance.&lt;br /&gt;
local function isYearlyArchive(num)&lt;br /&gt;
    local currentYear = tonumber(os.date(&amp;quot;%Y&amp;quot;))&lt;br /&gt;
    return num and num &amp;gt;= 2001 and num &amp;lt;= currentYear + 1 -- possible years&lt;br /&gt;
end&lt;br /&gt;
local function detectArchiveFormat(title, args)&lt;br /&gt;
	-- Check if next/previous are set. Some archives swap between annual and &lt;br /&gt;
	-- sequential archives at some point and will need to accept whatever an&lt;br /&gt;
	-- editor says the next/previous link should be for these kind of weird &lt;br /&gt;
	-- or unsual orders.&lt;br /&gt;
    if args and (args.prev or args.next) then&lt;br /&gt;
        return nil, nil, nil&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Check if &amp;quot;/Archive 2&amp;quot; exists to prevent false positives on noticeboards&lt;br /&gt;
    local archiveBase = title.baseText&lt;br /&gt;
    local archive2Title = mw.title.new(archiveBase .. &amp;quot;/Archive 2&amp;quot;)&lt;br /&gt;
    if archive2Title and archive2Title.exists then&lt;br /&gt;
        return nil, nil, nil -- Exit early for sequential archives&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- How is the year formatted?&lt;br /&gt;
    local patterns = {&lt;br /&gt;
        {pattern = &amp;quot;^(.-)/Archive (%d+)$&amp;quot;, prefix = nil}, -- &amp;quot;Talk:Base page/Archive YYYY&amp;quot;&lt;br /&gt;
        -- &amp;quot;nil&amp;quot; triggers the default. There is some kind of quirk with how&lt;br /&gt;
        -- the module give spaces that Template:Yearly archive list cannot&lt;br /&gt;
        -- read with either a space or the HTML space entity&lt;br /&gt;
        {pattern = &amp;quot;^(.-)/Archive(%d+)$&amp;quot;, prefix = &amp;quot;/Archive&amp;quot;}, -- &amp;quot;Talk:Base page/ArchiveYYYY&amp;quot;&lt;br /&gt;
        {pattern = &amp;quot;^(.-)/Archive/(%d+)$&amp;quot;, prefix = &amp;quot;/Archive/&amp;quot;}, -- &amp;quot;Talk:Base page/Archive/YYYY&amp;quot;&lt;br /&gt;
        {pattern = &amp;quot;^(.-)/Archives/(%d+)$&amp;quot;, prefix = &amp;quot;/Archives/&amp;quot;}, -- &amp;quot;Talk:Base page/Archives/YYYY&amp;quot;&lt;br /&gt;
        {pattern = &amp;quot;^(.-)/(%d+)$&amp;quot;, prefix = &amp;quot;/&amp;quot;} -- &amp;quot;Talk:Base page/YYYY&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    for _, p in ipairs(patterns) do&lt;br /&gt;
        local basePage, archiveNum = title.prefixedText:match(p.pattern)&lt;br /&gt;
        archiveNum = tonumber(archiveNum)&lt;br /&gt;
        if basePage and isYearlyArchive(archiveNum) then&lt;br /&gt;
            return basePage, true, p.prefix&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return nil, nil, nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Navigator class&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Navigator = {}&lt;br /&gt;
Navigator.__index = Navigator&lt;br /&gt;
&lt;br /&gt;
function Navigator.new(args, cfg, currentTitle)&lt;br /&gt;
	local obj = setmetatable({}, Navigator)&lt;br /&gt;
	&lt;br /&gt;
	-- Set inputs&lt;br /&gt;
	obj.args = args&lt;br /&gt;
	obj.cfg = cfg&lt;br /&gt;
	obj.currentTitle = currentTitle&lt;br /&gt;
&lt;br /&gt;
	-- Archive prefix&lt;br /&gt;
	-- Decode HTML entities so users can enter things like &amp;quot;Archive&amp;amp;#32;&amp;quot; from&lt;br /&gt;
	-- wikitext.&lt;br /&gt;
	obj.archivePrefix = obj.args.prefix or obj:message(&amp;#039;archive-prefix&amp;#039;)&lt;br /&gt;
	obj.archivePrefix = mw.text.decode(obj.archivePrefix)&lt;br /&gt;
&lt;br /&gt;
	-- Current archive number&lt;br /&gt;
	do&lt;br /&gt;
		local pattern = string.format(&lt;br /&gt;
			&amp;#039;^%s([1-9][0-9]*)$&amp;#039;,&lt;br /&gt;
			escapePattern(obj.archivePrefix)&lt;br /&gt;
		)&lt;br /&gt;
		obj.currentArchiveNum = obj.currentTitle.subpageText:match(pattern)&lt;br /&gt;
		obj.currentArchiveNum = tonumber(obj.currentArchiveNum)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Highest archive number&lt;br /&gt;
	obj.highestArchiveNum = require(&amp;#039;Module:Highest archive number&amp;#039;)._main(&lt;br /&gt;
		 obj.currentTitle.nsText ..&lt;br /&gt;
		 	&amp;#039;:&amp;#039; .. &lt;br /&gt;
			obj.currentTitle.baseText .. &lt;br /&gt;
			&amp;#039;/&amp;#039; .. &lt;br /&gt;
			obj.archivePrefix,&lt;br /&gt;
		obj.currentArchiveNum&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
	return obj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Navigator:message(key, ...)&lt;br /&gt;
	local msg = self.cfg[key]&lt;br /&gt;
	if select(&amp;#039;#&amp;#039;, ...) &amp;gt; 0 then&lt;br /&gt;
		return mw.message.newRawMessage(msg, ...):plain()&lt;br /&gt;
	else&lt;br /&gt;
		return msg&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Navigator:getNamespacePreposition()&lt;br /&gt;
	-- Most talk archives are about a subject. Some will be &amp;quot;with&amp;quot; an editor&lt;br /&gt;
	-- or &amp;quot;on&amp;quot; a noticeboard.&lt;br /&gt;
	-- Function to get the namespace preposition&lt;br /&gt;
		&lt;br /&gt;
	-- Namespace number where transcluded&lt;br /&gt;
	local namespaceNumber = mw.title.getCurrentTitle().namespace&lt;br /&gt;
	-- Preposition from table to make it easy for wikis to translate or ignore&lt;br /&gt;
	local namespacePrepositionTable = self.cfg[&amp;#039;namespace-prepositions&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
	-- Default preposition if not exception from above&lt;br /&gt;
    return namespacePrepositionTable[namespaceNumber] or self.cfg[&amp;quot;preposition-default&amp;quot;]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Navigator:makeBlurb()&lt;br /&gt;
	local args = self.args&lt;br /&gt;
	local current = self.currentTitle&lt;br /&gt;
	local ret&lt;br /&gt;
	&lt;br /&gt;
	-- Skip if user provides their own blurb.&lt;br /&gt;
	if args.text then&lt;br /&gt;
		ret = args.text&lt;br /&gt;
	else&lt;br /&gt;
		-- Set parent talk page.&lt;br /&gt;
		local parentTalkPage = current.basePageTitle&lt;br /&gt;
		local talkPageTitle&lt;br /&gt;
		local pageUnderDiscussion&lt;br /&gt;
		&lt;br /&gt;
		-- If the parent talk page exists (and it&amp;#039;s not the root talk page)&lt;br /&gt;
		-- we should link to it in both the &amp;quot;main talk page&amp;quot; and &lt;br /&gt;
		-- &amp;quot;discussions about&amp;quot; parts of the blurb. &lt;br /&gt;
		if args.prefix or (parentTalkPage.exists and parentTalkPage.isRedirect == false and current.baseText ~= current.rootText) then&lt;br /&gt;
			talkPageTitle = parentTalkPage.fullText&lt;br /&gt;
			pageUnderDiscussion = talkPageTitle&lt;br /&gt;
		-- If it doesn&amp;#039;t, set &amp;quot;main talk page&amp;quot; to the root talk page&lt;br /&gt;
		-- and &amp;quot;discussions about&amp;quot; to the root subject.&lt;br /&gt;
		else&lt;br /&gt;
			talkPageTitle = current.nsText .. &amp;#039;:&amp;#039; .. parentTalkPage.rootText&lt;br /&gt;
			-- Set page under discussion.&lt;br /&gt;
			pageUnderDiscussion = current.subjectNsText .. &amp;#039;:&amp;#039; .. current.rootText&lt;br /&gt;
			&lt;br /&gt;
			-- Prepend colon for non-mainspace pages.&lt;br /&gt;
			if current.subjectNsText ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				pageUnderDiscussion = &amp;#039;:&amp;#039; .. pageUnderDiscussion &lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Check current namespace for blurb.&lt;br /&gt;
		local namespace = &amp;#039;main&amp;#039;&lt;br /&gt;
		if current.isTalkPage == true then&lt;br /&gt;
			namespace = &amp;#039;talk&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- What kind of blurb to use in the message box?&lt;br /&gt;
		local function getBlurbKey(args)&lt;br /&gt;
    		if args.type == &amp;#039;index&amp;#039; then&lt;br /&gt;
    			-- For manually-indexed archives only&lt;br /&gt;
        		return &amp;#039;blurb-index&amp;#039;, args.type&lt;br /&gt;
        	elseif args.type == &amp;#039;annual&amp;#039; then&lt;br /&gt;
			-- Grab the year of the current archive.&lt;br /&gt;
				return &amp;#039;blurb-annual&amp;#039;, mw.getCurrentFrame():expandTemplate {&lt;br /&gt;
					title = &amp;#039;Title year&amp;#039;, args = { page = current.fullText }&lt;br /&gt;
				}&lt;br /&gt;
    		elseif args.period then&lt;br /&gt;
        		return &amp;#039;blurb-period&amp;#039;, args.period&lt;br /&gt;
    		else&lt;br /&gt;
        		return &amp;#039;blurb-noperiod&amp;#039;, &amp;#039;&amp;#039;&lt;br /&gt;
    		end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- Generate a blurb from Module:Archive/config&lt;br /&gt;
		local blurbKey, argValue = getBlurbKey(args)&lt;br /&gt;
		local namespacePreposition = self:getNamespacePreposition()&lt;br /&gt;
		ret = self:message(blurbKey, talkPageTitle, pageUnderDiscussion, argValue, namespace, namespacePreposition)&lt;br /&gt;
&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Navigator:makeMessageBox()&lt;br /&gt;
	local args = self.args&lt;br /&gt;
	local image&lt;br /&gt;
	if args.image then&lt;br /&gt;
		image = args.image&lt;br /&gt;
	else&lt;br /&gt;
		local icon = args.icon or self:message(&amp;#039;default-icon&amp;#039;)&lt;br /&gt;
		image = string.format(&lt;br /&gt;
			&amp;#039;[[File:%s|%s|alt=|link=]]&amp;#039;,&lt;br /&gt;
			icon,&lt;br /&gt;
			self:message(&amp;#039;image-size&amp;#039;)&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Hardcode tmbox style on the template&amp;#039;s page.&lt;br /&gt;
	-- PS: Needs to be changed if the template is renamed!&lt;br /&gt;
	local mainTemplatePage = &amp;#039;&amp;#039;&lt;br /&gt;
	if self.currentTitle.fullText == &amp;#039;Template:Archive&amp;#039; then&lt;br /&gt;
		mainTemplatePage = &amp;#039;talk&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local mbox = require(&amp;#039;Module:Message box&amp;#039;).main(&amp;#039;mbox&amp;#039;, {&lt;br /&gt;
		demospace = args.demospace or mainTemplatePage,&lt;br /&gt;
		image = image,&lt;br /&gt;
		imageright = args.imageright,&lt;br /&gt;
		style = args.style or &amp;#039;&amp;#039;,&lt;br /&gt;
		textstyle = args.textstyle or &amp;#039;text-align:center&amp;#039;,&lt;br /&gt;
		text = self:makeBlurb(),&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	return mbox&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Navigator:getArchiveNums()&lt;br /&gt;
	-- Returns an array of the archive numbers to format.&lt;br /&gt;
	local noLinks = tonumber(self.args.links) or self:message(&amp;#039;default-link-count&amp;#039;)&lt;br /&gt;
	noLinks = math.floor(noLinks)&lt;br /&gt;
	-- If |noredlinks is &amp;quot;yes&amp;quot;, true or absent, don&amp;#039;t allow red links. If it is &lt;br /&gt;
	-- &amp;#039;no&amp;#039; or false, allow red links.&lt;br /&gt;
	local allowRedLinks = yesno(self.args.noredlinks) == false&lt;br /&gt;
	&lt;br /&gt;
	local current = self.currentArchiveNum&lt;br /&gt;
	local highest = self.highestArchiveNum&lt;br /&gt;
&lt;br /&gt;
	if not current or not highest or noLinks &amp;lt; 1 then&lt;br /&gt;
		return {}&lt;br /&gt;
	elseif noLinks == 1 then&lt;br /&gt;
		return {current}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function getNum(i, current)&lt;br /&gt;
		-- Gets an archive number given i, the position in the array away from&lt;br /&gt;
		-- the current archive, and the current archive number. The first two&lt;br /&gt;
		-- offsets are consecutive; the third offset is rounded up to the&lt;br /&gt;
		-- nearest 5; and the fourth and subsequent offsets are rounded up to&lt;br /&gt;
		-- the nearest 10. The offsets are calculated in such a way that archive&lt;br /&gt;
		-- numbers will not be duplicated.&lt;br /&gt;
		if -2 &amp;lt;= i and i &amp;lt;= 2 then&lt;br /&gt;
			return current + i&lt;br /&gt;
		elseif -3 &amp;lt;= i and i &amp;lt;= 3 then&lt;br /&gt;
			return current + 2 - (current + 2) % 5 + (i / 3) * 5&lt;br /&gt;
		elseif 4 &amp;lt;= i then&lt;br /&gt;
			return current + 7 - (current + 7) % 10 + (i - 3) * 10&lt;br /&gt;
		else&lt;br /&gt;
			return current + 2 - (current + 2) % 10 + (i + 3) * 10&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local nums = {}&lt;br /&gt;
&lt;br /&gt;
	-- Archive nums lower than the current page.&lt;br /&gt;
	for i = -1, -math.floor((noLinks - 1) / 2), -1 do&lt;br /&gt;
		local num = getNum(i, current)&lt;br /&gt;
		if num &amp;lt;= 1 then&lt;br /&gt;
			table.insert(nums, 1, 1)&lt;br /&gt;
			break&lt;br /&gt;
		else&lt;br /&gt;
			table.insert(nums, 1, num)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Current page.&lt;br /&gt;
	if nums[#nums] &amp;lt; current then&lt;br /&gt;
		table.insert(nums, current)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Higher archive nums.&lt;br /&gt;
	for i = 1, math.ceil((noLinks - 1) / 2) do&lt;br /&gt;
		local num = getNum(i, current)&lt;br /&gt;
		if num &amp;lt;= highest then&lt;br /&gt;
			table.insert(nums, num)&lt;br /&gt;
		elseif allowRedLinks and (i &amp;lt;= 2 or i &amp;lt;= 3 and num == nums[#nums] + 1) then&lt;br /&gt;
			-- Only insert one red link, and only if it is consecutive.&lt;br /&gt;
			table.insert(nums, highest + 1)&lt;br /&gt;
			break&lt;br /&gt;
		elseif nums[#nums] &amp;lt; highest then&lt;br /&gt;
			-- Insert the highest archive number if it isn&amp;#039;t already there.&lt;br /&gt;
			table.insert(nums, highest)&lt;br /&gt;
			break&lt;br /&gt;
		else&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return nums&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Navigator:makeArchiveLinksWikitable()&lt;br /&gt;
	local args = self.args&lt;br /&gt;
	local lang = mw.language.getContentLanguage()&lt;br /&gt;
	local nums = self:getArchiveNums()&lt;br /&gt;
	local noLinks = #nums&lt;br /&gt;
	&lt;br /&gt;
	-- Skip number processing if |prev and |next are defined.&lt;br /&gt;
	if args.prev or args.next then&lt;br /&gt;
		local archives = {}&lt;br /&gt;
		if args.prev then archives[#archives + 1] = mw.title.new(args.prev) end&lt;br /&gt;
		archives[#archives + 1] = self.currentTitle&lt;br /&gt;
		if args.next then archives[#archives + 1] = mw.title.new(args.next) end&lt;br /&gt;
		&lt;br /&gt;
		local table = makeTable(&amp;#039;30em&amp;#039;)&lt;br /&gt;
		for _, title in ipairs(archives) do&lt;br /&gt;
			if tostring(title) == self.currentTitle.prefixedText then&lt;br /&gt;
				table:tag(&amp;quot;td&amp;quot;):wikitext(string.format(&lt;br /&gt;
					&amp;#039;&amp;lt;span style=&amp;quot;font-size:115%%;&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;&amp;#039;,&lt;br /&gt;
					makeWikilink(title.fullText, title.subpageText)&lt;br /&gt;
				))&lt;br /&gt;
			else&lt;br /&gt;
				table:tag(&amp;quot;td&amp;quot;):wikitext(&lt;br /&gt;
					makeWikilink(title.fullText, title.subpageText)&lt;br /&gt;
				)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return tostring(table)&lt;br /&gt;
	end&lt;br /&gt;
	if noLinks &amp;lt; 1 then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Make the table of links.&lt;br /&gt;
	local links = {}&lt;br /&gt;
	local isCompact = noLinks &amp;gt; 7&lt;br /&gt;
	local currentIndex&lt;br /&gt;
	for i, num in ipairs(nums) do&lt;br /&gt;
		local subpage = self.archivePrefix .. tostring(num)&lt;br /&gt;
		local display&lt;br /&gt;
		if isCompact then&lt;br /&gt;
			display = tostring(num)&lt;br /&gt;
		else&lt;br /&gt;
			display = self:message(&amp;#039;archive-link-display&amp;#039;, num)&lt;br /&gt;
		end&lt;br /&gt;
		local link = makeWikilink(&amp;#039;../&amp;#039; .. subpage, display)&lt;br /&gt;
		if num == self.currentArchiveNum then&lt;br /&gt;
			link = string.format(&amp;#039;&amp;lt;span style=&amp;quot;font-size:115%%;&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;&amp;#039;, link)&lt;br /&gt;
			currentIndex = i&lt;br /&gt;
		end&lt;br /&gt;
		table.insert(links, link)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the arrows.&lt;br /&gt;
	-- We must do the forwards arrow first as we are adding elements to the&lt;br /&gt;
	-- links table. If we did the backwards arrow first the index for the&lt;br /&gt;
	-- current archive would be wrong.&lt;br /&gt;
	currentIndex = currentIndex or math.ceil(#links / 2)&lt;br /&gt;
	for i = currentIndex + 1, #links do&lt;br /&gt;
		if nums[i] - nums[i - 1] &amp;gt; 1 then&lt;br /&gt;
			table.insert(links, i, lang:getArrow(&amp;#039;forwards&amp;#039;))&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	for i = currentIndex - 1, 1, -1 do&lt;br /&gt;
		if nums[i + 1] - nums[i] &amp;gt; 1 then&lt;br /&gt;
			table.insert(links, i + 1, lang:getArrow(&amp;#039;backwards&amp;#039;))&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Output the wikitable.&lt;br /&gt;
	local width&lt;br /&gt;
	if noLinks &amp;lt;= 3 then&lt;br /&gt;
		width = string.format(&amp;#039;%dem&amp;#039;, noLinks * 10)&lt;br /&gt;
	elseif noLinks &amp;lt;= 7 then&lt;br /&gt;
		width = string.format(&amp;#039;%dem&amp;#039;, (noLinks + 3) * 5)&lt;br /&gt;
	else&lt;br /&gt;
		width = &amp;#039;37em&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	local table = makeTable(width)&lt;br /&gt;
	for _, s in ipairs(links) do&lt;br /&gt;
		table:tag(&amp;quot;td&amp;quot;):wikitext(s)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return tostring(table)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Navigator:__tostring()&lt;br /&gt;
	local args = self.args&lt;br /&gt;
	local boxComponents&lt;br /&gt;
	&lt;br /&gt;
-- Is |omit filled? If not, make the whole box.&lt;br /&gt;
	if args.omit == nil then&lt;br /&gt;
&lt;br /&gt;
-- Check for annual archives&lt;br /&gt;
	local currentTitle = self.currentTitle&lt;br /&gt;
	local yearlyBase, isYearly, yearlyPattern = detectArchiveFormat(currentTitle, args)&lt;br /&gt;
&lt;br /&gt;
	if isYearly then&lt;br /&gt;
    	-- Use a yearly archive format&lt;br /&gt;
    	local linksYearlyListSeparator = &amp;quot;&amp;amp;#32;&amp;quot; -- Space separator&lt;br /&gt;
    	local linksYearlyList = mw.getCurrentFrame():expandTemplate {&lt;br /&gt;
    	    title = &amp;#039;Yearly archive list&amp;#039;,&lt;br /&gt;
        	args = { &lt;br /&gt;
        		root = yearlyBase, &lt;br /&gt;
        		sep = linksYearlyListSeparator,&lt;br /&gt;
        		prefix = yearlyPattern&lt;br /&gt;
        	}&lt;br /&gt;
    	}&lt;br /&gt;
    	boxComponents = self:makeMessageBox() .. &amp;#039;\n&amp;#039; ..&lt;br /&gt;
        &amp;#039;&amp;lt;div style=&amp;quot;font-size:115%; width:100%; word-spacing:1em; text-align:center;&amp;quot;&amp;gt;&amp;#039; .. linksYearlyList .. &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
    	-- Default numbered archive format&lt;br /&gt;
    	boxComponents = self:makeMessageBox() .. &amp;#039;\n&amp;#039; .. self:makeArchiveLinksWikitable()&lt;br /&gt;
	end	-- We&amp;#039;re omitting the banner, so we should only make the links table.&lt;br /&gt;
	elseif args.omit == &amp;#039;banner&amp;#039; then &lt;br /&gt;
		boxComponents = self:makeArchiveLinksWikitable()&lt;br /&gt;
	-- We&amp;#039;re omitting the archives, so we should only make the banner.&lt;br /&gt;
    elseif args.omit == &amp;#039;archives&amp;#039; then&lt;br /&gt;
        boxComponents = self:makeMessageBox()&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Allow for demo pages to be edited freely. &lt;br /&gt;
	if not args.demospace then&lt;br /&gt;
		boxComponents = boxComponents .. &amp;#039; __NONEWSECTIONLINK__ __NOEDITSECTION__ __ARCHIVEDTALK__&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return boxComponents&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Exports&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._exportClasses()&lt;br /&gt;
	return {&lt;br /&gt;
		Navigator = Navigator&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._aan(args, cfg, currentTitle)&lt;br /&gt;
	cfg = cfg or mw.loadData(&amp;#039;Module:Archive/config&amp;#039;)&lt;br /&gt;
	currentTitle = currentTitle or mw.title.getCurrentTitle()&lt;br /&gt;
	local aan = Navigator.new(args, cfg, currentTitle)&lt;br /&gt;
	return tostring(aan)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.aan(frame)&lt;br /&gt;
	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {&lt;br /&gt;
		wrappers = &amp;#039;Template:Archive&amp;#039;,&lt;br /&gt;
	})&lt;br /&gt;
	return p._aan(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Bharatwiki Socrates</name></author>
	</entry>
</feed>