Template:Module link
| Uses Lua: |
{{Module link}} is used to display a module name as a link surrounded by braces with the {{#invoke}} parser functions, thus showing the module name as code rather than actually invoking it. Its primary use is in instruction and documentation where it is used to refer to a module by name without invoking it. It also supports the definition of a function and parameters. The template assumes that the function specified is documented, and thus creates a link to a section of the same name expected to be found in the documentation
Usage
[edit]| Code | Result | Notes |
|---|---|---|
| {{mfl|Example}} | {{#invoke:Example}} | Omits the function name |
| {{mfl|Example|hello}} | {{#invoke:Example|hello}} | Usage with a function name. |
| {{mfl|Example|count_fruit|3=bananas=10|4=kiwis=5}} | {{#invoke:Example|count_fruit|bananas=10|kiwis=5}} | Usage with a function name and parameters. |
| {{mfl|Example|count_fruit|Fred|bananas{{=}}10|apples{{=}}5}} | {{#invoke:Example|count_fruit|Fred|bananas=10|apples=5}} | Usage with a function name and parameters, using {{=}}. |
| {{mfl|Example|}} | {{#invoke:Example|function}} | Usage with a generic function name. This does not produce a usable invocation. |
TemplateData
[edit]This is the TemplateData documentation for this template used by VisualEditor and other tools.
Module link
This template displays a module name as a link surrounded by braces with the {{#invoke}} parser function, itself linked, thus showing how the module name would be used in code. Its primary use is in instruction and documentation.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| module name | 1 | the module name without the namespace prefix “Module:”, which is added automatically | String | required |
| function name | 2 | the function name within the module to call, expected to be documented | String | optional |
| parameter 1 | 3 | the name (and value) of the first parameter, use {{=}} to add an equal sign | String | optional |
| parameter 2 | 4 | the name (and value) of the second parameter, use {{=}} to add an equal sign | String | optional |
| parameter 3 | 5 | the name (and value) of the third parameter, use {{=}} to add an equal sign | String | optional |
See also
[edit]- Category:Internal template-link templates
- {{Tl}} - A version of this template for templates instead of modules.