Zum Inhalt springen

Modul:Labelled list hatnote/doc: Unterschied zwischen den Versionen

K
change source to syntaxhighlight
K (update /doc)
K (change source to syntaxhighlight)
Zeile 22: Zeile 22:
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.
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: <source lang="lua">
Example: <syntaxhighlight lang="lua">
local mLabelledList = require('Module:Labelled list hatnote')
local mLabelledList = require('Module:Labelled list hatnote')
local pages = mLabelledList.preprocessDisplays(args)
local pages = mLabelledList.preprocessDisplays(args)
</source>
</syntaxhighlight>


===_labelledList===
===_labelledList===
Zeile 36: Zeile 36:
#* a <code>selfref</code> string (or nil) as taken by <code>_hatnote</code> to enable the selfref option
#* a <code>selfref</code> string (or nil) as taken by <code>_hatnote</code> to enable the selfref option


Example: <source lang="lua">
Example: <syntaxhighlight lang="lua">
local mLabelledList = require('Module:Labelled list hatnote')
local mLabelledList = require('Module:Labelled list hatnote')
return mLabelledList._labelledList(pages, labels, options)
return mLabelledList._labelledList(pages, labels, options)
</source>
</syntaxhighlight>


==Errors==
==Errors==
Anonymer Benutzer