<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://wikisp.org/wiki/index.php?action=history&amp;feed=atom&amp;title=M%C3%B3dulo%3AMainpage%2FNav</id>
	<title>Módulo:Mainpage/Nav - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://wikisp.org/wiki/index.php?action=history&amp;feed=atom&amp;title=M%C3%B3dulo%3AMainpage%2FNav"/>
	<link rel="alternate" type="text/html" href="https://wikisp.org/wiki/index.php?title=M%C3%B3dulo:Mainpage/Nav&amp;action=history"/>
	<updated>2026-09-14T05:33:11Z</updated>
	<subtitle>Historial de revisiones de esta página en la wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wikisp.org/wiki/index.php?title=M%C3%B3dulo:Mainpage/Nav&amp;diff=8134&amp;oldid=prev</id>
		<title>Luxbane: Página creada con «require(&#039;strict&#039;)  --- @module Mainpage/Nav --- The page&#039;s two link lists — the hero&#039;s chip strip and the directory at the --- foot — and the one function that turns a settings entry into wikitext. --- --- Loading belongs to Module:Mainpage/Config; this module only shapes what --- comes back. It exists separately because rendering a link is a concern of --- its own: two callers need the same treatment of internal versus external --- targets, and neither should hav…»</title>
		<link rel="alternate" type="text/html" href="https://wikisp.org/wiki/index.php?title=M%C3%B3dulo:Mainpage/Nav&amp;diff=8134&amp;oldid=prev"/>
		<updated>2026-09-11T23:21:23Z</updated>

		<summary type="html">&lt;p&gt;Página creada con «require(&amp;#039;strict&amp;#039;)  --- @module Mainpage/Nav --- The page&amp;#039;s two link lists — the hero&amp;#039;s chip strip and the directory at the --- foot — and the one function that turns a settings entry into wikitext. --- --- Loading belongs to Module:Mainpage/Config; this module only shapes what --- comes back. It exists separately because rendering a link is a concern of --- its own: two callers need the same treatment of internal versus external --- targets, and neither should hav…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
--- @module Mainpage/Nav&lt;br /&gt;
--- The page&amp;#039;s two link lists — the hero&amp;#039;s chip strip and the directory at the&lt;br /&gt;
--- foot — and the one function that turns a settings entry into wikitext.&lt;br /&gt;
---&lt;br /&gt;
--- Loading belongs to Module:Mainpage/Config; this module only shapes what&lt;br /&gt;
--- comes back. It exists separately because rendering a link is a concern of&lt;br /&gt;
--- its own: two callers need the same treatment of internal versus external&lt;br /&gt;
--- targets, and neither should have to know how a settings entry is spelled.&lt;br /&gt;
&lt;br /&gt;
local cfg = require(&amp;#039;Module:Mainpage/Config&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--- @class NavLink&lt;br /&gt;
--- @field page? string   Internal target. Mutually exclusive with `url`.&lt;br /&gt;
--- @field url? string    External target. Mutually exclusive with `page`.&lt;br /&gt;
--- @field label? string  Display text. Optional for `page`, required for `url`.&lt;br /&gt;
&lt;br /&gt;
--- Renders one link as wikitext rather than as an &amp;lt;a&amp;gt; element, so MediaWiki&lt;br /&gt;
--- builds the href, applies the cached page-existence class (a red link stays&lt;br /&gt;
--- visibly red here), and picks up the reader&amp;#039;s language variant.&lt;br /&gt;
---&lt;br /&gt;
--- An external link is emitted in single-bracket form; suppressing its arrow&lt;br /&gt;
--- icon is the caller&amp;#039;s job, by putting `plainlinks` on the containing&lt;br /&gt;
--- element.&lt;br /&gt;
---&lt;br /&gt;
--- @param link NavLink&lt;br /&gt;
--- @return string|nil  nil when the entry names no target at all&lt;br /&gt;
function p.renderLink(link)&lt;br /&gt;
	if link.url and link.url ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		return string.format(&amp;#039;[%s %s]&amp;#039;, link.url, link.label or link.url)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not link.page or link.page == &amp;#039;&amp;#039; then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if link.label and link.label ~= &amp;#039;&amp;#039; and link.label ~= link.page then&lt;br /&gt;
		return string.format(&amp;#039;[[%s|%s]]&amp;#039;, link.page, link.label)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return string.format(&amp;#039;[[%s]]&amp;#039;, link.page)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- True when any entry in the group points off-wiki, which is what decides&lt;br /&gt;
--- whether the group needs `plainlinks`. Checked per group rather than applied&lt;br /&gt;
--- to the whole directory so an all-internal group is not given a class that&lt;br /&gt;
--- does nothing.&lt;br /&gt;
---&lt;br /&gt;
--- @param links NavLink[]&lt;br /&gt;
--- @return boolean&lt;br /&gt;
function p.hasExternal(links)&lt;br /&gt;
	for _, link in ipairs(links) do&lt;br /&gt;
		if link.url and link.url ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- The hero&amp;#039;s chip strip.&lt;br /&gt;
--- @return NavLink[]&lt;br /&gt;
function p.chips()&lt;br /&gt;
	return cfg.list(&amp;#039;chips&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- The foot directory, as a list of { label, links } groups.&lt;br /&gt;
--- @return table[]&lt;br /&gt;
function p.directory()&lt;br /&gt;
	return cfg.list(&amp;#039;directory&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Luxbane</name></author>
	</entry>
</feed>