Template:Par2b
Raffriff42 (Talk | contribs) m (notes) |
Raffriff42 (Talk | contribs) m (remove conditional) |
||
Line 1: | Line 1: | ||
− | ''{{{2|}}} ''<span {{Template:Style_FuncDef_Inline2}}>{{{1|}}}</span> | + | ''{{{2|}}} ''<span {{Template:Style_FuncDef_Inline2}}>{{{1|}}}</span> = ''{{{3|}}} ''<br/><noinclude> |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
---- | ---- | ||
+ | '''Usage:'''<br><tt><nowiki> | ||
+ | {{</nowiki>Par2b|''name''|''type''|''default''}} | ||
+ | |||
+ | </tt> | ||
+ | |||
+ | |||
+ | '''Code:'''<br><tt><nowiki> | ||
+ | ''{{{2|}}} ''<span {{Template:Style_FuncDef_Inline2}}>{{{1|}}}</span> = ''{{{3|}}} '' | ||
+ | </nowiki></tt> | ||
+ | |||
+ | |||
+ | '''Code, Previous versions:'''<br><tt><nowiki> | ||
+ | ''{{{2|}}} ''<span {{Template:Style_FuncDef_Inline2}}>{{{1|}}}</span> {{#if:{{{3|}}}| (default '''{{{3}}}''')|}} | ||
+ | |||
+ | ''{{{2|}}} ''<span {{Template:Style_FuncDef_Inline2}}>{{{1|}}}</span> (default''' {{{3|none}}}''') | ||
+ | |||
+ | </nowiki></tt> | ||
+ | |||
+ | |||
+ | '''Description:''' | ||
Variant of [[:Template:Par2]] for testing. Test page here: [[User:Raffriff42/sandbox]]. | Variant of [[:Template:Par2]] for testing. Test page here: [[User:Raffriff42/sandbox]]. | ||
Line 29: | Line 43: | ||
---- | ---- | ||
− | ...intended sample output: | + | '''...intended sample output:''' |
Line 35: | Line 49: | ||
<br> | <br> | ||
<br> | <br> | ||
− | :''clip ''<span {{Template:Style_FuncDef_Inline2}}></span><br/> | + | :''clip ''<span {{Template:Style_FuncDef_Inline2}}></span> = '' ''<br/> |
::Input clip | ::Input clip | ||
<br> | <br> | ||
− | :''float ''<span {{Template:Style_FuncDef_Inline2}}>gain_y</span> | + | :''float ''<span {{Template:Style_FuncDef_Inline2}}>gain_y</span> = ''2''<br/> |
::Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas eros nulla, fringilla fringilla diam id, luctus dapibus nibh. | ::Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas eros nulla, fringilla fringilla diam id, luctus dapibus nibh. | ||
<br> | <br> | ||
− | :''int ''<span {{Template:Style_FuncDef_Inline2}}>size</span> | + | :''int ''<span {{Template:Style_FuncDef_Inline2}}>size</span> = 24<br/> |
::Cras in mauris ac eros mollis pellentesque non non metus. Proin vitae mauris tempor, tristique sem vitae, suscipit ante. | ::Cras in mauris ac eros mollis pellentesque non non metus. Proin vitae mauris tempor, tristique sem vitae, suscipit ante. | ||
<br> | <br> | ||
− | :''bool ''<span {{Template:Style_FuncDef_Inline2}}>autogain </span> | + | :''bool ''<span {{Template:Style_FuncDef_Inline2}}>autogain </span> = ''false''<br/> |
::Integer mattis purus id fringilla malesuada. Cras justo sapien, tincidunt vel pharetra id, cursus at quam. | ::Integer mattis purus id fringilla malesuada. Cras justo sapien, tincidunt vel pharetra id, cursus at quam. | ||
<br> | <br> | ||
− | :''string ''<span {{Template:Style_FuncDef_Inline2}}>pixel_type</span> | + | :''string ''<span {{Template:Style_FuncDef_Inline2}}>pixel_type</span> = ''"RGB32"''<br/> |
::Vivamus ipsum augue, rutrum eu nunc consectetur, rutrum sagittis neque. Sed erat ligula, ultricies id quam eleifend, maximus lacinia erat. | ::Vivamus ipsum augue, rutrum eu nunc consectetur, rutrum sagittis neque. Sed erat ligula, ultricies id quam eleifend, maximus lacinia erat. | ||
<br> | <br> | ||
[[Category:Filter_templates]][[Category:Talk]]</noinclude> | [[Category:Filter_templates]][[Category:Talk]]</noinclude> |
Revision as of 14:18, 26 December 2015
=
Usage:
{{Par2b|name|type|default}}
Code:
''{{{2|}}} ''<span {{Template:Style_FuncDef_Inline2}}>{{{1|}}}</span> = ''{{{3|}}} ''
Code, Previous versions:
''{{{2|}}} ''<span {{Template:Style_FuncDef_Inline2}}>{{{1|}}}</span> {{#if:{{{3|}}}| (default '''{{{3}}}''')|}}
''{{{2|}}} ''<span {{Template:Style_FuncDef_Inline2}}>{{{1|}}}</span> (default''' {{{3|none}}}''')
Description:
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 = 2
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas eros nulla, fringilla fringilla diam id, luctus dapibus nibh.
- int size = 24
- Cras in mauris ac eros mollis pellentesque non non metus. Proin vitae mauris tempor, tristique sem vitae, suscipit ante.
- bool autogain = false
- Integer mattis purus id fringilla malesuada. Cras justo sapien, tincidunt vel pharetra id, cursus at quam.
- string pixel_type = "RGB32"
- Vivamus ipsum augue, rutrum eu nunc consectetur, rutrum sagittis neque. Sed erat ligula, ultricies id quam eleifend, maximus lacinia erat.