Content deleted Content added
Update the documentation |
Prepare the documentation for the ‘new’ modifier – currently commented out in the code |
||
Line 2,013:
{{vpad|1.5em|clear=none}}
<!--
=== <code>new</code> ===
{{Infobox|headerstyle=background:lavender
| titlestyle = font-weight:normal; font-size:100%;
| title = Modifier <code>new</code> <span style="nowrap">({{module:params/doc/link to the code|new|code}})</span>
| label1 = Num. of arguments | data1 = 0
| label2 = Repeatable | data2 = No
| label3 = Restrictions | data3 = First position only
| header4 = See also
| data5 = <code>[[#imposing|imposing]]</code>, <code>[[#providing|providing]]</code>, <code>[[#inserting|inserting]]</code>, <code>[[#discarding|discarding]]</code>
}}
; Brief
: ''(FIRST POSITION ONLY) Get rid of all the incoming parameters and create a new (empty) parameter stack''
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|new|pipe function name}}</syntaxhighlight>
This modifier can only appear once in first position. Its main purpose is that of extending the facilities offered by this module (e.g. <code>[[#mapping_by_replacing|mapping_by_replacing]]</code>, <code>[[#with_value_matching|with_value_matching]]</code>, etc.) to custom lists of strings, independently of the incoming parameters. Its presence also facilitates the debug of the module.
The newly created parameter stack can be populated via <code>[[#inserting|inserting]]</code>, <code>[[#imposing|imposing]]</code> or <code>[[#providing|providing]]</code>.
Examples:
* <syntaxhighlight lang="wikitext" inline>{{#invoke:params|new|imposing|1|foo|imposing|2|bar|mapping_by_replacing|^.|!%1|list_values}}</syntaxhighlight>
*: ↳ {{#invoke:params|new|imposing|1|foo|imposing|2|bar|mapping_by_replacing|^.|!%1|list_values}}
{{vpad|1.5em|clear=none}}
-->
== Subpages ==
* [[Module:Params/ChangeLog]] – Record of the most important changes in the module's code
|