Teamplaid:Scribunto/documentation

O Wiktionary
Jump to navigation Jump to search

Ùsaid - Usage[deasaich]

This helps with the creation of doc pages for Lua metamodules that reference the Teamplaid:Scribunto/helper 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: Teamplaid:Scribunto/helper

{{Scribunto|HTML_library|mw.html}}

produces this link: Teamplaid:Scribunto/helper

Advanced[deasaich]

|self= and |args=[deasaich]

Teamplaid:Seealso2

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: Teamplaid:Scribunto/helper

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

{{Scribunto|self=Example\/testcases/doc|.test1|args=string}}

produces: Teamplaid:Scribunto/helper

no 'main'[deasaich]

If your module has no "main" method (e.g. Mòideal: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: Teamplaid:Scribunto/helper' If the second parameter contains ***, then the first param will be substituted (or the self-reference, as applicable):

{{Scribunto|self=Buffer|\|require('Mòideal:***')|args=...}}

Teamplaid:Scribunto/helper

args2 and args3[deasaich]

Use to specify up to 3 argument variations.

{{Scribunto|table.insert|args=table, value|args2=table, pos, value}}

Teamplaid:Scribunto/helper
Teamplaid:Scribunto/helper

|plain=[deasaich]

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

Faic cuideachd - Also see