More actions
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
{{tsh|mlx}}{{lua|Module:Separated entries}} | {{tsh|mlx}}{{lua|Module:Separated entries}} | ||
{{lt|module link expanded}} (often abbreviated <nowiki>{{mlx}}</nowiki>) is used to display a module name as a link surrounded by braces with the {{((}}#invoke{{))}} | {{lt|module link expanded}} (often abbreviated <nowiki>{{mlx}}</nowiki>) is used to display a module name as a link surrounded by braces with the {{((}}#invoke{{))}} parser function, 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 is also supports the definition of a function and parameters. | ||
== Examples == | == Examples == | ||
Revision as of 11:25, 8 April 2025
| This page uses Creative Commons Licensed content from Wikipedia (view authors). |
| This is a documentation subpage for Template:Module link expanded It may contain usage information, categories and other content that is not part of the original template page. |
| This template uses Lua: |
Template:Lt (often abbreviated {{mlx}}) is used to display a module name as a link surrounded by braces with the Template:((#invokeTemplate:)) parser function, 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 is also supports the definition of a function and parameters.
Examples
| Code | Result | Notes |
|---|---|---|
| Template:Tji | {{#invoke:Example|function}}
|
Usage without function name. This does not produce a usable invocation. |
| Template:Tji | {{#invoke:Example|hello}}
|
Usage with a function name. |
| Template:Tji | {{#invoke:Example|count_fruits|bananas=5|apples=10}}
|
Usage with a function name and parameters. |
| Template:Tji | {{#invoke:Example|count_fruits|bananas=5|apples=10}}
|
Usage with a function name and parameters, using Template:((=Template:)). |
TemplateData
TemplateData for Module link expanded
This template displays a module name as a link surrounded by braces with the {{#invoke}} parser function, 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 | String | required |
| 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
- {{ml}} – similar function but not surrounded in
<code>...</code>tags - {{mfl}} – similar to {{ml}} but creates a link to the function's documentation
- {{tlx}} – a version of this template for templates instead of modules
Template:Template-linking templates