Fandom Developers Wiki

Template:Talk header/testunit report for Docbunto.

This is the unit test report for Docbunto, which produces integrity checks and output for debugging Docbunto.

Refresh
Test suite statusPassed
Scribunto test cases15/15
Code coverage5/5

Unit test report for Docbunto.

  • Test members missing: none
  • Test cases failing: none
  • Execution time: 1172.6ms

Scribunto test cases

p.main

15/15
StatusCode
Passing
{{docbunto|DEV/NULL}}
Expected
Error
Lua source code not found in Module:DEV/NULL
Actual
Error
Lua source code not found in Module:DEV/NULL
Passing
{{docbunto|Codedoc}}
Expected
Error
documentation markup for Docbunto not found in Module:Codedoc
Actual
Error
documentation markup for Docbunto not found in Module:Codedoc
Passing
{{docbunto|Entrypoint}}
Expected

Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.

Documentation

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages.
Parameter: package Scribunto package. (table)
Errors:
'you must specify a function to call' (string; line 85)
'the function you specified did not exist' (string; line 91)
'$2 is not a function' (string; line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Notes

  • Parent frames are not available in Entrypoint's frame. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations.
  • As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as 1= or 2=. This may result in unexpected behaviour such as Entrypoint and module errors.
Actual

Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.

Documentation

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages.
Parameter: package Scribunto package. (table)
Errors:
'you must specify a function to call' (string; line 85)
'the function you specified did not exist' (string; line 91)
'$2 is not a function' (string; line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Notes

  • Parent frames are not available in Entrypoint's frame. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations.
  • As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as 1= or 2=. This may result in unexpected behaviour such as Entrypoint and module errors.
Passing
{{docbunto|Docbunto}}
Expected

Docbunto is an automatic documentation generator for Scribunto modules. The module is based on LuaDoc and LDoc. It produces documentation in the form of MediaWiki markup, using @tag-prefixed comments embedded in the source code of a Scribunto module. The taglet parser & doclet renderer Docbunto uses are also publicly exposed to other modules.

Docbunto code items are introduced by a block comment (--[[]]--), an inline comment with three hyphens (---), or an inline @tag comment. The module can use static code analysis to infer variable names, item privacy (local keyword), tables ({} constructor) and functions (function keyword). MediaWiki and Markdown formatting is supported.

Items are usually rendered in the order they are defined, if they are public items, or emulated classes extending the Lua primitives. There are many customisation options available to change Docbunto behaviour.

Documentation

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
Parameter: f Scribunto frame object. (table)
Returns: Module documentation output. (string)
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
Parameters:
modname Module page name (without namespace). Default: second-level subpage. (string; optional)
options Configuration options. (table; optional)
options.all Include local items in documentation. (boolean; optional)
options.boilerplate Removal of boilerplate (license block comments). (boolean; optional)
options.caption Infobox image caption. (string; optional)
options.code Only document Docbunto code items - exclude article infobox and lede from rendered documentation. Permits article to be edited in VisualEditor. (boolean; optional)
options.colon Format tags with a : suffix and without the @ prefix. This bypasses the "doctag soup" some authors complain of. (boolean; optional)
options.image Infobox image. (string; optional)
options.noluaref Don't link to the Lua reference manual for types. (boolean; optional)
options.plain Disable Markdown formatting in documentation. (boolean; optional)
options.preface Preface text to insert between lede & item documentation, used to provide usage and code examples. (string; optional)
options.simple Limit documentation to descriptions only. Removes documentation of subitem tags such as @param and @field (see list). (boolean; optional)
options.sort Sort documentation items in alphabetical order. (boolean; optional)
options.strip Remove table index in documentation. (boolean; optional)
options.ulist Indent subitems as <ul> lists (LDoc/JSDoc behaviour). (boolean; optional)
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
Parameters:
modname Module page name (without namespace). (string; optional)
options Configuration options. (table; optional)
Errors:
'Lua source code not found in $1' (string; line 938)
'documentation markup for Docbunto not found in $1' (string; line 944)
Returns: Module documentation data. (table)
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
Parameters:
data Taglet documentation data. (table)
options Configuration options. (table; optional)
Returns: Wikitext documentation output. (string)
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Actual

Docbunto is an automatic documentation generator for Scribunto modules. The module is based on LuaDoc and LDoc. It produces documentation in the form of MediaWiki markup, using @tag-prefixed comments embedded in the source code of a Scribunto module. The taglet parser & doclet renderer Docbunto uses are also publicly exposed to other modules.

Docbunto code items are introduced by a block comment (--[[]]--), an inline comment with three hyphens (---), or an inline @tag comment. The module can use static code analysis to infer variable names, item privacy (local keyword), tables ({} constructor) and functions (function keyword). MediaWiki and Markdown formatting is supported.

Items are usually rendered in the order they are defined, if they are public items, or emulated classes extending the Lua primitives. There are many customisation options available to change Docbunto behaviour.

Documentation

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
Parameter: f Scribunto frame object. (table)
Returns: Module documentation output. (string)
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
Parameters:
modname Module page name (without namespace). Default: second-level subpage. (string; optional)
options Configuration options. (table; optional)
options.all Include local items in documentation. (boolean; optional)
options.boilerplate Removal of boilerplate (license block comments). (boolean; optional)
options.caption Infobox image caption. (string; optional)
options.code Only document Docbunto code items - exclude article infobox and lede from rendered documentation. Permits article to be edited in VisualEditor. (boolean; optional)
options.colon Format tags with a : suffix and without the @ prefix. This bypasses the "doctag soup" some authors complain of. (boolean; optional)
options.image Infobox image. (string; optional)
options.noluaref Don't link to the Lua reference manual for types. (boolean; optional)
options.plain Disable Markdown formatting in documentation. (boolean; optional)
options.preface Preface text to insert between lede & item documentation, used to provide usage and code examples. (string; optional)
options.simple Limit documentation to descriptions only. Removes documentation of subitem tags such as @param and @field (see list). (boolean; optional)
options.sort Sort documentation items in alphabetical order. (boolean; optional)
options.strip Remove table index in documentation. (boolean; optional)
options.ulist Indent subitems as <ul> lists (LDoc/JSDoc behaviour). (boolean; optional)
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
Parameters:
modname Module page name (without namespace). (string; optional)
options Configuration options. (table; optional)
Errors:
'Lua source code not found in $1' (string; line 938)
'documentation markup for Docbunto not found in $1' (string; line 944)
Returns: Module documentation data. (table)
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
Parameters:
data Taglet documentation data. (table)
options Configuration options. (table; optional)
Returns: Wikitext documentation output. (string)
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Passing
{{docbunto|Docbunto/testcases/Factory|code = 1|ulist = 1}}
Expected

Package items

i18nf.loadMessages(name, options) (function)
Loads messages from JSON files in MediaWiki namespace. The messages are wrapped in a custom interface:
  • This function parses and caches messages in the module as a Lua data table.
  • These can be accessed using the msg method of the returned object.
Parameters:
  • name Name of i18n.json root page. (string)
  • options Configuration options. (table)
    • options.inline Whether the JSON file uses inline comments instead of multiline comments. (boolean; optional)
Returns: Instance of I18n object. (I18n)
i18nf._getMsg(name, key, i18n) (function)
Fetch a message from the cache of parsed i18n data.
Parameters:

Message

Message object, providing getter methods for messages.

Message:parse() (function)
Parse wikitext links in the message and return the result.
Returns: Message string with MediaWiki and Markdown rendered. (string)
Message:markdown() (function)
Parse markdown links in the message and return the result.
Returns: Message string with Markdown rendered. (string)
Message:escape() (function)
Escape the message wikitext and return the result.
Returns: Escaped message string. (string)
Message:plain() (function)
Return the message with no processing.
Returns: Plain message string. (string)

I18n

I18n object, providing message getter and language setters.

I18n:msg(...) (function • factory • constructor)
Factory returning Message instance.
Parameter: ... Message key, followed by optional arguments to substitute into. (string)
Returns: Instance of Message. (Message)
I18n:useLang(code) (function)
I18n language setter to specificed language.
Parameter: code Language code to use. (string)
Returns: Object instance of I18n (chainable). (I18n)
I18n:inLang(code) (function)
Temporary datastore language setter to a specificed language. Only affects the next I18n:msg call.
Parameter: code Language code to use. (string)
Returns: Object instance of I18n (chainable). (I18n)
I18n:useContentLang() (function)
I18n language setter to wgContentLanguage.
Returns: Object instance of I18n (chainable). (I18n)
I18n:inContentLang() (function)
Temporary language setter to wgContentLanguage. Only affects the next I18n:msg call.
Returns: Object instance of I18n (chainable). (I18n)
I18n:useUserLang() (function)
I18n language setter to wgUserLanguage.
Returns: Object instance of I18n (chainable). (I18n)
Note: Scribunto only registers wgUserLanguage when an invocation is at the top of the call stack.
I18n:inUserLang() (function)
Temporary language setter to wgUserLanguage. The message language reverts to the default language in the next I18n:msg call.
Returns: Object instance of I18n (chainable). (I18n)

See also

Actual

Package items

i18nf.loadMessages(name, options) (function)
Loads messages from JSON files in MediaWiki namespace. The messages are wrapped in a custom interface:
  • This function parses and caches messages in the module as a Lua data table.
  • These can be accessed using the msg method of the returned object.
Parameters:
  • name Name of i18n.json root page. (string)
  • options Configuration options. (table)
    • options.inline Whether the JSON file uses inline comments instead of multiline comments. (boolean; optional)
Returns: Instance of I18n object. (I18n)
i18nf._getMsg(name, key, i18n) (function)
Fetch a message from the cache of parsed i18n data.
Parameters:

Message

Message object, providing getter methods for messages.

Message:parse() (function)
Parse wikitext links in the message and return the result.
Returns: Message string with MediaWiki and Markdown rendered. (string)
Message:markdown() (function)
Parse markdown links in the message and return the result.
Returns: Message string with Markdown rendered. (string)
Message:escape() (function)
Escape the message wikitext and return the result.
Returns: Escaped message string. (string)
Message:plain() (function)
Return the message with no processing.
Returns: Plain message string. (string)

I18n

I18n object, providing message getter and language setters.

I18n:msg(...) (function • factory • constructor)
Factory returning Message instance.
Parameter: ... Message key, followed by optional arguments to substitute into. (string)
Returns: Instance of Message. (Message)
I18n:useLang(code) (function)
I18n language setter to specificed language.
Parameter: code Language code to use. (string)
Returns: Object instance of I18n (chainable). (I18n)
I18n:inLang(code) (function)
Temporary datastore language setter to a specificed language. Only affects the next I18n:msg call.
Parameter: code Language code to use. (string)
Returns: Object instance of I18n (chainable). (I18n)
I18n:useContentLang() (function)
I18n language setter to wgContentLanguage.
Returns: Object instance of I18n (chainable). (I18n)
I18n:inContentLang() (function)
Temporary language setter to wgContentLanguage. Only affects the next I18n:msg call.
Returns: Object instance of I18n (chainable). (I18n)
I18n:useUserLang() (function)
I18n language setter to wgUserLanguage.
Returns: Object instance of I18n (chainable). (I18n)
Note: Scribunto only registers wgUserLanguage when an invocation is at the top of the call stack.
I18n:inUserLang() (function)
Temporary language setter to wgUserLanguage. The message language reverts to the default language in the next I18n:msg call.
Returns: Object instance of I18n (chainable). (I18n)

See also

Passing
{{docbunto|Entrypoint|code = 1}}
Expected

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.
Parameter: package Scribunto package. (table)
Errors:
'you must specify a function to call' (string; line 85)
'the function you specified did not exist' (string; line 91)
'$2 is not a function' (string; line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Notes

  • Parent frames are not available in Entrypoint's frame. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations.
  • As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as 1= or 2=. This may result in unexpected behaviour such as Entrypoint and module errors.
Actual

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.
Parameter: package Scribunto package. (table)
Errors:
'you must specify a function to call' (string; line 85)
'the function you specified did not exist' (string; line 91)
'$2 is not a function' (string; line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Notes

  • Parent frames are not available in Entrypoint's frame. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations.
  • As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as 1= or 2=. This may result in unexpected behaviour such as Entrypoint and module errors.
Passing
{{docbunto|Entrypoint|code = 1|all = 1}}
Expected

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.
Parameter: package Scribunto package. (table)
Errors:
'you must specify a function to call' (string; line 85)
'the function you specified did not exist' (string; line 91)
'$2 is not a function' (string; line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Private items

inext(t, i) (function • local)
Stateless, sequential Lua iterator.
Parameters:
t Invariant state to loop over. (table)
i Control variable (current index). (number)
Returns:
Next index. (number; optional)
Next value. (number|string|table|boolean; optional)
See also: github:lua/lua/blob/v5.1.1/lbaselib.c#L247
func_check (variable; boolean • local)
Check for MediaWiki version 1. 25. The concurrent Scribunto release adds a type check for package functions.
See also: mw:MediaWiki 1.24/wmf7#Scribunto
msg(key, fn_name) (function • local)
MediaWiki error message getter. Mimics Scribunto error formatting for script errors.
Parameters:
key MediaWiki i18n message key. (string)
fn_name Name of package function. (string; optional)
Returns: Formatted lowercase message. (string)

Notes

  • Parent frames are not available in Entrypoint's frame. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations.
  • As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as 1= or 2=. This may result in unexpected behaviour such as Entrypoint and module errors.
Actual

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.
Parameter: package Scribunto package. (table)
Errors:
'you must specify a function to call' (string; line 85)
'the function you specified did not exist' (string; line 91)
'$2 is not a function' (string; line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Private items

inext(t, i) (function • local)
Stateless, sequential Lua iterator.
Parameters:
t Invariant state to loop over. (table)
i Control variable (current index). (number)
Returns:
Next index. (number; optional)
Next value. (number|string|table|boolean; optional)
See also: github:lua/lua/blob/v5.1.1/lbaselib.c#L247
func_check (variable; boolean • local)
Check for MediaWiki version 1. 25. The concurrent Scribunto release adds a type check for package functions.
See also: mw:MediaWiki 1.24/wmf7#Scribunto
msg(key, fn_name) (function • local)
MediaWiki error message getter. Mimics Scribunto error formatting for script errors.
Parameters:
key MediaWiki i18n message key. (string)
fn_name Name of package function. (string; optional)
Returns: Formatted lowercase message. (string)

Notes

  • Parent frames are not available in Entrypoint's frame. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations.
  • As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as 1= or 2=. This may result in unexpected behaviour such as Entrypoint and module errors.
Passing
{{docbunto|Unindent|boilerplate = 1}}
Expected

Unindent resets the indentation level of mulitline strings. It is useful for multiline strings inside functions and large tables. This module serves as a utility function for string parsing, Testharness test suites, I18n datastores.

Lua supports multiline strings in the format [[\n...\n]]. In general, Lua does not outdent indented multiline strings out of the box. Though Lua supports variable indentation in multiline strings, custom logic is necessary to reset the string's indentation. This module adopts a flexible approach based on string scanning.

Unlike Penlight's pl.text.dedent behaviour where every line has the indentation of the first line removed, the line prefixed with the least non-tab whitespace is reset to zero indentation. Thus, the opening line of the string may retain some indentation if there are lines of less indentation terminating the string.

Documentation

Package function

unindent(str) (function)
Unindent resets the indentation level of mulitline strings.
Parameter: str Multiline string indented consistently. (string)
Returns: Unindented string. (string)
Actual

Unindent resets the indentation level of mulitline strings. It is useful for multiline strings inside functions and large tables. This module serves as a utility function for string parsing, Testharness test suites, I18n datastores.

Lua supports multiline strings in the format [[\n...\n]]. In general, Lua does not outdent indented multiline strings out of the box. Though Lua supports variable indentation in multiline strings, custom logic is necessary to reset the string's indentation. This module adopts a flexible approach based on string scanning.

Unlike Penlight's pl.text.dedent behaviour where every line has the indentation of the first line removed, the line prefixed with the least non-tab whitespace is reset to zero indentation. Thus, the opening line of the string may retain some indentation if there are lines of less indentation terminating the string.

Documentation

Package function

unindent(str) (function)
Unindent resets the indentation level of mulitline strings.
Parameter: str Multiline string indented consistently. (string)
Returns: Unindented string. (string)
Passing
{{docbunto|Docbunto/testcases/LDoc|code = 1|colon = 1|ulist = 1}}
Expected

Package items

multiple.mul1() (function)
Function with return groups.
Returns: Result. (string)
multiple.mul2() (function)
Function with return and error tag.
Error: 'message'
Returns: Result.
multiple.mul3() (function)
Function with multiple error tags.
Errors:
  • 'not found'
    • When multiple.lua is missing in the same directory.
  • 'bad format'
    • When multiple.lua contains invalid UTF-8 sequences.
Returns: Result.
multiple.mul4() (function)
Function with inline return and errors.
Errors:
  • 'not a string' (line 31)
  • 'zero-length string' (line 34)
Returns: Name converted to uppercase. (string)
multiple.mul5() (function)
Function that raises an error.
Error: 'file not found'
Returns: Contents of file in UTF-8 charset. (string)
multiple.mul6() (function)
First useless function. Optional type specifiers are allowed in this format. Note how these types are rendered!
Returns: (table|string|nil)
multiple.mul7(name) (function)
A function with typed args. Note the the standard tparam aliases, and how the 'opt' and 'optchain' modifiers may also be used. If the Lua function has varargs, then you may document an indefinite number of extra arguments!
Parameter: name Person's name. (string|Person|nil)
Returns: Birthday month in calendar (usually Gregorian). (string)
multiple.mul8(one, two, three, ...) (function)
Testing [opt].
Parameters:
  • one First parameter.
  • two Second parameter. (optional)
  • three Third parameter.
  • ... Other parameters after/including fourth parameter. (optional)
multiple.mul9() (function)
Third useless function. Can always put comments inline, may be multiple.
multiple.mul10(three) (function)
Function with single optional argument.
Parameter: three Third parameter. Limitations:
  • This parameter must be greater than two.
  • This parameter must be less than four.
  • Valve cannot count to this number.
(optional)

Other items

person2 (table)
Implicit table can always use : notation.
Fields:
  • gender Has an official ID number. (boolean)
  • sex One of 'M' (male), 'F' (female) or 'N' (N/A). (boolean)
  • spouse Has a wife or husband. (boolean)
person3 (table)
Explicit table in : format.
Fields:
  • surname Person's surname. (string)
  • birthdate Person's birthdate. (string)
  • options List of options for person - person2. (table)
person4 (table)
An implicit table.
Fields:
person4 (table)
An explicit table. Can use tparam aliases in table definitions.
Fields:
Actual

Package items

multiple.mul1() (function)
Function with return groups.
Returns: Result. (string)
multiple.mul2() (function)
Function with return and error tag.
Error: 'message'
Returns: Result.
multiple.mul3() (function)
Function with multiple error tags.
Errors:
  • 'not found'
    • When multiple.lua is missing in the same directory.
  • 'bad format'
    • When multiple.lua contains invalid UTF-8 sequences.
Returns: Result.
multiple.mul4() (function)
Function with inline return and errors.
Errors:
  • 'not a string' (line 31)
  • 'zero-length string' (line 34)
Returns: Name converted to uppercase. (string)
multiple.mul5() (function)
Function that raises an error.
Error: 'file not found'
Returns: Contents of file in UTF-8 charset. (string)
multiple.mul6() (function)
First useless function. Optional type specifiers are allowed in this format. Note how these types are rendered!
Returns: (table|string|nil)
multiple.mul7(name) (function)
A function with typed args. Note the the standard tparam aliases, and how the 'opt' and 'optchain' modifiers may also be used. If the Lua function has varargs, then you may document an indefinite number of extra arguments!
Parameter: name Person's name. (string|Person|nil)
Returns: Birthday month in calendar (usually Gregorian). (string)
multiple.mul8(one, two, three, ...) (function)
Testing [opt].
Parameters:
  • one First parameter.
  • two Second parameter. (optional)
  • three Third parameter.
  • ... Other parameters after/including fourth parameter. (optional)
multiple.mul9() (function)
Third useless function. Can always put comments inline, may be multiple.
multiple.mul10(three) (function)
Function with single optional argument.
Parameter: three Third parameter. Limitations:
  • This parameter must be greater than two.
  • This parameter must be less than four.
  • Valve cannot count to this number.
(optional)

Other items

person2 (table)
Implicit table can always use : notation.
Fields:
  • gender Has an official ID number. (boolean)
  • sex One of 'M' (male), 'F' (female) or 'N' (N/A). (boolean)
  • spouse Has a wife or husband. (boolean)
person3 (table)
Explicit table in : format.
Fields:
  • surname Person's surname. (string)
  • birthdate Person's birthdate. (string)
  • options List of options for person - person2. (table)
person4 (table)
An implicit table.
Fields:
person4 (table)
An explicit table. Can use tparam aliases in table definitions.
Fields:
Passing
{{docbunto|Entrypoint|code = 1|preface = 
== Usage ==
The Scribunto module can now be used with the following syntax:
 {{t|string|function|one|two|...}}}}
Expected

Usage

The Scribunto module can now be used with the following syntax:

{{string|<function>|<one>|<two>|<...>}}

Documentation

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.
Parameter: package Scribunto package. (table)
Errors:
'you must specify a function to call' (string; line 85)
'the function you specified did not exist' (string; line 91)
'$2 is not a function' (string; line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Notes

  • Parent frames are not available in Entrypoint's frame. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations.
  • As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as 1= or 2=. This may result in unexpected behaviour such as Entrypoint and module errors.
Actual

Usage

The Scribunto module can now be used with the following syntax:

{{string|<function>|<one>|<two>|<...>}}

Documentation

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.
Parameter: package Scribunto package. (table)
Errors:
'you must specify a function to call' (string; line 85)
'the function you specified did not exist' (string; line 91)
'$2 is not a function' (string; line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Notes

  • Parent frames are not available in Entrypoint's frame. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations.
  • As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as 1= or 2=. This may result in unexpected behaviour such as Entrypoint and module errors.
Passing
{{docbunto|Docbunto|code = 1|simple = 1}}
Expected

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Actual

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Passing
{{docbunto|code = 1|simple = 1}}
Expected

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Actual

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Passing
{{docbunto|Docbunto|code = 1|simple = 1|noluaref = 1}}
Expected

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Actual

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Passing
{{docbunto|Docbunto|code = 1|simple = 1|plain = 1}}
Expected

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the `'M'` token.
  • Multi-line preformatted tags use the `'ML'` token.
  • Identifier tags use the `'ID'` token.
  • Single-line tags use the `'S'` token.
  • Flags use the `'N'` token.
  • Type tags use the `'T'` token.
Actual

Package items

docbunto.main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.build(modname, options) (function)
Scribunto documentation generator entrypoint.
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
docbunto.doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
docbunto.tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the `'M'` token.
  • Multi-line preformatted tags use the `'ML'` token.
  • Identifier tags use the `'ID'` token.
  • Single-line tags use the `'S'` token.
  • Flags use the `'N'` token.
  • Type tags use the `'T'` token.
Passing
{{docbunto|Docbunto|code = 1|simple = 1|strip = 1}}
Expected

Package items

main(f) (function)
Template entrypoint for Template:Docbunto.
build(modname, options) (function)
Scribunto documentation generator entrypoint.
taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.
Actual

Package items

main(f) (function)
Template entrypoint for Template:Docbunto.
build(modname, options) (function)
Scribunto documentation generator entrypoint.
taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
doclet(data, options) (function)
Doclet renderer for Docbunto taglet data.
tags (table)
Token dictionary for Docbunto tags. Maps Docbunto tag names to tag tokens.
  • Multi-line tags use the 'M' token.
  • Multi-line preformatted tags use the 'ML' token.
  • Identifier tags use the 'ID' token.
  • Single-line tags use the 'S' token.
  • Flags use the 'N' token.
  • Type tags use the 'T' token.