Template:Scribunto/doc

There are no reviewed versions of this page, so it may not have been checked for adherence to standards.

Usage edit

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

{{scribunto|HTML_library|mw.html}}

produces this link: Template:Scribunto/helper

Advanced edit

|self= and |args= edit

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

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

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

produces: Template:Scribunto/helper

no 'main' edit

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: Template:Scribunto/helper' If the second parameter contains ***, then the first param will be substituted (or the self-reference, as applicable):

{{scribunto|self=Buffer|\|require('Module:***')|args=...}}

Template:Scribunto/helper

|args2= and |args3= edit

Use to specify up to 3 argument variations.

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

Template:Scribunto/helper
Template:Scribunto/helper

|plain= edit

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

See also edit


This content is in the Template Namespace. Used for page-templates that can be re-used across the wiki.