Difference between revisions of "Module:IncrementParams/doc"
Jump to navigation
Jump to search
blackwiki>Mr. Stradivarius (create) |
m (4 revisions imported) |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{module rating|alpha}} | {{module rating|alpha}} | ||
| − | This module | + | This module increments numbered template parameters. This is useful for inserting new rows into infobox templates, and for other similar tasks where renaming many parameters by hand would be tedious. |
== Usage == | == Usage == | ||
| − | Due to the way templates work, this module | + | Due to the way templates work, you cannot pass template input to this module in the normal way. Instead, you have to edit the module page directly to get the desired result. Please follow the seven steps listed in the module code. |
| − | Once you have finished editing the module, you can use it on any page with the code: | + | Once you have finished editing the module, you can use it on any page, with the code: |
<pre>{{subst:#invoke:IncrementParams|main}}</pre> | <pre>{{subst:#invoke:IncrementParams|main}}</pre> | ||
| − | Or you can copy and paste the code from the following section. | + | You can also view it as pre-formatted text using the <code>pre</code> parameter. Warning - this doesn't work with [[WP:SUBST|subst]]. |
| + | <pre>{{#invoke:IncrementParams|main|pre=yes}}</pre> | ||
| + | |||
| + | Or you can simply copy and paste the code from the following section. | ||
== Output == | == Output == | ||
| Line 16: | Line 19: | ||
The module currently outputs the following text: | The module currently outputs the following text: | ||
| − | + | {{#invoke:IncrementParams|main|pre=yes}} | |
| − | {{#invoke:IncrementParams|main | ||
| − | }} | ||
== See also == | == See also == | ||
Latest revision as of 05:27, 27 September 2020
| This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
This module increments numbered template parameters. This is useful for inserting new rows into infobox templates, and for other similar tasks where renaming many parameters by hand would be tedious.
Usage
Due to the way templates work, you cannot pass template input to this module in the normal way. Instead, you have to edit the module page directly to get the desired result. Please follow the seven steps listed in the module code.
Once you have finished editing the module, you can use it on any page, with the code:
{{subst:#invoke:IncrementParams|main}}
You can also view it as pre-formatted text using the pre parameter. Warning - this doesn't work with subst.
{{#invoke:IncrementParams|main|pre=yes}}
Or you can simply copy and paste the code from the following section.
Output
The module currently outputs the following text:
|header4 = Section 1 |label6 = Label A |data6 = Data A |label8 = Label C |data8 = Data C |header11 = Section 2 |label13 = Label D |data13 = Data D