<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt-BR">
	<id>https://wiki.tokusatsus.com/index.php?action=history&amp;feed=atom&amp;title=M%C3%B3dulo%3ACat_principal</id>
	<title>Módulo:Cat principal - Histórico de revisão</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tokusatsus.com/index.php?action=history&amp;feed=atom&amp;title=M%C3%B3dulo%3ACat_principal"/>
	<link rel="alternate" type="text/html" href="https://wiki.tokusatsus.com/index.php?title=M%C3%B3dulo:Cat_principal&amp;action=history"/>
	<updated>2026-07-05T10:55:38Z</updated>
	<subtitle>Histórico de revisões para esta página neste wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.tokusatsus.com/index.php?title=M%C3%B3dulo:Cat_principal&amp;diff=2504&amp;oldid=prev</id>
		<title>Tavoraadmin: Importando predefinição/módulo da Wikipédia em português para manter layout</title>
		<link rel="alternate" type="text/html" href="https://wiki.tokusatsus.com/index.php?title=M%C3%B3dulo:Cat_principal&amp;diff=2504&amp;oldid=prev"/>
		<updated>2026-07-05T05:18:07Z</updated>

		<summary type="html">&lt;p&gt;Importando predefinição/módulo da Wikipédia em português para manter layout&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{cat main}}.&lt;br /&gt;
&lt;br /&gt;
local mHatnote = require(&amp;#039;Módulo:Hatnote&amp;#039;)&lt;br /&gt;
local mFormatLink = require(&amp;#039;Módulo:Format link&amp;#039;)&lt;br /&gt;
local yesno = require(&amp;#039;Módulo:Yesno&amp;#039;)&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(&amp;#039;Módulo:TableTools&amp;#039;)&lt;br /&gt;
    mArguments = require(&amp;#039;Módulo:Arguments&amp;#039;)&lt;br /&gt;
    local args = mArguments.getArgs(frame, {wrappers = &amp;#039;Predefinição:Cat principal&amp;#039;})&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;&amp;#039;&amp;#039;&amp;#039;%s&amp;#039;&amp;#039;&amp;#039;&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 &amp;#039;artigo&amp;#039; or &amp;#039;página&amp;#039;&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;artigo&amp;quot; or &amp;quot;página&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = &amp;quot;artigo&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 = &amp;#039;Os [[Wikipédia:Artigo|%ss]] principais desta [[Wikipédia:Categoria|categoria]] são %s.&amp;#039;&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
        local artigo_definido = (pagetype == &amp;quot;página&amp;quot;) and &amp;quot;A&amp;quot; or &amp;quot;O&amp;quot;&lt;br /&gt;
        stringToFormat = artigo_definido .. &amp;#039; [[Wikipédia:Artigo|%s]] principal desta [[Wikipédia:Categoria|categoria]] é %s.&amp;#039;&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;
    hnOptions.extraclasses = &amp;#039;relarticle mainarticle&amp;#039;&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>Tavoraadmin</name></author>
	</entry>
</feed>