Jump to content

Template:Module link

shortcuts: {{ml}} {{mfl}}
From mediawiki.org
Template documentation


{{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.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
module name1

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

Stringrequired
function name2

the function name within the module to call, expected to be documented

Stringoptional
parameter 13

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

Stringoptional
parameter 24

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

Stringoptional
parameter 35

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

Stringoptional

See also

[edit]