Module:Documentation/doc
From Convention Master Documentation
< Module:DocumentationThis is the documentation page for Module:Documentation
{{#switch:
{{#if: | | {{#ifeq:Module|Module | module | other }} }}
| module =
{{#switch: release
| pre-alpha | prealpha | pa = File:OOjs UI icon text-style.svg | alpha | a = File:OOjs UI icon bold-a.svg | beta | b = File:OOjs UI icon bold-b.svg | release | r | general | g = File:OOjs UI icon check-constructive.svg | protected | protect | p = [[File:{{#if:|Cascade-protection-shackle.svg|{{#ifeq:|sysop|Full-protection-shackle-red.svg|Semi-protection-shackle-no-text.svg}}}}|40x40px|link=]] | semiprotected | semiprotect | semi = File:Semi-protection-shackle.svg | #default = File:OOjs UI icon alert-destructive.svg}} | {{#switch: release
| pre-alpha | prealpha | pa = <translate> This module is rated as [[<tvar name=1>Special:MyLanguage/Category:Modules in pre-alpha development</tvar>|pre-alpha]].</translate> <translate> It is unfinished, and may or may not be in active development.</translate> <translate> It should not be used from article namespace pages.</translate> <translate> Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure.</translate>{{#ifexpr: {{#ifexpr: ( {{#ifeq:doc|doc|1|0}} or ( {{#ifeq:{{#titleparts:module:documentation/doc|-1|-2}}|doc|1|0}} and {{#if:{{#translation:}}|1|0}} ) )|1|0}} or {{#ifeq:doc|sandbox|1|0}} || {{#ifeq: | true | | }} }} | alpha | a = <translate> This module is rated as [[<tvar name=1>Special:MyLanguage/Category:Modules in alpha</tvar>|alpha]].</translate> <translate> It is ready for third party input, and may be used on a few pages to see if problems arise, but should be watched.</translate> <translate> Suggestions for new features or changes in their input and output mechanisms are welcome.</translate>{{#ifexpr: {{#ifexpr: ( {{#ifeq:doc|doc|1|0}} or ( {{#ifeq:{{#titleparts:module:documentation/doc|-1|-2}}|doc|1|0}} and {{#if:{{#translation:}}|1|0}} ) )|1|0}} or {{#ifeq:doc|sandbox|1|0}} || {{#ifeq: | true | | }} }} | beta | b = <translate> This module is rated as [[<tvar name=1>Special:MyLanguage/Category:Modules in beta</tvar>|beta]], and is ready for widespread use.</translate> <translate> It is still new and should be used with some caution to ensure the results are as expected.</translate>{{#ifexpr: {{#ifexpr: ( {{#ifeq:doc|doc|1|0}} or ( {{#ifeq:{{#titleparts:module:documentation/doc|-1|-2}}|doc|1|0}} and {{#if:{{#translation:}}|1|0}} ) )|1|0}} or {{#ifeq:doc|sandbox|1|0}} || {{#ifeq: | true | | }} }} | release | r | general | g = <translate> This module is rated as [[<tvar name=1>Special:MyLanguage/Category:Modules for general use</tvar>|ready for general use]].</translate> <translate> It has reached a mature form and is thought to be bug-free and ready for use wherever appropriate.</translate> <translate> It is ready to mention on help pages and other resources as an option for new users to learn.</translate> <translate> To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing.</translate>{{#ifexpr: {{#ifexpr: ( {{#ifeq:doc|doc|1|0}} or ( {{#ifeq:{{#titleparts:module:documentation/doc|-1|-2}}|doc|1|0}} and {{#if:{{#translation:}}|1|0}} ) )|1|0}} or {{#ifeq:doc|sandbox|1|0}} || {{#ifeq: | true | | }} }} | protected | protect | p = <translate> This module is [[<tvar name=1>Special:MyLanguage/Category:Modules subject to page protection</tvar>|subject to {{<tvar name=2>#if:</tvar>|cascading|page}} protection]].</translate> <translate> It is a highly visible module in use by a very large number of pages.</translate> <translate> Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is [[<tvar name=1>Special:MyLanguage/Project:Protected page</tvar>|protected]] from editing.</translate>{{#ifexpr: {{#ifexpr: ( {{#ifeq:doc|doc|1|0}} or ( {{#ifeq:{{#titleparts:module:documentation/doc|-1|-2}}|doc|1|0}} and {{#if:{{#translation:}}|1|0}} ) )|1|0}} or {{#ifeq:doc|sandbox|1|0}} || {{#ifeq: | true | | }} }} | #default = Template:Error}} |
| other | #default = Template:Error }} Lua error: callParserFunction: function "#translation" was not found. Lua error: bad argument #1 to "get" (not a valid title). This module displays a blue box containing documentation for templates, Lua modules, or other pages. The {{#if:{{safesubst:#switch:
|no |n |false |0 = | = |¬ = |yes |y |true |1 = yes |#default = yes
}}|}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:documentation|documentation]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} template invokes it.
Normal usage
For most uses, you should use the {{#if:{{safesubst:#switch:
|no |n |false |0 = | = |¬ = |yes |y |true |1 = yes |#default = yes
}}|}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:documentation|documentation]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} template; please see that template's page for its usage instructions and parameters.
Use in other modules
To use this module from another Lua module, first load it with require
:
local documentation = require('Module:Documentation').main
Then you can simply call it using a table of arguments.
documentation{content = 'Some documentation', ['link box'] = 'My custom link box'}
Please refer to the template documentation for usage instructions and a list of parameters.
Porting to other wikis
The module has a configuration file at Module:Documentation/config which is intended to allow easy translation and porting to other wikis. Please see the code comments in the config page for instructions. If you have any questions, or you need a feature which is not currently implemented, please leave a message at Template talk:Documentation to get the attention of a developer.
[[Category:Module documentation pages{{#translation:}}]]