模板:Module link expanded

文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

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|Example}} {{#invoke:Example|function}} Usage without function name. This does not produce a usable invocation.
{{mlx|Example|hello}} {{#invoke:Example|hello}} Usage with a function name.
{{mlx|Example|count_fruits|4=bananas=5|5=apples=10}} {{#invoke:Example|count_fruits|bananas=5|apples=10}} Usage with a function name and parameters.
{{mlx|Example|count_fruits|bananas{{=}}5|apples{{=}}510}} {{#invoke:Example|count_fruits|bananas=5|apples=10}} Usage with a function name and parameters, using {{=}}.

TemplateData

编辑
以下是该模板的模板数据,适用于可视化编辑器等工具。

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.

模板参数[编辑模板数据]

参数描述类型状态
module name1

the module name without the namespace prefix “Module:”, which is added automatically

字符串必需
function name2

the function name within the module to call

字符串必需
parameter 13

the name (and value) of the first parameter, use {{=}} to add an equal sign

字符串可选
parameter 24

the name (and value) of the second parameter, use {{=}} to add an equal sign

字符串可选
parameter 35

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