Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.Anti-spam check. Do not fill this in!== Usage == ===labelledList=== Invoking the <code>labelledList()</code> function is enough to implement most such templates: <code><nowiki>{{#invoke:Labelled list hatnote|labelledList|Universal label}}</nowiki></code> or <code><nowiki>{{#invoke:Labelled list hatnote|labelledList|Singular label|Plural label}}</nowiki></code> For example, providing "See also" instead of "Universal label" duplicates the functionality of {{tl|see also}}, while providing "Main article" and "Main articles" instead of "Singular label" and "Plural label" duplicates the (article namespace) functionality of {{tl|main}}. If third and fourth labels are provided, they'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: <code><nowiki>{{#invoke:Labelled list hatnote|labelledList|Main article|Main articles|Main page|Main pages}}</nowiki></code> ===preprocessDisplays=== The <code>preprocessDisplays()</code> function takes a raw list of arguments and combines in any display arguments. For example, {{tlx|see also|1|<nowiki>l1=One</nowiki>}} initially has the arguments table <code><nowiki>{'1', ['l1'] = 'One'}</nowiki></code>; this table would combine those into the table <code><nowiki>{'1|One'}</nowiki></code>. It overrides manual piping (e.g. {{tlx|see also|<nowiki>1{{!}}2</nowiki>|<nowiki>l1=One</nowiki>}} β <code><nowiki>{'1|One'}</nowiki></code>) and compresses sparse arrays if a parameter is skipped or left empty. Example: <syntaxhighlight lang="lua"> local mLabelledList = require('Module:Labelled list hatnote') local pages = mLabelledList.preprocessDisplays(args) </syntaxhighlight> ===_labelledList=== For modules that need to modify the functionality slightly while still using it, <code>_labelledList()</code> provides some flexibility. It takes three parameters: # A pages list, preferably preprocessed and compressed by <code>preprocessDisplays</code> # 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. # An options table, preferably containing: #* a <code>template</code> string with the full title of the template. Defaults to the title of this module. #* a <code>category</code> string (or nil) as taken by <code>makeWikitextError</code> from [[Module:Hatnote]], to optionally disable error categories #* a <code>selfref</code> string (or nil) as taken by <code>_hatnote</code> to enable the selfref option Example: <syntaxhighlight lang="lua"> local mLabelledList = require('Module:Labelled list hatnote') return mLabelledList._labelledList(pages, labels, options) </syntaxhighlight> Summary: Please note that all contributions to The Sonic the Hedgehog Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here. You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see The Sonic the Hedgehog Wiki:Copyrights for details). Do not submit copyrighted work without permission! Cancel Editing help (opens in new window)