Module:Params/doc: Difference between revisions

Content deleted Content added
m Fixed recurrent typo
m Briefs: use the imperative mood instead of the third person indicative
Line 52:
=== <code>count</code> ===
; Brief
: ''CountsCount the number of parameters whereby a template was called''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|count}}</syntaxhighlight>
Line 78:
=== <code>list</code> ===
; Brief
: ''ListsList the template parameters (both their names and their values)''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|list|[argument separator]|[key-value separator]|[header]|[footer]}}</syntaxhighlight>
Line 90:
=== <code>list_values</code> ===
; Brief
: ''ListsList the template parameter values''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|list_values|[argument separator]|[header]|[footer]}}</syntaxhighlight>
Line 102:
=== <code>concat_and_call</code> ===
; Brief
: ''PrependsPrepend user-given unnamed arguments to the current parameters, or impose user-given named arguments; then propagate everything to a custom template''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|concat_and_call|template name|[prepend 1]|[prepend 2]|[...]|[prepend n]|[named item 1=value 1]|[...]|[named item n=value n]|[...]
Line 127:
=== <code>concat_and_invoke</code> ===
; Brief
: ''PrependsPrepend user-given unnamed arguments to the current parameters, or impose user-given named arguments; then propagate everything to a custom module''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|concat_and_invoke|module name|function name|[prepend 1]|[prepend 2]|[...]|[prepend n]|[named item 1=value 1]|[...]|[named item n=value n]|[...]
Line 140:
=== <code>call_for_each</code> ===
; Brief
: ''For each parameter passed to the caller template, callscall a custom template with at least two parameters (key and value)''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|call_for_each|template name|[append 1]|[append 2]|[...]|[append n]|[named param 1=value 1]|[...]|[named param n=value n]|[...]
Line 153:
=== <code>invoke_for_each</code> ===
; Brief
: ''For each parameter passed to the caller template, invokesinvoke a custom module function with at least two arguments (key and value)''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|invoke_for_each|module name|module function|[append 1]|[append 2]|[...]|[append n]|[named param 1=value 1]|[...]|[named param n=value n]|[...]}}</syntaxhighlight>
Line 165:
=== <code>call_for_each_value</code> ===
; Brief
: ''For each parameter passed to the caller template, callscall a custom template with at least one parameter (i.e. the parameter's value)''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|call_for_each_value|template name|[append 1]|[append 2]|[...]|[append n]|[named param 1=value 1]|[...]|[named param n=value n]|[...]}}</syntaxhighlight>
Line 177:
=== <code>invoke_for_each_value</code> ===
; Brief
: ''For each parameter passed to the caller template, invokesinvoke a custom module function with at least one argument (i.e. the parameter's value)''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|invoke_for_each_value|module name|module function|[append 1]|[append 2]|[...]|[append n]|[named param 1=value 1]|[...]|[named param n=value n]|[...]}}</syntaxhighlight>
Line 189:
=== <code>for_each</code> ===
; Brief
: ''For each parameter passed to the caller template, expandsexpand all occurrences of <code>$#</code> and <code>$@</code> within a given text, as key and value respectively''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|for_each|wikitext|[header]|[footer]}}</syntaxhighlight>
Line 208:
=== <code>sequential</code> ===
; Brief
: ''ReducesReduce the parameter list to the subgroup of consecutive parameters that follow {{para|1}}''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|sequential|pipe function name}}</syntaxhighlight>
Line 222:
=== <code>non-sequential</code> ===
; Brief
: ''ReducesReduce the parameter list by subtracting the subgroup of consecutive parameters that follow {{para|1}}''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|non-sequential|pipe function name}}</syntaxhighlight>
Line 236:
=== <code>with_name_matching</code> ===
; Brief
: ''RemovesRemove from the parameter list all the parameters whose name ''does not match'' the given pattern''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|with_name_matching|pattern|pipe function name}}</syntaxhighlight>
Line 252:
=== <code>with_name_not_matching</code> ===
; Brief
: ''RemovesRemove from the parameter list all the parameters whose name ''matches'' the given pattern''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|with_name_not_matching|pattern|pipe function name}}</syntaxhighlight>
Line 268:
=== <code>with_value_matching</code> ===
; Brief
: ''RemovesRemove from the parameter list all the parameters whose value ''does not match'' the given pattern''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|with_value_matching|pattern|pipe function name}}</syntaxhighlight>
Line 284:
=== <code>with_value_not_matching</code> ===
; Brief
: ''RemovesRemove from the parameter list all the parameters whose value ''matches'' the given pattern''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|with_value_not_matching|pattern|pipe function name}}</syntaxhighlight>
Line 300:
=== <code>trimmed</code> ===
; Brief
: ''RemovesRemove zero or more parameters from the beginning and the end of the parameter list''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|trimmed|left trim|right trim|pipe function name}}</syntaxhighlight>