Global Lua Modules/Codedoc

Automatically creates documentation of a Lua module by extracting its documentation markup.

Usage
This module makes use of the syntax defined in ExpLua to retrieve documentation for a module. For example, with Module:codedoc/sample one could use the following Lua invoke in a talk page to show its code:

See generated docs in Module talk:Codedoc/sample.

Syntax
The syntax is:

The module name must contain the syntax as described, otherwise it will not retrieve anything.

Documentation syntax
As described by the ExpLua author :

For the whole file:

(Both --by and --TODO can be abbreviated to --b and --T)

Preceding each function:

Description
The syntax relies on adding comments with special characters that have a specific meaning, as described below:


 * — is used to describe the module itself
 * — contains author info
 * — contains any todo notes
 * — describes the purpose of the function
 * — contains information about the parameters (format: "parameter name (parameter type) description")
 * — contains the description of the values returned by a function (format: "return type and description")

Note that by default the module details (author, etc.) are hidden by a setting in the script, but this can be overwritten.