Module:debug/documentation

This module is used to debug templates and other modules, and to help track down problems or incorrect usage.

dump
lua

Converts any value (except for functions) into a string representation. The string is formatted as Lua syntax, so you should be able to take the output of this function and insert it back into a Lua module. Tables are processed recursively. Tabs are converted into spaces.

highlight_dump
lua

Does the same as lua, except it adds Lua syntax highlighting, and tabs are preserved.

error
This function is invoked from templates, and simply triggers a script error with a message. This is useful if you want to trigger a script error but don't have the time or knowledge to convert a template to Lua.

track
lua

Convenience function which transcludes a tracking subtemplate. The lua is a string or a list of strings: lua or lua.

Usually invocations of this functions should look like this: lua or lua. Loading this module on the spot instead of ahead of time may prevent unnecessary transclusion list overload.

highlight
This function creates the equivalent of a or  tag using the lua function from Scribunto. Depending on the arguments, it behaves in two different ways:
 * lua
 * Highlight the given content (which should be a string) using the table of options.
 * lua
 * Returns a highlighting function that uses the given table of options. This is useful when a given set of options are used multiple times in a module. The highlighting function receives a string as argument.

The function recognizes two fields in the table of options:
 * lang
 * Language or file format. (See the full list.) Defaults to.


 * inline
 * Display the code inline, rather than as a block.

af:Module:Ontfout