Модуль:Documentation/doc

This module implements {{Documentation}} and {{LuaDocumentation}}. It is best to see those pages, as they are mainly used there. It also has methods so it can be used in regular modules. It provides automatic template notices based off of the template's state (ex: protection levels).
Template:Dm

## Loading the module

To load this module and make its method available for use, Add this line of code to the start of your module:
Template:DarkCodeBox
All methods described below will be available under the loaded table.

Alternatively, you can use this module using the code below by using **Script error: No such module "String/Templates".**.
Template:DarkCodeBox
Depending on the settings you used in Template:M, the methods of this module may be available under their respective variables in the module this module was loaded in.

## Main function/Constructor

The table this module returns is a class, meaning you can call it as a normal function (Be sure to name the variable you require it under uppercase, as it is considered a best practice in coding to name classes uppercase). This also means you can use it as a normal module.

### Syntax

Template:M

* Template:P - The template/module name to transclude the documentation subpage from. The namespace prefix depends on the type of documentation specified.
* Template:P - The type of documentation box to display. This can be either **Script error: No such module "String/Templates".** or **Script error: No such module "String/Templates".**. Templates do not have a testcases unit, and will display a hidden template notice. Modules will have no notice, but will have a testcases unit. Each link in the module is changed according to the type specified. This defaults to **Script error: No such module "String/Templates".**.
* Template:P - Disables automatic template notices like {{Protected}}.

### Example

**Script error: No such module "String/Templates".**

Produces

**Script error: No such module "Documentation".**

#### Alternative Usage

**Script error: No such module "String/Templates".**

Produces

**Script error: No such module "Documentation".**

## Methods

All methods are available below as fields under the required object name.

### Template:M

This method returns the documentation box in the mode provided by Template:P with the transclusion title as Template:P, with the optional parameter Template:P to disable notices. See #Example for example output.

### Template:M

This method returns the documentation box in module mode with the transclusion title as Template:P, with the optional parameter Template:P to disable notices. . See #Example for example output.

### Template:M

This method returns the documentation box in template mode with the transclusion title as Template:P., with the optional parameter Template:P to disable notices. See #Example for example output.

## Exporting

This module comes with a configuration to make it easier to port it to other wikis and translate.
This configuration can be found at Module:Documentation/Config.
This is so you do not need to directly edit the code, just the configuration.
All keys are commented to show which ones belong to which.

You can change the message values accordingly to your wiki's needs.

## See Also

* {{LuaDocumentation}}
* {{Documentation}}
* {{Documentation subpage}}
* {{Lua doc subpage}}