LoadLib/doc

This module is used to ease the loading of other modules. It does this by utilizing the global variable table, which allows for more flexibility in variables.
It will also automatically load several modules.

## Loading the module

To load this module and make it available for use, Add this line of code to the start of your module:
Template:DarkCodeBox

## Syntax

Template:M

* Template:P - The Template:P parameter is the global table. This must be the specific variable **Script error: No such module "String/Templates".** or the function will fail.
* Template:P - The collection of modules to load. Each key name in this table represents the variable to save the loaded module under. each key may be a table, with the table containing options for the loader for that specific module. See the section below for more details.

## Use

This module provides a singe function to load other modules.

This function has options that emulate normal lua code.
Template:Format.
Template:DarkCodeBox
Note that in these examples, sometimes the named table index is not omitted, which prevents the entire module from being loaded.
If the table index is omitted, the loader will load the module under the index name.

### Variable setting

You can also add the field **Script error: No such module "String/Templates".** to **Script error: No such module "String/Templates".** to make the loader set each method in the module as a variable in the loaded module.

#### Example

Template:DarkCodeBox
Once this code is added to the module, any methods described in **Script error: No such module "String/Templates".** will be available as variables in the loaded modules with the variable name being the respective method in **Script error: No such module "String/Templates".**.

### Paths

This module also provides basic relative paths and substitution variables.
Any relative paths are substituted to absolute paths.
These basic relative paths are the following:

* **Note in these examples that the current page name is **Script error: No such module "String/Templates".**.**
* A **Script error: No such module "String/Templates".** at the start of the module name denotes a subpage of the parent (not the root) module.
	+ Example: **Script error: No such module "String/Templates".** → **Script error: No such module "String/Templates".**
	+ Example: **Script error: No such module "String/Templates".** → **Script error: No such module "String/Templates".**
* A **Script error: No such module "String/Templates".** at the start of the module name denotes a subpage of the root module.
	+ Example: **Script error: No such module "String/Templates".** → **Script error: No such module "String/Templates".**
	+ Example: **Script error: No such module "String/Templates".** → **Script error: No such module "String/Templates".**
* A **Script error: No such module "String/Templates".** at the start of the module name denotes a subpage of the current module.
	+ Example: **Script error: No such module "String/Templates".** → **Script error: No such module "String/Templates".**
	+ Example: **Script error: No such module "String/Templates".** → **Script error: No such module "String/Templates".**

### Autoloads

This module automatically loads a preset list of commonly used modules. These modules may be found in Autoloads.
These may be disabled entirely using **Script error: No such module "String/Templates".** or some modules may be filtered using the **Script error: No such module "String/Templates".** parameter.

### Variables

You can also use variables (denoted by **Script error: No such module "String/Templates".**) in the paths.
These variables are substituted with the contents they repersent.
The list of built-in variables is as follows:

* **Script error: No such module "String/Templates".** denotes the root page name.
* **Script error: No such module "String/Templates".** denotes the current page name.
* **Script error: No such module "String/Templates".** denotes the current subpage name.
* **Script error: No such module "String/Templates".** and **Script error: No such module "String/Templates".** denotes the base (not root) page name.
* **Script error: No such module "String/Templates".** denotes the current page name (with the namespace prefix).

Custom variables can be created by adding a table in the **Script error: No such module "String/Templates".** or **Script error: No such module "String/Templates".** field in the Template:P parameter.
The table index in the table for variables represents the variable name, and the table value its contents.
A custom variable may be called with the following syntax: **Script error: No such module "String/Templates".**

#### Example

The example variable here is set to **Script error: No such module "String/Templates".** and it's name is **Script error: No such module "String/Templates".**.
The page name in the example is **Script error: No such module "String/Templates".**

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

#### Code Example

The current page name in this example is **Script error: No such module "String/Templates".**.
Note that the current path **Script error: No such module "String/Templates".** will get subsituted to **Script error: No such module "String/Templates".**.
**Script error: No such module "String/Templates".**
Note the module will throw an error if a custom variable does not exist or there is no substitution table to draw from.
All methods from **Script error: No such module "String/Templates".** will now be availible under the **Script error: No such module "String/Templates".** object in the module the function was used.

## Options

The following consists of different options for the loader to load the module.
Note that you can group each of these options together in one Template:M call.

### Option 1

This option replicates a standard Template:M call.
See the section below for the Replicated code.
Template:DarkCodeBox

Once this line of code is added to your module, the module and its methods are available under the table index name.
In this case, all methods of **Script error: No such module "String/Templates".** are available under the variable **Script error: No such module "String/Templates".**.

### Option 2

This option replicates a Template:M call and getting a single field from the module and setting that field name as the variable to be used.
See the section below for the emulated code.
Template:DarkCodeBox
Once this code is added, the method Template:M from **Script error: No such module "String/Templates".** is is available under the **Script error: No such module "String/Templates".** variable.

### Option 3

This option replicates a Template:M call and getting a single field from the module and setting that field name as a different variable from the method name.
See the section below for the emulated code.
Template:DarkCodeBox
Once this code is added, the method Template:M from **Script error: No such module "String/Templates".** is is available under the **Script error: No such module "String/Templates".** variable.

### Option 4

This option replicates a Template:M call and getting multiple fields from the module and setting that field name as the variable to be used.
See the section below for the emulated code.
Template:DarkCodeBox
Once this code is added, the methods Template:M, Template:M, and Template:M from **Script error: No such module "String/Templates".** is is available under the **Script error: No such module "String/Templates".**, **Script error: No such module "String/Templates".**, and **Script error: No such module "String/Templates".** variables respectively.

### Option 5

This option replicates a Template:M call and getting multiple fields from the module and setting that field name as a different variable from the respective method name.
See the section below for the emulated code.
Template:DarkCodeBox
Once this code is added, the methods Template:M, Template:M, and Template:M from **Script error: No such module "String/Templates".** is is available under the **Script error: No such module "String/Templates".**, **Script error: No such module "String/Templates".**, and **Script error: No such module "String/Templates".** variables respectively.

* Note that this method may be mixed with the method above.