Jump to content

Module:Main list/doc: Difference between revisions

From BattleIntelligence
imported>Deadfire
m Text replacement - "[[BattleTechWiki:Template messages" to "[[BattleTechWiki:Template index"
 
m Text replacement - "BattleTechWiki" to "BattleIntelligence"
 
Line 1: Line 1:
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[BattleTechWiki:Wikidata]]) -->
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[BattleIntelligence:Wikidata]]) -->
This module produces a "For a more comprehensive list, see [...]" link. It implements the {{tl|main list}} template.
This module produces a "For a more comprehensive list, see [...]" link. It implements the {{tl|main list}} template.


Line 26: Line 26:
=== Example 1 ===
=== Example 1 ===
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
mMainList._mainList ('BattleTechWiki:Hatnote#Hatnote templates')
mMainList._mainList ('BattleIntelligence:Hatnote#Hatnote templates')
</syntaxhighlight>
</syntaxhighlight>
Produces:
Produces:
:<code><nowiki><div class="hatnote">For a more comprehensive list, see [[BattleTechWiki:Hatnote#Hatnote templates|BattleTechWiki:Hatnote § Hatnote templates]].</div></nowiki></code>
:<code><nowiki><div class="hatnote">For a more comprehensive list, see [[BattleIntelligence:Hatnote#Hatnote templates|BattleIntelligence:Hatnote § Hatnote templates]].</div></nowiki></code>
Displays as:
Displays as:
<div class="hatnote">For a more comprehensive list, see [[BattleTechWiki:Hatnote#Hatnote templates|BattleTechWiki:Hatnote § Hatnote templates]].</div>
<div class="hatnote">For a more comprehensive list, see [[BattleIntelligence:Hatnote#Hatnote templates|BattleIntelligence:Hatnote § Hatnote templates]].</div>


=== Example 2 ===
=== Example 2 ===
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
mMainList._mainList ('BattleTechWiki:Hatnote#Hatnote templates','BattleTechWiki:Template messages/Cleanup#Cleanup')
mMainList._mainList ('BattleIntelligence:Hatnote#Hatnote templates','BattleIntelligence:Template messages/Cleanup#Cleanup')
</syntaxhighlight>
</syntaxhighlight>
Produces:
Produces:
:<code><nowiki><div class="hatnote">For a more comprehensive list, see [[BattleTechWiki:Hatnote#Hatnote templates|BattleTechWiki:Hatnote § Hatnote templates]] and [[BattleTechWiki:Template index/Cleanup#Cleanup|BattleTechWiki:Template messages/Cleanup § Cleanup]].</div></nowiki></code>
:<code><nowiki><div class="hatnote">For a more comprehensive list, see [[BattleIntelligence:Hatnote#Hatnote templates|BattleIntelligence:Hatnote § Hatnote templates]] and [[BattleIntelligence:Template index/Cleanup#Cleanup|BattleIntelligence:Template messages/Cleanup § Cleanup]].</div></nowiki></code>
Displays as:
Displays as:
<div class="hatnote">For a more comprehensive list, see [[BattleTechWiki:Hatnote#Hatnote templates|BattleTechWiki:Hatnote § Hatnote templates]] and [[BattleTechWiki:Template index/Cleanup#Cleanup|BattleTechWiki:Template messages/Cleanup § Cleanup]].</div>
<div class="hatnote">For a more comprehensive list, see [[BattleIntelligence:Hatnote#Hatnote templates|BattleIntelligence:Hatnote § Hatnote templates]] and [[BattleIntelligence:Template index/Cleanup#Cleanup|BattleIntelligence:Template messages/Cleanup § Cleanup]].</div>


== Technical details ==
== Technical details ==

Latest revision as of 23:31, 30 April 2025

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:

local mMainList = require('Module:Main list')

You can then use the _mainList function like this:

mMainList._mainList (page1, page2)

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

mMainList._mainList ('BattleIntelligence:Hatnote#Hatnote templates')

Produces:

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

Displays as:

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

Example 2

mMainList._mainList ('BattleIntelligence:Hatnote#Hatnote templates','BattleIntelligence:Template messages/Cleanup#Cleanup')

Produces:

<div class="hatnote">For a more comprehensive list, see [[BattleIntelligence:Hatnote#Hatnote templates|BattleIntelligence:Hatnote § Hatnote templates]] and [[BattleIntelligence:Template index/Cleanup#Cleanup|BattleIntelligence: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.