Module:Main list/doc

&#x3c;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikidata) --&#x3e; This module produces a "For a more comprehensive list, see [...]" link. It implements the main list template.

Use from wikitext
This module cannot be used directly from #invoke. Instead, it can only be used through the main list template. Please see the template page for documentation.

Use from other Lua modules
Load the module:

&#x3c;syntaxhighlight lang="lua"&#x3e; local mMainList = require('Module:Main list') &#x3c;/syntaxhighlight&#x3e;

You can then use the _mainList function like this:

&#x3c;syntaxhighlight lang="lua"&#x3e; mMainList._mainList (page1, page2) &#x3c;/syntaxhighlight&#x3e;

The &#x3c;var&#x3e;page1&#x3c;/var&#x3e; variable is the page to be linked to, and is required. The page name can include a section link if desired. If the page includes a section link, it is automatically formatted as page § section, rather than the MediaWiki default of page#section.

The &#x3c;var&#x3e;page2&#x3c;/var&#x3e; variable is optional; it is a second page link.

Example 1
&#x3c;syntaxhighlight lang="lua"&#x3e; mMainList._mainList ('Wikipedia:Hatnote#Hatnote templates') &#x3c;/syntaxhighlight&#x3e; Produces:
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;div class="hatnote"&#x3e;For a more comprehensive list, see Wikipedia:Hatnote § Hatnote templates.&#x3c;/div&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e;

Displays as: &#x3c;div class="hatnote"&#x3e;For a more comprehensive list, see Wikipedia:Hatnote § Hatnote templates.&#x3c;/div&#x3e;

Example 2
&#x3c;syntaxhighlight lang="lua"&#x3e; mMainList._mainList ('Wikipedia:Hatnote#Hatnote templates','Wikipedia:Template messages/Cleanup#Cleanup') &#x3c;/syntaxhighlight&#x3e; Produces:
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;div class="hatnote"&#x3e;For a more comprehensive list, see Wikipedia:Hatnote § Hatnote templates and Wikipedia:Template messages/Cleanup § Cleanup.&#x3c;/div&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e;

Displays as: &#x3c;div class="hatnote"&#x3e;For a more comprehensive list, see Wikipedia:Hatnote § Hatnote templates and Wikipedia:Template messages/Cleanup § Cleanup.&#x3c;/div&#x3e;

Technical details
This module uses Module:Hatnote to format the hatnote text and Module:Arguments to fetch the arguments from wikitext.

&#x3c;includeonly&#x3e;&#x3c;/includeonly&#x3e;