<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://nvwiki.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ALabelled_list_hatnote%2Fdoc</id>
	<title>Module:Labelled list hatnote/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nvwiki.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ALabelled_list_hatnote%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://nvwiki.org/index.php?title=Module:Labelled_list_hatnote/doc&amp;action=history"/>
	<updated>2026-05-13T15:55:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://nvwiki.org/index.php?title=Module:Labelled_list_hatnote/doc&amp;diff=1238&amp;oldid=prev</id>
		<title>Huanker: 1 revision imported: Import modules used with Template:Infobox software</title>
		<link rel="alternate" type="text/html" href="https://nvwiki.org/index.php?title=Module:Labelled_list_hatnote/doc&amp;diff=1238&amp;oldid=prev"/>
		<updated>2025-12-26T16:57:38Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Import modules used with Template:Infobox software&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:57, 26 December 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Huanker</name></author>
	</entry>
	<entry>
		<id>https://nvwiki.org/index.php?title=Module:Labelled_list_hatnote/doc&amp;diff=1237&amp;oldid=prev</id>
		<title>wikipedia&gt;Mathglot: /* Errors */ Add see also link to Template:Further#Errors.</title>
		<link rel="alternate" type="text/html" href="https://nvwiki.org/index.php?title=Module:Labelled_list_hatnote/doc&amp;diff=1237&amp;oldid=prev"/>
		<updated>2025-10-28T07:05:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Errors: &lt;/span&gt; Add see also link to &lt;a href=&quot;/index.php/Template:Further#Errors&quot; title=&quot;Template:Further&quot;&gt;Template:Further#Errors&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{module rating|protected}}&lt;br /&gt;
{{used in system|in [[MediaWiki:Wantedpages-summary]]}}&lt;br /&gt;
{{Lua|Module:Hatnote|Module:Hatnote list|Module:Arguments}}&lt;br /&gt;
&lt;br /&gt;
This module provides a handful of functions that make it easy to implement hatnotes that take the form of a label in front of a list of pages, e.g. {{hatnote|LABEL: [[A]], [[B]], and [[C]]}}&lt;br /&gt;
 &lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===labelledList===&lt;br /&gt;
Invoking the &amp;lt;code&amp;gt;labelledList()&amp;lt;/code&amp;gt; function is enough to implement most such templates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Labelled list hatnote|labelledList|Universal label}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Labelled list hatnote|labelledList|Singular label|Plural label}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, providing &amp;quot;See also&amp;quot; instead of &amp;quot;Universal label&amp;quot; duplicates the functionality of {{tl|see also}}, while providing &amp;quot;Main article&amp;quot; and &amp;quot;Main articles&amp;quot; instead of &amp;quot;Singular label&amp;quot; and &amp;quot;Plural label&amp;quot; duplicates the (article namespace) functionality of {{tl|main}}.&lt;br /&gt;
&lt;br /&gt;
If third and fourth labels are provided, they&amp;#039;ll be used in the case where any of the target pages are outside the article namespace, so e.g. {{tl|main}} can be implemented thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Labelled list hatnote|labelledList|Main article|Main articles|Main page|Main pages}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===preprocessDisplays===&lt;br /&gt;
The &amp;lt;code&amp;gt;preprocessDisplays()&amp;lt;/code&amp;gt; function takes a raw list of arguments and combines in any display arguments. For example, {{tlx|see also|1|&amp;lt;nowiki&amp;gt;l1=One&amp;lt;/nowiki&amp;gt;}} initially has the arguments table &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{&amp;#039;1&amp;#039;, [&amp;#039;l1&amp;#039;] = &amp;#039;One&amp;#039;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;; this table would combine those into the table &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{&amp;#039;1|One&amp;#039;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. It overrides manual piping (e.g. {{tlx|see also|&amp;lt;nowiki&amp;gt;1{{!}}2&amp;lt;/nowiki&amp;gt;|&amp;lt;nowiki&amp;gt;l1=One&amp;lt;/nowiki&amp;gt;}} → &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{&amp;#039;1|One&amp;#039;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;) and compresses sparse arrays if a parameter is skipped or left empty.&lt;br /&gt;
&lt;br /&gt;
Example: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local mLabelledList = require(&amp;#039;Module:Labelled list hatnote&amp;#039;)&lt;br /&gt;
local pages = mLabelledList.preprocessDisplays(args)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_labelledList===&lt;br /&gt;
For modules that need to modify the functionality slightly while still using it, &amp;lt;code&amp;gt;_labelledList()&amp;lt;/code&amp;gt; provides some flexibility. It takes three parameters:&lt;br /&gt;
# A pages list, preferably preprocessed and compressed by &amp;lt;code&amp;gt;preprocessDisplays&amp;lt;/code&amp;gt;&lt;br /&gt;
# A labels table, where the first item is the singular or universal label, and the second either a plural label or a copy of the first.&lt;br /&gt;
# An options table, preferably containing:&lt;br /&gt;
#* a &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt; string with the full title of the template. Defaults to the title of this module.&lt;br /&gt;
#* a &amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt; string (or nil) as taken by &amp;lt;code&amp;gt;makeWikitextError&amp;lt;/code&amp;gt; from [[Module:Hatnote]], to optionally disable error categories&lt;br /&gt;
#* a &amp;lt;code&amp;gt;selfref&amp;lt;/code&amp;gt; string (or nil) as taken by &amp;lt;code&amp;gt;_hatnote&amp;lt;/code&amp;gt; to enable the selfref option&lt;br /&gt;
&lt;br /&gt;
Example: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local mLabelledList = require(&amp;#039;Module:Labelled list hatnote&amp;#039;)&lt;br /&gt;
return mLabelledList._labelledList(pages, labels, options)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Errors==&lt;br /&gt;
&amp;lt;!-- &amp;#039;WP:Error: no page names specified&amp;#039; and &amp;#039;WP:Error: no output: none of the target pages exist&amp;#039; redirect here; see MOS:HIDDENLINKADVICE. --&amp;gt;&lt;br /&gt;
{{See also|Template:Further#Errors}}&lt;br /&gt;
This module causes templates based on it to produce an error message if no page names are provided as template parameters. Normally, these should lead back to &amp;quot;Errors&amp;quot; sections in the documentation of those templates. However, if those templates use a module with &amp;lt;code&amp;gt;_labelledList()&amp;lt;/code&amp;gt; and don&amp;#039;t provide a &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt; item in their options table, that error defaults to leading back here. The error can be solved by providing at least one valid page-name parameter to the template in question; the problem in the template can be fixed by providing some value to the &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt; item of the &amp;lt;code&amp;gt;_labelledList()&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;options&amp;lt;/code&amp;gt; table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Hatnote modules| ]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Module documentation pages]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Mathglot</name></author>
	</entry>
</feed>