Module:Main list/doc

MyWikiBiz, Author Your Legacy — Friday December 27, 2024
< Module:Main list
Revision as of 04:45, 16 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This is the documentation page for Module:Main list

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:

<syntaxhighlight lang="lua"> local mMainList = require('Module:Main list') </syntaxhighlight>

You can then use the _mainList function like this:

<syntaxhighlight lang="lua"> mMainList._mainList (page1, page2) </syntaxhighlight>

The page1 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 page2 variable is optional; it is a second page link.

Example 1

<syntaxhighlight lang="lua"> mMainList._mainList ('Wikipedia:Hatnote#Hatnote templates') </syntaxhighlight> Produces:

<div class="hatnote">For a more comprehensive list, see [[Wikipedia:Hatnote#Hatnote templates|Wikipedia:Hatnote § Hatnote templates]].</div>

Displays as:

For a more comprehensive list, see Wikipedia:Hatnote § Hatnote templates.

Example 2

<syntaxhighlight lang="lua"> mMainList._mainList ('Wikipedia:Hatnote#Hatnote templates','Wikipedia:Template messages/Cleanup#Cleanup') </syntaxhighlight> Produces:

<div class="hatnote">For a more comprehensive list, see [[Wikipedia:Hatnote#Hatnote templates|Wikipedia:Hatnote § Hatnote templates]] and [[Wikipedia:Template messages/Cleanup#Cleanup|Wikipedia:Template messages/Cleanup § Cleanup]].</div>

Displays as:

Technical details

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