Anonymous user
Module:Arguments/doc: Difference between revisions
From Mariopedia, a wiki on Mario, Yoshi, Wario, Donkey Kong, Super Smash Bros., and more!
Jump to navigationJump to search
→Custom formatting of arguments: clearer wording
(update transclusion count) |
(→Custom formatting of arguments: clearer wording) |
||
Line 112:
=== Custom formatting of arguments ===
Sometimes you want to remove some blank arguments but not others, or perhaps you might want to put all of the positional arguments in lower case. To do things like this you can use the <code>valueFunc</code> option. The input to this option must be a function that takes two parameters, <code>key</code> and <code>value</code>, and returns
Example 1: this function preserves whitespace for the first positional argument, but trims all other arguments and removes all other blank arguments.
Line 179:
</source>
{{cob}}
Also, please note that the <code>valueFunc</code> function is called more or less every time an argument is requested from the <code>args</code> table, so if you care about performance you should make sure you aren't doing anything inefficient with your code.
=== Frames and parent frames ===
|