<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ADYK_nompage_links</id>
	<title>Module:DYK nompage links - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ADYK_nompage_links"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:DYK_nompage_links&amp;action=history"/>
	<updated>2026-06-15T02:44:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:DYK_nompage_links&amp;diff=471457&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:DYK_nompage_links&amp;diff=471457&amp;oldid=prev"/>
		<updated>2021-07-15T21:15:20Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{DYK nompage links}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local formatStringSingle = [[&lt;br /&gt;
&amp;lt;div class=&amp;quot;plainlinks hlist&amp;quot;&amp;gt;&lt;br /&gt;
* ( %s&lt;br /&gt;
* %s )&lt;br /&gt;
&amp;lt;/div&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
local formatStringMulti = [[&lt;br /&gt;
&amp;lt;div class=&amp;quot;plainlinks hlist&amp;quot;&amp;gt;&lt;br /&gt;
* ( %s )&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;plainlinks hlist&amp;quot;&amp;gt;&lt;br /&gt;
* ( Article history links: %s )&lt;br /&gt;
&amp;lt;/div&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function makeWikitextError(msg)&lt;br /&gt;
	return string.format('&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: %s&amp;lt;/strong&amp;gt;', msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeFullUrl(page, query, display)&lt;br /&gt;
	local url = mw.uri.fullUrl(page, query)&lt;br /&gt;
	if not url then&lt;br /&gt;
		url = makeWikitextError(string.format(&lt;br /&gt;
			'&amp;quot;%s&amp;quot; is not a valid page name',&lt;br /&gt;
			tostring(page)&lt;br /&gt;
		))&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&lt;br /&gt;
		'[%s %s]',&lt;br /&gt;
		tostring(url),&lt;br /&gt;
		display&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local mArguments = require('Module:Arguments')&lt;br /&gt;
	local mTableTools = require('Module:TableTools')&lt;br /&gt;
	local args = mArguments.getArgs(frame, {&lt;br /&gt;
		wrappers = 'Template:DYK nompage links'&lt;br /&gt;
	})&lt;br /&gt;
	local nominationPage = args.nompage&lt;br /&gt;
	local historyPages = mTableTools.compressSparseArray(args)&lt;br /&gt;
	return p._main(nominationPage, historyPages)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(nominationPage, historyPages)&lt;br /&gt;
	-- Deal with bad input.&lt;br /&gt;
	if not nominationPage then&lt;br /&gt;
		return makeWikitextError('no nomination page specified')&lt;br /&gt;
	end&lt;br /&gt;
	if not historyPages or not historyPages[1] then&lt;br /&gt;
		return makeWikitextError('no articles specified')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find out whether we are dealing with multiple history pages.&lt;br /&gt;
	local isMulti = #historyPages &amp;gt; 1&lt;br /&gt;
&lt;br /&gt;
	-- Make the nompage link.&lt;br /&gt;
	local nominationLink&lt;br /&gt;
	do&lt;br /&gt;
		local currentPage = mw.title.getCurrentTitle().prefixedText&lt;br /&gt;
		local dykSubpage = 'Template:Did you know nominations/' .. nominationPage&lt;br /&gt;
		if currentPage == dykSubpage then&lt;br /&gt;
			nominationLink = string.format(&lt;br /&gt;
				'[[Template talk:Did you know#%s|Back to T:TDYK]]',&lt;br /&gt;
				nominationPage&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			nominationLink = makeFullUrl(&lt;br /&gt;
				'Template:Did you know nominations/' .. nominationPage,&lt;br /&gt;
				{action = 'edit'},&lt;br /&gt;
				'Review or comment'&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Make the history links.&lt;br /&gt;
	local historyLinks&lt;br /&gt;
	do&lt;br /&gt;
		if isMulti then&lt;br /&gt;
			local links = {}&lt;br /&gt;
			for i, page in ipairs(historyPages) do&lt;br /&gt;
				links[#links + 1] = makeFullUrl(&lt;br /&gt;
					page,&lt;br /&gt;
					{action = 'history'},&lt;br /&gt;
					page&lt;br /&gt;
				)&lt;br /&gt;
			end&lt;br /&gt;
			historyLinks = table.concat(links, '\n* ')&lt;br /&gt;
		else&lt;br /&gt;
			historyLinks = makeFullUrl(&lt;br /&gt;
				historyPages[1],&lt;br /&gt;
				{action = 'history'},&lt;br /&gt;
				'Article history'&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the output.&lt;br /&gt;
	local stringToFormat = isMulti and formatStringMulti or formatStringSingle&lt;br /&gt;
	return string.format(stringToFormat, nominationLink, historyLinks)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>