dev

Testharness 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 cases18/18
Code coverage5/6

Unit test report for Docbunto.

Scribunto test cases

p.main

18/18
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/testdata}}
Expected
Error
documentation markup for Docbunto not found in Module:Codedoc/testdata
Actual
Error
documentation markup for Docbunto not found in Module:Codedoc/testdata
Passing
{{docbunto|Docbunto/testcases/Basic|code = 1|verbose = 1}}
Expected

Package function

ldoc(options) (function)
Item summary. The item description follows. Information provided by the item comment can be formatted with both MediaWiki and Markdown syntax. The comments can generally span multiple lines.
By leaving empty comment lines, a new paragraph can be made in the documentation. This can be used to give longer explanations whitespace.
Parameters:
options Configuration options. (table)
options.file Target file. (string)
options.filter Output filter. (string; optional)
options.dump Text output to console. (boolean; optional)
Returns: Compiled documentation. (string)
Actual

Package function

ldoc(options) (function)
Item summary. The item description follows. Information provided by the item comment can be formatted with both MediaWiki and Markdown syntax. The comments can generally span multiple lines.
By leaving empty comment lines, a new paragraph can be made in the documentation. This can be used to give longer explanations whitespace.
Parameters:
options Configuration options. (table)
options.file Target file. (string)
options.filter Output filter. (string; optional)
options.dump Text output to console. (boolean; optional)
Returns: Compiled documentation. (string)
Passing
{{docbunto|Docbunto|simple = 1}}
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.
docbunto.main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
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.
docbunto.main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Passing
{{docbunto|code = 1|simple = 1}}
Expected

Package items

docbunto._main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Actual

Package items

docbunto._main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Passing
{{docbunto|Docbunto|box = 0|card = 1|footer = 1}}
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. (Frame)
Returns: Module documentation output. (string)
docbunto.main(frame) (function)
Entrypoint for the module.
Parameter: frame Module frame. (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. (options; optional)
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
Parameters:
modname Module page name (without namespace). (string; optional)
options Configuration options. (options; optional)
Errors:
'Lua source code not found in $1' (line 1144)
'documentation markup for Docbunto not found in $1' (line 1154)
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. (options; 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.

Other items

options (table)
Configuration options.
Fields:
options.all Include local items in documentation. (boolean; optional)
options.autodoc Whether the module is being called to automatically provide missing 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.box Include infobox in output. (boolean; optional)
options.footer Append a horizontal line & "generated by Docbunto" to the bottom of the output. (boolean; optional)
options.noluaref Don't link to the Lua reference manual for types. (boolean; optional)
options.card Include endmatter card in the output at the end of the documentation. (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.subst Don't preprocess code output before the documentation is outputted e.g. subst. (boolean; optional)
options.ulist Indent subitems as <ul> lists (LDoc/JSDoc behaviour). (boolean; optional)
options.verbose Show the code description of a package function when documenting function modules. (boolean; optional)

Generated by Docbunto.

Module information card (autogenerated)
NameValue
Image
Docbunto
Variable

docbunto

CodeModule:Docbunto
Release statusstable
DescriptionDocbunto is an automatic documentation generator for Scribunto modules.
Author(s)
Using code by@stevedonovan (Github)
Dependencies
Language support
  • বাংলা (bn)
  • Deutsch (de)
  • English (en)
  • français (fr)
  • हिन्दी (hi)
  • 日本語 (ja)
  • 한국어 (ko)
  • polski (pl)
  • русский (ru)
  • Tagalog (tl)
  • Türkçe (tr)
  • Tiếng Việt (vi)
  • 中文 (zh)
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. (Frame)
Returns: Module documentation output. (string)
docbunto.main(frame) (function)
Entrypoint for the module.
Parameter: frame Module frame. (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. (options; optional)
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
Parameters:
modname Module page name (without namespace). (string; optional)
options Configuration options. (options; optional)
Errors:
'Lua source code not found in $1' (line 1144)
'documentation markup for Docbunto not found in $1' (line 1154)
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. (options; 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.

Other items

options (table)
Configuration options.
Fields:
options.all Include local items in documentation. (boolean; optional)
options.autodoc Whether the module is being called to automatically provide missing 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.box Include infobox in output. (boolean; optional)
options.footer Append a horizontal line & "generated by Docbunto" to the bottom of the output. (boolean; optional)
options.noluaref Don't link to the Lua reference manual for types. (boolean; optional)
options.card Include endmatter card in the output at the end of the documentation. (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.subst Don't preprocess code output before the documentation is outputted e.g. subst. (boolean; optional)
options.ulist Indent subitems as <ul> lists (LDoc/JSDoc behaviour). (boolean; optional)
options.verbose Show the code description of a package function when documenting function modules. (boolean; optional)

Generated by Docbunto.

Module information card (autogenerated)
NameValue
Image
Docbunto
Variable

docbunto

CodeModule:Docbunto
Release statusstable
DescriptionDocbunto is an automatic documentation generator for Scribunto modules.
Author(s)
Using code by@stevedonovan (Github)
Dependencies
Language support
  • বাংলা (bn)
  • Deutsch (de)
  • English (en)
  • français (fr)
  • हिन्दी (hi)
  • 日本語 (ja)
  • 한국어 (ko)
  • polski (pl)
  • русский (ru)
  • Tagalog (tl)
  • Türkçe (tr)
  • Tiếng Việt (vi)
  • 中文 (zh)
Passing
{{docbunto|Docbunto/testcases/Classmod|code = 1}}
Expected

Package items

Color.tup (table)
Color tuple.
Color.typ (member • string)
Color space type.
Color.alp (member • number)
Color alpha channel value.
Color:new(typ, tup, alp) (function • constructor)
Color instance constructor.
Parameters:
typ Color space type ('hsl' or 'rgb'). (string)
tup Color tuple in HSL or RGB (table)
alp Alpha value range (0 - 1). (number)
Errors:
'no color data provided' (line 304)
'invalid color type "$1" specified' (line 309)
Returns: Color instance. (Color)
Color:string() (function)
Color string default output.
Returns: Hexadecimal 6-digit or HSLA color string. (string)
Usage:
colors.parse('hsl(214, 15%, 30%)'):string() == '#404a57'
colors.parse('#404a5780'):string() == 'hsl(214, 15%, 30%, 0.5)'
Color:hex() (function)
Color hexadecimal string output.
Returns: Hexadecimal color string. (string)
Usage: colors.parse('hsl(214, 15%, 30%)'):hex() == '#404a57'
Color:rgb() (function)
RGBA functional color string output.
Returns: RGBA color string. (string)
Usage: colors.parse('hsl(214, 15%, 30%)'):rgb() == 'rgb(64, 74, 87)'
See also: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()
Color:hsl() (function)
HSL functional color string output.
Returns: HSLA color string. (string)
Usage: colors.parse('rgb(64, 74, 87)'):hsl() == 'hsl(214, 15%, 30%)'
See also: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()
Actual

Package items

Color.tup (table)
Color tuple.
Color.typ (member • string)
Color space type.
Color.alp (member • number)
Color alpha channel value.
Color:new(typ, tup, alp) (function • constructor)
Color instance constructor.
Parameters:
typ Color space type ('hsl' or 'rgb'). (string)
tup Color tuple in HSL or RGB (table)
alp Alpha value range (0 - 1). (number)
Errors:
'no color data provided' (line 304)
'invalid color type "$1" specified' (line 309)
Returns: Color instance. (Color)
Color:string() (function)
Color string default output.
Returns: Hexadecimal 6-digit or HSLA color string. (string)
Usage:
colors.parse('hsl(214, 15%, 30%)'):string() == '#404a57'
colors.parse('#404a5780'):string() == 'hsl(214, 15%, 30%, 0.5)'
Color:hex() (function)
Color hexadecimal string output.
Returns: Hexadecimal color string. (string)
Usage: colors.parse('hsl(214, 15%, 30%)'):hex() == '#404a57'
Color:rgb() (function)
RGBA functional color string output.
Returns: RGBA color string. (string)
Usage: colors.parse('hsl(214, 15%, 30%)'):rgb() == 'rgb(64, 74, 87)'
See also: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()
Color:hsl() (function)
HSL functional color string output.
Returns: HSLA color string. (string)
Usage: colors.parse('rgb(64, 74, 87)'):hsl() == 'hsl(214, 15%, 30%)'
See also: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()
Passing
{{docbunto|Docbunto/testcases/Factory|code = 1}}
Expected

Package items

i18nf.loadMessages (member)
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.
i18nf._getMsg (member)
Fetch a message from the cache of parsed i18n data.

Message

Message object, providing getter methods for messages.

Message:parse (member)
Parse wikitext links in the message and return the result.
Message:markdown (member)
Parse markdown links in the message and return the result.
Message:escape (member)
Escape the message wikitext and return the result.
Message:plain (member)
Return the message with no processing.

I18n

I18n object, providing message getter and language setters.

I18n:msg (member • factory • constructor)
Factory returning Message instance.
I18n:useLang (member)
I18n language setter to specificed language.
I18n:inLang (member)
Temporary datastore language setter to a specificed language. Only affects the next I18n:msg call.
I18n:useContentLang (member)
I18n language setter to wgContentLanguage.
I18n:inContentLang (member)
Temporary language setter to wgContentLanguage. Only affects the next I18n:msg call.
I18n:useUserLang (member)
I18n language setter to wgUserLanguage.
Note: Scribunto only registers wgUserLanguage when an invocation is at the top of the call stack.
I18n:inUserLang (member)
Temporary language setter to wgUserLanguage. The message language reverts to the default language in the next I18n:msg call.

See also

Actual

Package items

i18nf.loadMessages (member)
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.
i18nf._getMsg (member)
Fetch a message from the cache of parsed i18n data.

Message

Message object, providing getter methods for messages.

Message:parse (member)
Parse wikitext links in the message and return the result.
Message:markdown (member)
Parse markdown links in the message and return the result.
Message:escape (member)
Escape the message wikitext and return the result.
Message:plain (member)
Return the message with no processing.

I18n

I18n object, providing message getter and language setters.

I18n:msg (member • factory • constructor)
Factory returning Message instance.
I18n:useLang (member)
I18n language setter to specificed language.
I18n:inLang (member)
Temporary datastore language setter to a specificed language. Only affects the next I18n:msg call.
I18n:useContentLang (member)
I18n language setter to wgContentLanguage.
I18n:inContentLang (member)
Temporary language setter to wgContentLanguage. Only affects the next I18n:msg call.
I18n:useUserLang (member)
I18n language setter to wgUserLanguage.
Note: Scribunto only registers wgUserLanguage when an invocation is at the top of the call stack.
I18n:inUserLang (member)
Temporary language setter to wgUserLanguage. The message language reverts to the default language in the next I18n:msg call.

See also

Passing
{{docbunto|Docbunto/testcases/Export|boilerplate = 1|code = 1}}
Expected

Package items

docbunto.testcases.Export[1] (member)
The ultimate subjects.
docbunto.testcases.Export.answer (member)
Answer to everything.
Actual

Package items

docbunto.testcases.Export[1] (member)
The ultimate subjects.
docbunto.testcases.Export.answer (member)
Answer to everything.
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:
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 no-op 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 no-op 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 can now 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:
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 no-op 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 no-op 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 can now 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|Docbunto/testcases/Function|box = 1|card = 1}}
Expected

Delay the execution of a function by t seconds.

Documentation

Package function

delay(fn, t) (function)
Delay the execution of a function by t seconds.
Parameters:
fn The function to execute after the delay. (function)
t The delay in seconds before executing the function. (number)
Returns: Function that will execute delay~fn after t seconds - handle. (function)

Other items

handle() (function)
Function handle generated by delay.
Errors:
'Expected function for argument #1' (line 28)
'Expected number for argument #2' (line 31)
Returns: Nothing. (nil)

Notes

  • Based on a simple busy-wait loop, which is not efficient for long delays.
  • This module is likely to timeout if used in Scribunto.

See also

https://github.com/rxi/tick/blob/master/tick.lua


Module information card (autogenerated)
NameValue
Variabledelay(fn, t)
CodeModule:Docbunto/testcases/Function
Release statusstable
DescriptionDelay the execution of a function by t seconds.
Author(s)
Actual

Delay the execution of a function by t seconds.

Documentation

Package function

delay(fn, t) (function)
Delay the execution of a function by t seconds.
Parameters:
fn The function to execute after the delay. (function)
t The delay in seconds before executing the function. (number)
Returns: Function that will execute delay~fn after t seconds - handle. (function)

Other items

handle() (function)
Function handle generated by delay.
Errors:
'Expected function for argument #1' (line 28)
'Expected number for argument #2' (line 31)
Returns: Nothing. (nil)

Notes

  • Based on a simple busy-wait loop, which is not efficient for long delays.
  • This module is likely to timeout if used in Scribunto.

See also

https://github.com/rxi/tick/blob/master/tick.lua


Module information card (autogenerated)
NameValue
Variabledelay(fn, t)
CodeModule:Docbunto/testcases/Function
Release statusstable
DescriptionDelay the execution of a function by t seconds.
Author(s)
Passing
{{docbunto|Docbunto/testcases/Markdown}}
Expected

Documentation

Package items

Text formatting

This is bold text. This is also bold text. This is italic text. This is also italic text. This is bold italic text. Also this is rendered as bold & italic. This is strikethrough text. This is also strikethrough text. x2 renders as superscript text. It is rendered as x2.

Block formatting

Setext heading

  1. This appears as a 1st list item.
  2. This appears as a second list item.
  • Unordered list item number 1
  • Unordered list item number 2

Special formatting

Class is a type reference. Class is how it renders. [1] links to the official Lua reference manual. The Markdown syntax for this is: [lua.org https://www.lua.org/manual/5.1/index.html]. Class:method is wrapped in backticks to produce the code tag. Class:method is how it renders. renders like 102 using the math tag. is how it renders. The <chem>H_2O</chem> tag works too. It renders as H2O in the MediaWiki parser. The {{t}} module is usable for {{sandbox}}ing template usage.

Actual

Documentation

Package items

Text formatting

This is bold text. This is also bold text. This is italic text. This is also italic text. This is bold italic text. Also this is rendered as bold & italic. This is strikethrough text. This is also strikethrough text. x2 renders as superscript text. It is rendered as x2.

Block formatting

Setext heading

  1. This appears as a 1st list item.
  2. This appears as a second list item.
  • Unordered list item number 1
  • Unordered list item number 2

Special formatting

Class is a type reference. Class is how it renders. [2] links to the official Lua reference manual. The Markdown syntax for this is: [lua.org https://www.lua.org/manual/5.1/index.html]. Class:method is wrapped in backticks to produce the code tag. Class:method is how it renders. renders like 102 using the math tag. is how it renders. The <chem>H_2O</chem> tag works too. It renders as H2O in the MediaWiki parser. The {{t}} module is usable for {{sandbox}}ing template usage.

Passing
{{docbunto|Docbunto/testcases/Function|code= 1|all = 1}}
Expected

Package function

delay(fn, t) (function)
Delay the execution of a function by t seconds.
Parameters:
fn The function to execute after the delay. (function)
t The delay in seconds before executing the function. (number)
Returns: Function that will execute delay~fn after t seconds - handle. (function)

Other items

handle() (function)
Function handle generated by delay.
Errors:
'Expected function for argument #1' (line 28)
'Expected number for argument #2' (line 31)
Returns: Nothing. (nil)

Private items

wait(t) (function • local)
A simple function that waits t seconds.
Parameter: t The number of seconds to wait. (number)
Returns: Nothing. (nil)

Notes

  • Based on a simple busy-wait loop, which is not efficient for long delays.
  • This module is likely to timeout if used in Scribunto.

See also

https://github.com/rxi/tick/blob/master/tick.lua

Actual

Package function

delay(fn, t) (function)
Delay the execution of a function by t seconds.
Parameters:
fn The function to execute after the delay. (function)
t The delay in seconds before executing the function. (number)
Returns: Function that will execute delay~fn after t seconds - handle. (function)

Other items

handle() (function)
Function handle generated by delay.
Errors:
'Expected function for argument #1' (line 28)
'Expected number for argument #2' (line 31)
Returns: Nothing. (nil)

Private items

wait(t) (function • local)
A simple function that waits t seconds.
Parameter: t The number of seconds to wait. (number)
Returns: Nothing. (nil)

Notes

  • Based on a simple busy-wait loop, which is not efficient for long delays.
  • This module is likely to timeout if used in Scribunto.

See also

https://github.com/rxi/tick/blob/master/tick.lua

Passing
{{docbunto|Docbunto|box = 1|card = 0}}
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. (Frame)
Returns: Module documentation output. (string)
docbunto.main(frame) (function)
Entrypoint for the module.
Parameter: frame Module frame. (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. (options; optional)
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
Parameters:
modname Module page name (without namespace). (string; optional)
options Configuration options. (options; optional)
Errors:
'Lua source code not found in $1' (line 1144)
'documentation markup for Docbunto not found in $1' (line 1154)
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. (options; 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.

Other items

options (table)
Configuration options.
Fields:
options.all Include local items in documentation. (boolean; optional)
options.autodoc Whether the module is being called to automatically provide missing 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.box Include infobox in output. (boolean; optional)
options.footer Append a horizontal line & "generated by Docbunto" to the bottom of the output. (boolean; optional)
options.noluaref Don't link to the Lua reference manual for types. (boolean; optional)
options.card Include endmatter card in the output at the end of the documentation. (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.subst Don't preprocess code output before the documentation is outputted e.g. subst. (boolean; optional)
options.ulist Indent subitems as <ul> lists (LDoc/JSDoc behaviour). (boolean; optional)
options.verbose Show the code description of a package function when documenting function modules. (boolean; optional)
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. (Frame)
Returns: Module documentation output. (string)
docbunto.main(frame) (function)
Entrypoint for the module.
Parameter: frame Module frame. (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. (options; optional)
docbunto.taglet(modname, options) (function)
Docbunto taglet parser for Scribunto modules.
Parameters:
modname Module page name (without namespace). (string; optional)
options Configuration options. (options; optional)
Errors:
'Lua source code not found in $1' (line 1144)
'documentation markup for Docbunto not found in $1' (line 1154)
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. (options; 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.

Other items

options (table)
Configuration options.
Fields:
options.all Include local items in documentation. (boolean; optional)
options.autodoc Whether the module is being called to automatically provide missing 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.box Include infobox in output. (boolean; optional)
options.footer Append a horizontal line & "generated by Docbunto" to the bottom of the output. (boolean; optional)
options.noluaref Don't link to the Lua reference manual for types. (boolean; optional)
options.card Include endmatter card in the output at the end of the documentation. (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.subst Don't preprocess code output before the documentation is outputted e.g. subst. (boolean; optional)
options.ulist Indent subitems as <ul> lists (LDoc/JSDoc behaviour). (boolean; optional)
options.verbose Show the code description of a package function when documenting function modules. (boolean; optional)
Passing
{{docbunto|Docbunto|code = 1|simple = 1|noluaref = 1}}
Expected

Package items

docbunto._main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Actual

Package items

docbunto._main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Passing
{{docbunto|Docbunto|code = 1|simple = 1|plain = 1}}
Expected

Package items

docbunto._main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Actual

Package items

docbunto._main(f) (function)
Template entrypoint for Template:Docbunto.
docbunto.main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Passing
{{docbunto|Docbunto|code = 1|simple = 1|strip = 1}}
Expected

Package items

_main(f) (function)
Template entrypoint for Template:Docbunto.
main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Actual

Package items

_main(f) (function)
Template entrypoint for Template:Docbunto.
main(frame) (function)
Entrypoint for the module.
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.

Other items

options (table)
Configuration options.
Passing
{{docbunto|Docbunto/testcases/Function|box = 0|preface = 
== Usage ==
The Scribunto module can now be used with the following code:
 p(function() print(2) end, 2)}}
Expected

Delay the execution of a function by t seconds.

Usage

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

p(function() print(2) end, 2)

Documentation

Package function

delay(fn, t) (function)
Delay the execution of a function by t seconds.
Parameters:
fn The function to execute after the delay. (function)
t The delay in seconds before executing the function. (number)
Returns: Function that will execute delay~fn after t seconds - handle. (function)

Other items

handle() (function)
Function handle generated by delay.
Errors:
'Expected function for argument #1' (line 28)
'Expected number for argument #2' (line 31)
Returns: Nothing. (nil)

Notes

  • Based on a simple busy-wait loop, which is not efficient for long delays.
  • This module is likely to timeout if used in Scribunto.

See also

https://github.com/rxi/tick/blob/master/tick.lua

Actual

Delay the execution of a function by t seconds.

Usage

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

p(function() print(2) end, 2)

Documentation

Package function

delay(fn, t) (function)
Delay the execution of a function by t seconds.
Parameters:
fn The function to execute after the delay. (function)
t The delay in seconds before executing the function. (number)
Returns: Function that will execute delay~fn after t seconds - handle. (function)

Other items

handle() (function)
Function handle generated by delay.
Errors:
'Expected function for argument #1' (line 28)
'Expected number for argument #2' (line 31)
Returns: Nothing. (nil)

Notes

  • Based on a simple busy-wait loop, which is not efficient for long delays.
  • This module is likely to timeout if used in Scribunto.

See also

https://github.com/rxi/tick/blob/master/tick.lua