Mall:Scribunto: Skillnad mellan sidversioner

Från Järnvägsdata
m (1 version importerades)
mIngen redigeringssammanfattning
Rad 1: Rad 1:
{{escape|mode=kill|{{replace|{{Scribunto/helper|{{{1|}}}|{{{2|}}}|pre={{{pre|}}}|self={{{self|}}}|plain={{{plain|{{{3|}}}}}}|args={{{args|}}}}}{{#if:{{{args2|}}}|<br />{{Scribunto/helper|{{{1|}}}|{{{2|}}}|pre={{{pre|}}}|self={{{self|}}}|plain={{{plain|}}}|args={{{args2}}}}}}}{{#if:{{{args3|}}}|<br />{{Scribunto/helper|{{{1|}}}|{{{2|}}}|pre={{{pre|}}}|self={{{self|}}}|plain={{{plain|}}}|args={{{args3}}}}}}}|***|{{#if:{{{1|}}}|{{#invoke:string|replace|source={{{1}}}|pattern=^([:%.%\])|replace={{#invoke:string|match|s={{escape|mode=text|{{{self|/}}}}}|pattern=^[^/]+}}%1|plain=false}}}}}}}}<noinclude>
{{escape|mode=kill|{{replace|{{Scribunto/helper|{{{1|}}}|{{{2|}}}|pre={{{pre|}}}|self={{{self|}}}|plain={{{plain|{{{3|}}}}}}|args={{{args|}}}}}{{#if:{{{args2|}}}|<br />{{Scribunto/helper|{{{1|}}}|{{{2|}}}|pre={{{pre|}}}|self={{{self|}}}|plain={{{plain|}}}|args={{{args2}}}}}}}{{#if:{{{args3|}}}|<br />{{Scribunto/helper|{{{1|}}}|{{{2|}}}|pre={{{pre|}}}|self={{{self|}}}|plain={{{plain|}}}|args={{{args3}}}}}}}|***|{{#if:{{{1|}}}|{{#invoke:string|replace|source={{{1}}}|pattern=^([:%.%\])|replace={{#invoke:string|match|s={{escape|mode=text|{{{self|/}}}}}|pattern=^[^/]+}}%1|plain=false}}}}}}}}<noinclude>
{{documentation}}
{{documentation}}<templatedata>
{
"params": {
"1": {},
"2": {},
"3": {},
"pre": {},
"self": {},
"plain": {},
"args": {},
"args2": {},
"args3": {}
}
}
</templatedata>
</noinclude>
</noinclude>

Versionen från 12 januari 2021 kl. 18.16

Scribunto manual

[visa] [redigera] [rensa sidcachen]

Test Template Info-Icon.svg Dokumentation


Usage

This helps with the creation of doc pages for Lua metamodules that reference the Scribunto manual or specific function within it.

{{scribunto
|<!--anchor-->
|<!--link text-->
}}
If an anchor is provided, the link will be wrapped in <code>...</code>. For example:
{{scribunto|mw.html.create}}
produces this link:  mw.html.create
{{scribunto|HTML_library|mw.html}}
produces this link: mw.html

Advanced

|self= and |args=

See also: {{Luaself}}
You may also use |self={{PAGENAME}} to reference your own functions and |args= to specify args, like so:
{{scribunto|self=Buffer/doc|:_all|args=...}}
produces this link:  Buffer:_all( ... )

If the first char matches the pattern ^[:%.] then title specified by |self= will be inserted in front, minus any subpages, unless escaped with the \ char:

{{scribunto|self=Example\/testcases/doc|.test1|args=string}}
produces:  Example/testcases.test1( string )
no 'main'
If your module has no "main" method (e.g. Module:Buffer), you can pass the escape char \ as the first char in the function name to make a self-reference:
{{scribunto|self=Buffer/doc|\|args=...}}
produces:  Buffer( ... ) ' If the second parameter contains ***, then the first param will be substituted (or the self-reference, as applicable):
{{scribunto|self=Buffer|\|require('Module:***')|args=...}}
require('Module:Buffer')( ... )

|args2= and |args3=

Use to specify up to 3 argument variations.
{{scribunto|table.insert|args=table, value|args2=table, pos, value}}
table.insert( table, value )


table.insert( table, pos, value )

|plain=

If set to anything, the result will no longer be wrapped in <code>...</code>.

See also

Ingen beskrivning.

Mallparametrar

ParameterBeskrivningTypStatus
11

ingen beskrivning

Okändvalfri
22

ingen beskrivning

Okändvalfri
33

ingen beskrivning

Okändvalfri
prepre

ingen beskrivning

Okändvalfri
selfself

ingen beskrivning

Okändvalfri
plainplain

ingen beskrivning

Okändvalfri
argsargs

ingen beskrivning

Okändvalfri
args2args2

ingen beskrivning

Okändvalfri
args3args3

ingen beskrivning

Okändvalfri