Module:Params/doc: Difference between revisions

Content deleted Content added
Update the documentation
Line 63:
<syntaxhighlight lang="wikitext">{{#invoke:params|non-sequential|with_name_matching|^B|with_name_matching|n$|with_value_matching|feline|setting|h/p/i/f|<dl><dt>|</dt><dd>|</dd><dt>|</dd></dl>|list}}</syntaxhighlight>
 
The two modifiers <code>[[#sequential|sequential]]</code> and <code>[[#non-sequential|non-sequential]]</code> refer to a technical jargon used in wikitext: given a parameter list, the subgroup of sequential parameters is constituted by the largest group of consecutive numericalnumeric parameters starting from {{tjp|1:}} – this is known as the parameters' “sequence”. A parameter list that does not have a first parameter specified does not possess a sequence.
 
== Functions ==
Line 172:
 
; Brief
: ''Prepend positive numericalnumeric arguments to the current parameters, or impose non-numericalnumeric or negative numericalnumeric 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]|[...]}}</syntaxhighlight>
Line 189:
|wind: spicy|hello: not today}}
 
By using the <code>[[#cutting|cutting]]</code> modifier it is possible to impose numericalnumeric positive parameters instead of prepending them. For instance, the following code echoes all incoming parameters to <syntaxhighlight lang="wikitext" inline>{{my template}}</syntaxhighlight>, with the exception of {{para|3}}, which is replaced with <code>hello world</code>:
 
<syntaxhighlight lang="wikitext">{{#invoke:params|cutting|3|0|concat_and_call|my template|{{{1|}}}|{{{2|}}}|hello world}}</syntaxhighlight>
 
If the numericalnumeric parameters to replace are a limited number, as in the example above, a better alternative might be that of using <code>[[#imposing|imposing]]</code>.
 
If no other argument besides the ''template name'' is provided this function simply echoes the current parameters to another template.
Line 214:
 
; Brief
: ''Prepend positive numericalnumeric arguments to the current parameters, or impose non-numericalnumeric or negative numericalnumeric 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]|[...]}}</syntaxhighlight>
Line 237:
 
; Brief
: ''Prepend positive numericalnumeric arguments to the current parameters, or impose non-numericalnumeric or negative numericalnumeric arguments, then propagate everything to a custom parser function''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|concat_and_magic|parser function|[prepend 1]|[prepend 2]|[...]|[prepend n]|[named item 1=value 1]|[...]|[named item n=value n]|[...]}}</syntaxhighlight>
Line 629:
 
; Brief
: ''Call a custom template for each group of parameters that have the same numericalnumeric suffix''
; 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>
 
The custom template will be repeatedly called with the numericalnumeric id of the group (i.e. the numericalnumeric suffix) as '''argument zero''' (i.e. {{param|0}}). This will be an empty string for the group of incoming parameters that do not have a numericalnumeric suffix. A hyphen before the numericalnumeric suffix will be interpreted as a minus sign (and therefore the group id will be treated as a negative number). NumericalNumeric incoming parameters will be treated as if their prefix is an empty string (these can be captured using <code>&#123;&#123;&#123;&#125;&#125;&#125;</code> or <code>&#123;&#123;&#123;&#124;''fallback text''&#125;&#125;&#125;</code> in the callback template). Spaces between the prefix and the numericalnumeric suffix will be ignored (therefore writing {{para|foobar123}} will be identical to writing {{para|foobar&nbsp;123}} – in case of collisions one of the two values will be discarded). In the unlikely scenario that the prefix is itself a number (e.g. {{para|1 1}}, {{para|2 1}}, etc.), if this is <code>0</code> or a negative number it will be decreased by one unit in order to leave the parameter zero undisturbed (so <code>0</code> will become <code>-1</code>, <code>-1</code> will become <code>-2</code>, and so on – if needed, you can use <code>...|[[#purging|purging]]|0{1|...</code> in the callback template to renormalize these numbers).
 
All unnamed arguments that follow the ''template name'' in the invocation of this module will appear as sequential parameters in each call. Named arguments will be passed verbatim. Both named and unnamed arguments passed to this function will be given precedence in case of collisions. NumericalNumeric argument names below <code>1</code> will be decreased by one unit (i.e. <code>...|call_for_each_group&#124;example template&#124;0=Hello world&#124;...</code> will become {{para|-1|Hello world}} in the callback template – see above).
 
A header (<code>h</code>), an iteration delimiter (<code>i</code>), a last iteration delimiter (<code>l</code>), a footer (<code>f</code>), and a fallback text (<code>n</code>) can be declared via the <code>[[#setting|setting]]</code> modifier – the string assigned to the key-value pair delimiter (<code>p</code>) will be ignored.
Line 696:
}}</syntaxhighlight>
 
'''The modifiers <code>[[#sequential|sequential]]</code>, <code>[[#non-sequential|non-sequential]]</code>, <code>[[#all_sorted|all_sorted]]</code> and <code>[[#reassorted|reassorted]]</code> will affect what groups of parameters will be iterated, not what parameters will be grouped.''' Before calling this function you will likely want to reduce the list of parameters via one of the <code>with_*_matching</code> group of modifiers (for instance <code>...|with_name_matching|.%-%d+$|or|[^%-]%d+$|call_for_each_group|...</code> leaves only the parameters in which both the prefix and the numericalnumeric suffix are not empty strings). The <code>[[#reassorted|reassorted]]</code> modifier often accompanies this function.
 
{{vpad|clear=none}}
Line 848:
 
; Brief
: ''(IN FUNCTIONS ONLY, DOES NOT AFFECT MODIFIERS) When the time will come, all parameters will be dispatched sorted: first the numericalnumeric ones in ascending order, then the rest in [[natural sort order|natural order]]''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|all_sorted|pipe function name}}</syntaxhighlight>
Line 889:
 
; Brief
: ''(IN FUNCTIONS ONLY, DOES NOT AFFECT MODIFIERS) When the time will come, all parameters will be dispatched sorted: first non numericalnumeric ones in [[natural sort order|natural order]]'', then the numericalnumeric ones in ascending order
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|reassorted|pipe function name}}</syntaxhighlight>
Line 1,005:
 
; Brief
: ''Rearrange all parameters that have numericalnumeric names to form a compact sequence starting from 1, keeping the same order''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|squeezing|pipe function name}}</syntaxhighlight>
Line 1,015:
This modifier does not take arguments besides the name of the function that will follow.
 
The following three concatenations will lead to the same result of discarding all parameters with numericalnumeric names:
 
# <syntaxhighlight lang="wikitext" inline>{{...|with_name_not_matching|^%-?%d+$excluding_numeric_names|...}}</syntaxhighlight>
# <syntaxhighlight lang="wikitext" inline>{{...|with_name_not_matching|^%-?%d+$|...}}</syntaxhighlight>
# <syntaxhighlight lang="wikitext" inline>{{...|non-sequential|squeezing|...}}</syntaxhighlight>
# <syntaxhighlight lang="wikitext" inline>{{...|squeezing|non-sequential|...}}</syntaxhighlight>
 
# <syntaxhighlight lang="wikitext" inline>{{...|with_name_not_matching|^%-?%d+$|...}}</syntaxhighlight>
The first solution is the most optimized one. Furthermore, in the last two solutions the numeric parameters are discarded just before the final function is invoked (sometimes this might be a wanted result).
 
{{vpad|1.5em|clear=none}}
Line 1,034 ⟶ 1,037:
 
; Brief
: ''Assign an empty string to all undefined numericalnumeric parameters between 1 or the lowest numericalnumeric parameter name provided and the maximum numericalnumeric parameter provided''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|filling_the_gaps|pipe function name}}</syntaxhighlight>
Line 1,044 ⟶ 1,047:
This modifier does not take arguments besides the name of the function that will follow.
 
Note that when all numericalnumeric parameters are lower than 1, the gap between 1 and the maximum numericalnumeric parameter will not be filled. The following table provides some examples.
 
{| class="wikitable" style="margin-left: auto; margin-right: auto;"
|+ NumericalNumeric parameters provided
|-
! Before calling <code>filling_the_gaps</code>
Line 1,090 ⟶ 1,093:
 
; Brief
: ''Remove all numericalnumeric parameters that are not in the sequence''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|clearing|pipe function name}}</syntaxhighlight>
Line 1,096 ⟶ 1,099:
This modifier does not take arguments besides the name of the function that will follow.
 
Unlike <code>[[#sequential|sequential]]</code> – which affects only the way parameters are shown – this modifier actually removes all non-sequential numericalnumeric parameters, albeit leaves non-numericalnumeric parameters intact.
 
Example:
Line 1,102 ⟶ 1,105:
<syntaxhighlight lang="wikitext">{{#invoke:params|clearing|setting|i/p|<br />|: |list}}</syntaxhighlight>
 
If you want to remove also non-numericalnumeric parameters, add the <code>[[#with_name_matchingexcluding_non-numeric_names|with_name_matchingexcluding_non-numeric_names]]</code> modifier:
 
<syntaxhighlight lang="wikitext">{{#invoke:params|clearing|with_name_matching|^%d+$excluding_non-numeric_names|setting|i/p|<br />|: |list}}</syntaxhighlight>
 
If you want instead to remove sequential parameters and leave the rest, use <syntaxhighlight lang="wikitext" inline>{{...|cutting|-1|1|...}}</syntaxhighlight>:
Line 1,134 ⟶ 1,137:
<syntaxhighlight lang="wikitext">{{#invoke:params|cutting|0|2|sequential|call_for_each_value|example template}}</syntaxhighlight>
 
If the absolute value of the sum of the two arguments (left and right cut) is greater than the number of ''sequential'' parameters available, the behavior will be the same as if the sum had been equal to the number of sequential parameters available, both when this is a positive value and when it is a negative value (with opposite results). After the desired sequential parameters have been discarded, all numericalnumeric parameters will be shifted accordingly.
 
In some cases it might be necessary to concatenate more than one invocation of the <code>cutting</code> modifier. For instance, the following code prints the last unnamed parameter passed, but only if at least two parameters were passed:
Line 1,156 ⟶ 1,159:
 
; Brief
: ''Remove zero or more parameters from the beginning and the end of the '''list of numericalnumeric parameters''' (not only the sequential ones)''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|cropping|left crop|right crop|pipe function name}}</syntaxhighlight>
 
This modifier is very similar to <code>[[#cutting|cutting]]</code>, but instead of removing arguments from the extremities of the parameters' ''sequence'', arguments will be removed counting from the first and the last numericalnumeric arguments given (i.e. {{para|-1000|...}} and {{para|1000|...}} in the case of <syntaxhighlight lang="wikitext" inline>{{foobar|-1000=hello|1=my|1000=darling}}</syntaxhighlight>). If any of the two arguments contains a negative number its absolute value indicates what must be left ''on the opposite side''.
 
Example:
Line 1,180 ⟶ 1,183:
: 19: nineteen
 
If the absolute value of the sum of the two arguments (left and right crop) is greater than the difference between the largest and the lowest ''numericalnumeric'' parameters available, the behavior will be the same as if the sum had been equal to the number of numericalnumeric parameters available, both when this is a positive value and when it is a negative value (with opposite results). When ''sequential'' parameters are present among the discarded parameters, all the remaining numericalnumeric parameters greater than zero will be shifted accordingly.
 
{{vpad|1.5em|clear=none}}
Line 1,196 ⟶ 1,199:
 
; Brief
: ''Remove zero or more parameters from any point of the list of numericalnumeric parameters, shifting everything accordingly''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|purging|start offset|length|pipe function name}}</syntaxhighlight>
 
The first argument indicates at which point in the parameter list the removal must begin, the second argument indicates how many parameters must be discarded among it and what lies ''on the right side''. If the second argument contains zero or a negative number its absolute value indicates what must be left ''at the end of the right side'' of the list of numericalnumeric parameters – i.e. <syntaxhighlight lang="wikitext" inline>{{#invoke:params|purging|5|0|list}}</syntaxhighlight> indicates that every numericalnumeric argument whose numericalnumeric name is greater than <code>4</code> must be removed.
 
Example:
Line 1,220 ⟶ 1,223:
 
; Brief
: ''Remove zero or more parameters from any point of the list of numericalnumeric parameters, moving backwards and shifting everything accordingly''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|backpurging|start offset|length|pipe function name}}</syntaxhighlight>
 
The first argument indicates at which point in the parameter list the removal must begin, the second argument indicates how many parameters must be discarded among it and what lies ''on the left side''. If the second argument contains zero or a negative number its absolute value indicates what must be left ''at the end of the left side'' of the list of numericalnumeric parameters – i.e. <syntaxhighlight lang="wikitext" inline>{{#invoke:params|purging|5|0|list}}</syntaxhighlight> indicates that every numericalnumeric argument whose numericalnumeric name is less than <code>6</code> must be removed.
 
Example:
Line 1,230 ⟶ 1,233:
<syntaxhighlight lang="wikitext">{{#invoke:params|backpurging|3|1|call_for_each_value|example template}}</syntaxhighlight>
 
The following code removes all parameters with negative and zero numericalnumeric names, then lists the rest:
 
<syntaxhighlight lang="wikitext">{{#invoke:params|backpurging|0|0|for_each|[$#: $@]}}</syntaxhighlight>
Line 1,248 ⟶ 1,251:
 
; Brief
: ''Reverse the order of all numericalnumeric parameters (not only sequential ones), making sure that the largest numericalnumeric parameter and {{para|1}} are swapped''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|rotating|pipe function name}}</syntaxhighlight>
Line 1,272 ⟶ 1,275:
 
; Brief
: ''Reverse the order of all numericalnumeric parameters (not only sequential ones)''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|mirroring|pipe function name}}</syntaxhighlight>
Line 1,278 ⟶ 1,281:
This modifier does not take arguments besides the name of the function that will follow.
 
This modifier reverses the order of numericalnumeric parameters, making sure that the minimum and the maximum numericalnumeric parameters remain always the same (albeit inverted).
 
Example:
Line 1,298 ⟶ 1,301:
 
; Brief
: ''Reverse the order of all numericalnumeric parameters (not only sequential ones), '''keeping the parameters' sequence always centered'''''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|pivoting|pipe function name}}</syntaxhighlight>
Line 1,304 ⟶ 1,307:
This modifier does not take arguments besides the name of the function that will follow.
 
This modifier reverses the order of numericalnumeric parameters, making sure that those in the parameters' sequence always remain in the sequence. As a consequence, the values of the minimum and the maximum numericalnumeric parameters may change. If no sequence is present this modifier is identical to <code>[[#mirroring|mirroring]]</code>.
 
Example:
Line 1,324 ⟶ 1,327:
 
; Brief
: ''Swap the lowest numericalnumeric parameter with the highest, the second lowest with the second highest, and so on, keeping the sequence in the same place albeit in reverse order''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|swapping|pipe function name}}</syntaxhighlight>
Line 1,377 ⟶ 1,380:
 
; Brief
: ''Add one or more numericalnumeric parameters to the list of parameters, shifting everything accordingly''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|inserting|position|how many|...|pipe function name}}</syntaxhighlight>
Line 1,384 ⟶ 1,387:
 
<syntaxhighlight lang="wikitext">{{#invoke:params|inserting|1|2|hello|world|for_each|[$#: $@]}}</syntaxhighlight>
 
Currently, appending parameters after the last numeric parameter requires some workaround. The following example will add three new parameters and list all parameters:
 
<syntaxhighlight lang="wikitext">{{#invoke:params|
all_sorted|
entering_substack|
backpurging|0|0|
detaching_substack|
rotating|
inserting|1|3|added parameter 3|added parameter 2|added parameter 1|
rotating|
merging_substack|
for_each|[$#:$@]}}</syntaxhighlight>
 
Similarly, the following workaround will append three parameters at the end of the sequence:
 
<syntaxhighlight lang="wikitext">{{#invoke:params|
all_sorted|
entering_substack|
clearing|
detaching_substack|
rotating|
inserting|1|3|added parameter 3|added parameter 2|added parameter 1|
rotating|
leaving_substack|
inserting|1|3||||
flushing|
for_each|[$#:$@]}}</syntaxhighlight>
 
{{vpad|clear=none}}
 
{{A note}} The values of the parameters inserted will not be trimmed of their leading and trailing spaces. The first two numericalnumeric arguments and the <code>inserting</code> modifier name itself, however, will be trimmed of their surrounding spaces.
-->
{{vpad|1.5em|clear=none}}
Line 1,452 ⟶ 1,483:
 
; Brief
: ''Discard one or more numericalnumeric parameters or one non-numericalnumeric parameter''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|discarding|name|[how many]|pipe function name}}</syntaxhighlight>
 
If, and only if, the name of the parameter is numericalnumeric, it is possible to add a second argument to indicate how many contiguous parameters must be discarded starting from the first argument. If the discarded parameters is part of the parameters' sequence one or more holes will be created. To avoid creating holes, use <code>[[#purging|purging]]</code> or <code>[[#backpurging|backpurging]]</code>.
 
Example #1 (discard the parameter named {{para|hello}}):
Line 1,492 ⟶ 1,523:
 
{{A note}} All arguments passed to this modifier and the <code>discarding</code> modifier name itself will be trimmed of their surrounding spaces.
 
{{vpad|1.5em|clear=none}}
 
=== <code>excluding_non-numeric_names</code> ===
{{Infobox|headerstyle=background:lavender
| titlestyle = font-weight:normal; font-size:100%;
| title = Modifier <code>excluding_non-numeric_names</code> <span style="nowrap">({{module:params/doc/link to the code|excluding_non-numeric_names|code}})</span>
| label1 = Num. of arguments | data1 = 0
| label2 = Repeatable | data2 = Yes
| header3 = See also
| data4 = <code>[[#excluding_non-numeric_names|excluding_non-numeric_names]]</code>, <code>[[#with_name_matching|with_name_matching]]</code>, <code>[[#with_name_not_matching|with_name_not_matching]]</code>, <code>[[#clearing|clearing]]</code>
}}
 
; Brief
: ''Discard all non-numeric parameters''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|excluding_non-numeric_names|pipe function name}}</syntaxhighlight>
 
This modifier is only syntax sugar for <code>...&#124;with_name_matching&#124;^%-?%d+$&#124;...</code> (but using a slighly faster optimization). For the inverse modifier, see <code>[[#excluding_numeric_names|excluding_non-numeric_names]]</code>. If you want to remove also non-sequential parameters, add the <code>[[#clearing|clearing]]</code> modifier to the pipeline (<code>...&#124;excluding_non-numeric_names&#124;clearing&#124;...</code>).
 
{{vpad|1.5em|clear=none}}
 
=== <code>excluding_numeric_names</code> ===
{{Infobox|headerstyle=background:lavender
| titlestyle = font-weight:normal; font-size:100%;
| title = Modifier <code>excluding_numeric_names</code> <span style="nowrap">({{module:params/doc/link to the code|excluding_numeric_names|code}})</span>
| label1 = Num. of arguments | data1 = 0
| label2 = Repeatable | data2 = Yes
| header3 = See also
| data4 = <code>[[#excluding_non-numeric_names|excluding_non-numeric_names]]</code>, <code>[[#with_name_matching|with_name_matching]]</code>, <code>[[#with_name_not_matching|with_name_not_matching]]</code>
}}
 
; Brief
: ''Discard all numeric parameters (not only the sequential ones)''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|excluding_numeric_names|pipe function name}}</syntaxhighlight>
 
This modifier is only syntax sugar for <code>...&#124;with_name_not_matching&#124;^%-?%d+$&#124;...</code> (but using a slighly faster optimization). For the inverse modifier, see <code>[[#excluding_non-numeric_names|excluding_non-numeric_names]]</code>.
 
{{vpad|1.5em|clear=none}}
Line 1,502 ⟶ 1,571:
| label2 = Repeatable | data2 = Yes
| header3 = See also
| data4 = <code>[[#excluding_numeric_names|excluding_numeric_names]]</code>, <code>[[#excluding_non-numeric_names|excluding_non-numeric_names]]</code>, <code>[[#with_name_not_matching|with_name_not_matching]]</code>, <code>[[#with_value_matching|with_value_matching]]</code>, <code>[[#with_value_not_matching|with_value_not_matching]]</code>
}}
 
Line 1,571 ⟶ 1,640:
| label2 = Repeatable | data2 = Yes
| header3 = See also
| data4 = <code>[[#excluding_numeric_names|excluding_numeric_names]]</code>, <code>[[#excluding_non-numeric_names|excluding_non-numeric_names]]</code>,<code>[[#with_name_matching|with_name_matching]]</code>, <code>[[#with_value_matching|with_value_matching]]</code>, <code>[[#with_value_not_matching|with_value_not_matching]]</code>
}}
 
Line 1,694 ⟶ 1,763:
Order affects also performance, and how many values will be trimmed of their leading and trailing spaces will depend on where <code>trimming_values</code> is placed. For instance, if a template were invoked with 50 parameters and its code contained <syntaxhighlight lang="wikitext" inline>{{#invoke:params|trimming_values|cutting|-1|0|list}}</syntaxhighlight>, first all its values would be trimmed of leading and trailing blank spaces and then its first 49 parameters would be discarded. On the other hand, writing <syntaxhighlight lang="wikitext" inline>{{#invoke:params|cutting|-1|0|trimming_values|list}}</syntaxhighlight> would first discard 49 parameters and then trim the only value left, resulting in a more efficient code. As a general rule, placing <code>trimming_values</code> as the last modifier is usually the best choice.
 
In most cases placing <code>trimming_values</code> together with <code>non-sequential</code> will result in an empty call with no effects, because non-sequential parameters are normally stripped of their leading and trailing spaces by default – this however depends on the caller, and if the current template is being called by a module it is in theory possible in specific conditions for named parameters to retain their leading and trailing spaces (namely in non-sequential numericalnumeric parameters).
 
Using <code>trimming_values</code> makes this module behave like many Wikipedia modules behave. For example, if we wanted to emulate {{ml|Separated entries|main}}, writing
Line 1,737 ⟶ 1,806:
If the ''call style flag'' or (if omitted) the ''template name'' is followed by one or more groups of three arguments led by the <code>let</code> keyword (i.e. <code>let&#124;name&#124;value</code>), these will be passed to the mapping template.
 
If the last group of three arguments or (if omitted) the ''call style flag'' or (if omitted) the ''template name'' is followed by a number, this will be parsed as the amount of positional parameters to add. These will always follow the parameter's name and value if any of the latter has a numericalnumeric name greater than zero.
 
In case of collisions, the parameters assigned via the <code>let</code> keyword will be given precedence over everything else.
Line 1,823 ⟶ 1,892:
If the ''call style flag'' or (if omitted) the ''function name'' is followed by one or more groups of three arguments led by the <code>let</code> keyword (i.e. <code>let&#124;name&#124;value</code>), these will be passed to the mapping module function.
 
If the last group of three arguments or (if omitted) the ''call style flag'' or (if omitted) the ''function name'' is followed by a number, this will be parsed as the amount of positional parameters to add. These will always follow the parameter's name and value if any of the latter has a numericalnumeric name greater than zero.
 
In case of collisions, the arguments assigned via the <code>let</code> keyword will be given precedence over everything else.
Line 1,866 ⟶ 1,935:
If the ''call style flag'' or (if omitted) the ''template name'' is followed by one or more groups of three arguments led by the <code>let</code> keyword (i.e. <code>let&#124;name&#124;value</code>), these will be passed to the parser function.
 
If the last group of three arguments or (if omitted) the ''call style flag'' or (if omitted) the ''template name'' is followed by a number, this will be parsed as the amount of positional arguments to add. These will always follow the parameter's name and value if any of the latter has a numericalnumeric name greater than zero.
 
In case of collisions, the arguments assigned via the <code>let</code> keyword will be given precedence over everything else.
Line 2,060 ⟶ 2,129:
 
; Brief
: ''Group the parameters that have the same numericalnumeric suffix into novel parameters, whose names will be numbers and whose values will be decided by a custom template''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|grouping_by_calling|template name|[let]|[...]|[number of additional arguments]|[argument 1]|[argument 2]|[...]|[argument N]|pipe function name}}</syntaxhighlight>
 
This is the piping version of <code>[[#call_for_each_group|call_for_each_group]]</code>. This means that after calling this modifier the old parameters will be (temporarily) gone and the only parameters left will be novel parameters whose names will be numbers (or an empty string if parameters without a numericalnumeric suffix were present) and whose content will be decided by a custom template.
 
Like other modifiers in the <code>mapping_*</code> and <code>renaming_*</code> family, it is possible to impose own parameters on the callback template by using the syntax <code>...|[let]|[...]|[number of additional arguments]|[argument 1]|[argument 2]|[...]|[argument N]|...</code>. Unlike the other <code>mapping_*</code> and <code>renaming_*</code> modifiers, however (but like <code>[[#call_for_each_group|call_for_each_group]]</code>), sequential parameters here will not be prepended, but will ''replace'' possible parsed parameters.
Line 2,228 ⟶ 2,297:
imposing|hello|world|
entering_substack|<!-- Enter into a substack (the `snapshotting` modifier will be automatically invoked for us) -->
with_name_not_matching|^%-?%d+$excluding_numeric_names|<!-- Exclude numericalnumeric parameters -->
detaching_substack|<!-- Remove the current parameters from the parent stack -->
renaming_by_replacing|^.*$|This was called “%0”|1|<!-- Rename all parameters -->
Line 2,248 ⟶ 2,317:
imposing|hello|world|
entering_substack|<!-- Enter into a substack (the `snapshotting` modifier will be automatically invoked for us) -->
with_name_not_matching|^%-?%d+$excluding_numeric_names|<!-- Exclude numericalnumeric parameters -->
detaching_substack|<!-- Remove the current parameters from the parent stack -->
renaming_by_replacing|^.*$|This was called “%0”|1|<!-- Rename all parameters -->