模板: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