<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wicri-demo.istex.fr/Wicri/Arts/en/index.php?action=history&amp;feed=atom&amp;title=Module%3ACat_main</id>
	<title>Module:Cat main - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wicri-demo.istex.fr/Wicri/Arts/en/index.php?action=history&amp;feed=atom&amp;title=Module%3ACat_main"/>
	<link rel="alternate" type="text/html" href="https://wicri-demo.istex.fr/Wicri/Arts/en/index.php?title=Module:Cat_main&amp;action=history"/>
	<updated>2026-04-19T06:48:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.10</generator>
	<entry>
		<id>https://wicri-demo.istex.fr/Wicri/Arts/en/index.php?title=Module:Cat_main&amp;diff=595&amp;oldid=prev</id>
		<title>imported&gt;Jacques Ducloy: Created page with &quot;local mHatnote = require('Module:Hatnote') local mFormatLink = require('Module:Format link') local yesno = require('Module:Yesno') local mTableTools -- lazily initialise local...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wicri-demo.istex.fr/Wicri/Arts/en/index.php?title=Module:Cat_main&amp;diff=595&amp;oldid=prev"/>
		<updated>2023-12-26T21:52:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local mHatnote = require(&amp;#039;Module:Hatnote&amp;#039;) local mFormatLink = require(&amp;#039;Module:Format link&amp;#039;) local yesno = require(&amp;#039;Module:Yesno&amp;#039;) local mTableTools -- lazily initialise local...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local mHatnote = require('Module:Hatnote')&lt;br /&gt;
local mFormatLink = require('Module:Format link')&lt;br /&gt;
local yesno = require('Module:Yesno')&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.catMain(frame)&lt;br /&gt;
	mTableTools = require('Module:TableTools')&lt;br /&gt;
	mArguments = require('Module:Arguments')&lt;br /&gt;
	local args = mArguments.getArgs(frame, {wrappers = 'Template:Cat main'})&lt;br /&gt;
	local pages = mTableTools.compressSparseArray(args)&lt;br /&gt;
	local options = {&lt;br /&gt;
		article = args.article,&lt;br /&gt;
		selfref = args.selfref&lt;br /&gt;
	}&lt;br /&gt;
	return p._catMain(options, unpack(pages))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._catMain(options, ...)&lt;br /&gt;
	options = options or {}&lt;br /&gt;
&lt;br /&gt;
	-- Get the links table.&lt;br /&gt;
	local links = mFormatLink.formatPages({}, {...})&lt;br /&gt;
	if not links[1] then&lt;br /&gt;
		local page = mw.title.getCurrentTitle().text&lt;br /&gt;
		links[1] = mFormatLink._formatLink{link = page}&lt;br /&gt;
	end&lt;br /&gt;
	for i, link in ipairs(links) do&lt;br /&gt;
		links[i] = string.format(&amp;quot;'''%s'''&amp;quot;, link)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get the pagetype.&lt;br /&gt;
	local pages = {...}&lt;br /&gt;
	local pagetype &lt;br /&gt;
	&lt;br /&gt;
	if options.article ~= nil then&lt;br /&gt;
		pagetype = yesno(options.article) ~= false and 'article' or 'page'&lt;br /&gt;
	elseif pages and pages[1] then&lt;br /&gt;
		local page = pages[1]:gsub(&amp;quot;|.*&amp;quot;,&amp;quot;&amp;quot;)&lt;br /&gt;
		pagetype = mw.title.new(page).namespace == 0 and &amp;quot;article&amp;quot; or &amp;quot;page&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = &amp;quot;article&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Work out whether we need to be singular or plural.&lt;br /&gt;
	local stringToFormat&lt;br /&gt;
	if #links &amp;gt; 1 then&lt;br /&gt;
		stringToFormat = 'The main %ss for this [[Help:Categories|category]] are %s.'&lt;br /&gt;
	else&lt;br /&gt;
		stringToFormat = 'The main %s for this [[Help:Categories|category]] is %s.'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get the text.&lt;br /&gt;
	local text = string.format(&lt;br /&gt;
		stringToFormat,&lt;br /&gt;
		pagetype,&lt;br /&gt;
		mw.text.listToText(links)&lt;br /&gt;
	)&lt;br /&gt;
	&lt;br /&gt;
	-- Pass it through to Module:Hatnote.&lt;br /&gt;
	local hnOptions = {}&lt;br /&gt;
	hnOptions.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>imported&gt;Jacques Ducloy</name></author>
		
	</entry>
</feed>