ᱪᱷᱟᱸᱪ:Scribunto
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=
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]
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: [[Module:Buffer/doc#Buffer:_all|
Buffer:_allᱪᱷᱟᱸᱪ:Scribunto/helper2
]]
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: [[Module:Example/testcases/doc#Example/testcases.test1|
Example/testcases.test1ᱪᱷᱟᱸᱪ:Scribunto/helper2
]]
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: [[Module:Buffer/doc#Buffer|
Bufferᱪᱷᱟᱸᱪ:Scribunto/helper2
]]'
***
, then the first param will be substituted (or the self-reference, as applicable): {{scribunto|self=Buffer|\|require('Module:***')|args=...}}[[Module:Buffer#Buffer|
ᱪᱷᱟᱸᱪ:Scribunto/helper2ᱪᱷᱟᱸᱪ:Scribunto/helper2
]]
args2 and args3[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]
Use to specify up to 3 argument variations.{{scribunto|table.insert|args=table, value|args2=table, pos, value}}[[mw:Extension:Scribunto/Lua_reference_manual#table.insert|
table.insertᱪᱷᱟᱸᱪ:Scribunto/helper2
]]
[[mw:Extension:Scribunto/Lua_reference_manual#table.insert|
table.insertᱪᱷᱟᱸᱪ:Scribunto/helper2
]]
|plain=
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]
If set to anything, the result will no longer be wrapped in <code>...</code>
.
See also[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]
- {{Luaself}}, a wrapper template that makes Lua self-references easier.
- Module:Buffer/doc, an example of a doc that uses this
- {{Lua}}
- Category:Lua metamodules
The above documentation is transcluded from ᱪᱷᱟᱸᱪ:Scribunto/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |