Template:Par2b
Raffriff42 (Talk | contribs) m (notes) |
Raffriff42 (Talk | contribs) m (notes) |
||
Line 9: | Line 9: | ||
---- | ---- | ||
− | Variant of [[:Template:Par2]] for testing | + | Variant of [[:Template:Par2]] for testing. Test page here: [[User:Raffriff42/sandbox]]. |
− | Would like to use conditional test for presence of argument {{{3}}} | + | Would ''like'' to use a conditional test for the presence of argument {{{3}}}, to hide "default ..." when there IS no default. See "intended sample output" below. |
<br><tt><nowiki> | <br><tt><nowiki> | ||
{{#if:{{{3|}}}| (default '''{{{3}}}''')|}} | {{#if:{{{3|}}}| (default '''{{{3}}}''')|}} | ||
</nowiki></tt> | </nowiki></tt> | ||
<br><br> | <br><br> | ||
− | |||
− | + | This code '''DOES NOT WORK '''due to lack of mediawiki [http://www.mediawiki.org/wiki/Extension:ParserFunctions Extension:ParserFunctions] | |
+ | Even if the extension ''were'' installed, this code would not work if template parameter {{{3}}} is not empty, but ' ' (space) ...'''which it is, on many, many pages'''. | ||
+ | |||
+ | So, we might as well create two templates - something like <tt><nowiki>{{Par2d|...}}</nowiki></tt> (with "default...") and <tt><nowiki>{{Par2n|...}}</nowiki></tt> (no default). Would require editing almost every filter page - but the edits would be quick & easy. | ||
+ | |||
+ | [[User:Raffriff42|Raffriff42]] 05:16, 26 December 2015 (CET) | ||
Line 31: | Line 35: | ||
<br> | <br> | ||
<br> | <br> | ||
− | :<span {{Template:Style_FuncDef_Inline2}}> | + | :''clip ''<span {{Template:Style_FuncDef_Inline2}}></span><br/> |
::Input clip | ::Input clip | ||
<br> | <br> | ||
Line 47: | Line 51: | ||
<br> | <br> | ||
− | [[Category:Filter_templates]]</noinclude> | + | [[Category:Filter_templates]][[Category:Talk]]</noinclude> |
Revision as of 05:16, 26 December 2015
(default none)
Variant of Template:Par2 for testing. Test page here: User:Raffriff42/sandbox.
Would like to use a conditional test for the presence of argument {{{3}}}, to hide "default ..." when there IS no default. See "intended sample output" below.
{{#if:{{{3|}}}| (default '''{{{3}}}''')|}}
This code DOES NOT WORK due to lack of mediawiki Extension:ParserFunctions
Even if the extension were installed, this code would not work if template parameter {{{3}}} is not empty, but ' ' (space) ...which it is, on many, many pages.
So, we might as well create two templates - something like {{Par2d|...}} (with "default...") and {{Par2n|...}} (no default). Would require editing almost every filter page - but the edits would be quick & easy.
Raffriff42 05:16, 26 December 2015 (CET)
...intended sample output:
Foo(clip [, float gain_y] [, int size] [, boolean autogain] [, string file])
- clip
- Input clip
- float gain_y (default 2)
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas eros nulla, fringilla fringilla diam id, luctus dapibus nibh.
- int size (default 24)
- Cras in mauris ac eros mollis pellentesque non non metus. Proin vitae mauris tempor, tristique sem vitae, suscipit ante.
- bool autogain (default false)
- Integer mattis purus id fringilla malesuada. Cras justo sapien, tincidunt vel pharetra id, cursus at quam.
- string pixel_type (default "RGB32")
- Vivamus ipsum augue, rutrum eu nunc consectetur, rutrum sagittis neque. Sed erat ligula, ultricies id quam eleifend, maximus lacinia erat.