Module:Userbox/doc

This module does the processing for three userbox templates, userbox, userbox-2 and userbox-r.

To use any of these templates from a wiki page, please see the individual template pages for documentation. To generate userboxes directly from Lua, read on.

Generating userboxes from Lua
To generate a userbox directly from Lua, first load the module.

&#x3c;syntaxhighlight lang="lua"&#x3e; local userbox = require('Module:Userbox') &#x3c;/syntaxhighlight&#x3e;

You can then run any of the three templates with the code:

&#x3c;syntaxhighlight lang="lua"&#x3e; userbox.main(functionName, args) &#x3c;/syntaxhighlight&#x3e;

For userbox use the function name "&#x3c;code&#x3e;_userbox&#x3c;/code&#x3e;"; for userbox-2 use the function name "&#x3c;code&#x3e;_userbox-2&#x3c;/code&#x3e;"; and for userbox-r use the function name "&#x3c;code&#x3e;_userbox-r&#x3c;/code&#x3e;". The &#x3c;code&#x3e;args&#x3c;/code&#x3e; parameter is a table of arguments to pass to the different userbox functions. To see a list of valid arguments, please consult the individual template pages.