Module:Hatnote list/doc

&#x3c;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikidata) --&#x3e;

Usage from wikitext
This module is not designed be used directly from wikitext even though &#x3c;code&#x3e;forSee&#x3c;/code&#x3e; does take an initial &#x3c;code&#x3e;frame&#x3c;/code&#x3e; argument and could potentially be used from wikitext, e.g.:
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; →

Usage from Lua
To call the module, use &#x3c;syntaxhighlight lang="lua"&#x3e;local mHatList = require('Module:Hatnote list')&#x3c;/syntaxhighlight&#x3e; or similar, then access its methods through the &#x3c;code&#x3e;mHatList&#x3c;/code&#x3e; variable (or whatever was used).

andList
&#x3c;code&#x3e;andList&#x3c;/code&#x3e; takes a list in table form, and returns a string with the list separated with "and" and commas as appropriate.

orList
&#x3c;code&#x3e;orList&#x3c;/code&#x3e; takes a list in table form, and returns a string with the list separated with "or" and commas as appropriate.

forSee
&#x3c;code&#x3e;_forSee&#x3c;/code&#x3e; takes three arguments: a table of trimmed arguments with blanks removed, a "from" number with the index to start at, and an options table, and returns a string with a number of "&#x3c;code&#x3e;&#x3c;nowiki&#x3e;For X, see Y&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e;" sentences. The links are formatted using the methods from Module:Hatnote.

As a convenience, the &#x3c;code&#x3e;forSee&#x3c;/code&#x3e; method (without the leading underscore) takes the same arguments except with a frame instead of an args table, using &#x3c;code&#x3e;getArgs&#x3c;/code&#x3e; from Module:Arguments to preprocess the arguments.

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