Modul:Labelled list hatnote/doc: Unterschied zwischen den Versionen
Modul:Labelled list hatnote/doc (Quelltext anzeigen)
Version vom 7. Juli 2020, 14:25 Uhr
, vor 5 Jahrenchange 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: < | 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) | ||
</ | </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: < | 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) | ||
</ | </syntaxhighlight> | ||
==Errors== | ==Errors== | ||