Template:Lua autodoc
| This template uses Lua: |
Usage
[kolera mu edit source]{{Lua autodoc|file=Module name}}
Examples
[kolera mu edit source]{{Lua autodoc|file=Docbunto|code=yes}} yields:
Template:Ctop
Package items
[kolera mu edit source]docbunto._main( args )(function)- Entrypoint for the module in a format easier for other modules to call.
- Parameter:
argsModule arguments. (table) - Returns: Module documentation output. (string)
docbunto.main( frame )(function)- Entrypoint for the module.
- Parameter:
frameModule frame. (table) - Returns: Module documentation output. (string)
docbunto.build( modname, options )(function)- Scribunto documentation generator entrypoint.
- Parameters:
modnameModule page name (without namespace). Default: second-level subpage. (string; optional)optionsConfiguration options. (table; optional)options.allInclude local items in documentation. (boolean; optional)options.autodocWhether this is being called automatically to fill in missing documentation. (boolean; optional)options.boilerplateRemoval of boilerplate (license block comments). (boolean; optional)options.captionInfobox image caption. (string; optional)options.codeOnly document Docbunto code items - exclude article infobox and lede from rendered documentation. Permits article to be edited in VisualEditor. (boolean; optional)options.colonFormat tags with a:suffix and without the@prefix. This bypasses the "doctag soup" some authors complain of. (boolean; optional)options.imageInfobox image. (string; optional)options.noluarefDon't link to the Lua reference manual for types. (boolean; optional)options.plainDisable Markdown formatting in documentation. (boolean; optional)options.prefacePreface text to insert between lede & item documentation, used to provide usage and code examples. (string; optional)options.simpleLimit documentation to descriptions only. Removes documentation of subitem tags such as@paramand@field(see list). (boolean; optional)options.sortSort documentation items in alphabetical order. (boolean; optional)options.stripRemove table index in documentation. (boolean; optional)options.ulistIndent subitems as<ul>lists (LDoc/JSDoc behaviour). (boolean; optional)
docbunto.taglet( mod_name, options )(function)- Docbunto taglet parser for Scribunto modules.
- Parameters:
- Errors:
- Returns: Module documentation data. (table)
docbunto.doclet( data, options )(function)- Doclet renderer for Docbunto taglet data.
- Parameters:
- 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.
- Multi-line tags use the
{{Lua autodoc|file=Example|code=yes}} yields:
Template:Ctop
Package items
[kolera mu edit source]example.hello( frame )(function)- Hello world function
- Parameter:
framecurrent frame (table) - Returns: Hello world
example.hello_to( frame )(function)- Hello world function
- Parameters:
- Returns: Hello world
example.count_fruit( frame )(function)- Counts fruit
- Parameters:
- Returns: Number of apples and bananas
example.Name2( frame )(function)- Name2
- Parameter:
framecurrent frame (table) - Returns: Some output
{{Lua autodoc|file=Sandbox|code=yes}} yields:
Template:Ctop
Lua error: documentation markup for Docbunto not found in Module:Sandbox.
Template:Cbot
Template data
[kolera mu edit source]No description.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Module Name | 1 file | Module page name (without namespace). | String | suggested |
| Infobox Image | image | Infobox image. | File | optional |
| Caption | caption | Infobox image caption. | Content | optional |
| All | all | Include private items in documentation.
| Boolean | optional |
| Boilerplate | boilerplate | Removal of boilerplate (license block comments).
| Boolean | optional |
| Code | code | Only document Docbunto code items - exclude article infobox and lede from rendered documentation.
| Boolean | optional |
| Colon | colon | Parses tags with a `:` suffix and without the `@` prefix. This bypasses the "doctag soup" some authors complain of.
| Boolean | optional |
| No Lua Reference | noluaref | Don't link to the Lua reference manual for types.
| Boolean | optional |
| Plain | plain | Disable Markdown formatting in documentation.
| Boolean | optional |
| Simple | simple | Limit documentation to descriptions only. Removes documentation of subitem tags such as `@param` and `@field`.
| Boolean | optional |
| Sort | sort | Sort documentation items in alphabetical order instead of source code order.
| Boolean | optional |
| Strip | strip | Remove table index in documentation.
| Boolean | optional |
| UList | ulist | Indent subitems as `<ul>` lists (LDoc/JSDoc behaviour) instead of `<dl>` list.
| Boolean | optional |
| Preface | preface | Preface text to insert between lede & item documentation, used to provide usage and code examples. | Content | suggested |