Template:Module link expanded/doc
![]() | 此頁面是Template:Module link expanded的Template文档。 此頁面可能包含了模板的使用說明、分類和其他内容。 |
![]() | 此模板使用Lua语言: |
Template:Module link expanded(编辑 | 讨论 | 历史 | 链接 | 监视 | 日志) (often abbreviated {{mlx}}) 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
[编辑]Code | Result | Notes |
---|---|---|
{{mlx |
{{#invoke:Example|function}}
|
Usage without function name. This does not produce a usable invocation. |
{{mlx |
{{#invoke:Example|hello}}
|
Usage with a function name. |
{{mlx |
{{#invoke:Example|count_fruits|bananas=5|apples=10}}
|
Usage with a function name and parameters. |
{{mlx |
{{#invoke:Example|count_fruits|bananas=5|apples=10}}
|
Usage with a function name and parameters, using {{=}}. |
TemplateData
[编辑]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.
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
module name | 1 | the module name without the namespace prefix “Module:”, which is added automatically | 字符串 | 必需 |
function name | 2 | the function name within the module to call | 字符串 | 必需 |
parameter 1 | 3 | the name (and value) of the first parameter, use {{=}} to add an equal sign | 字符串 | 可选 |
parameter 2 | 4 | the name (and value) of the second parameter, use {{=}} to add an equal sign | 字符串 | 可选 |
parameter 3 | 5 | the name (and value) of the third parameter, use {{=}} to add an equal sign | 字符串 | 可选 |
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