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
(update transclusion count)
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 thea valuesingle of the argumentvalue. This functionvalue is calledwhat everyyou timewill anget argumentwhen isyou access the field requested<code>key</code> fromin the <code>args</code> table.
 
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 ===
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu