Template:Par2b
Raffriff42 (Talk | contribs) m (typo) |
Raffriff42 (Talk | contribs) m (notes) |
||
(11 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | ''{{{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]]. | ||
+ | |||
+ | |||
+ | 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> | ||
+ | {{#if:{{{3|}}}| (default '''{{{3}}}''')|}} | ||
+ | </nowiki></tt> | ||
+ | <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) | ||
+ | |||
+ | :Scratch that suggestion; instead I propose adjusting [[:Template:Par2]], from | ||
+ | <div style="margin-left:24px;"> | ||
+ | :<span {{Template:Style_FuncDef_Inline2}}> </span> ''clip'' = '' '' <br> | ||
+ | :<span {{Template:Style_FuncDef_Inline2}}>size</span> ''int'' = ''24 ''<br> | ||
+ | to | ||
+ | :''clip ''<span {{Template:Style_FuncDef_Inline2}}></span> = '' ''<br> | ||
+ | :''int ''<span {{Template:Style_FuncDef_Inline2}}>size</span> = ''24 ''<br> | ||
+ | </div> | ||
+ | :[[User:Raffriff42|Raffriff42]] 14:55, 26 December 2015 (CET) | ||
---- | ---- | ||
− | + | '''...intended sample output:''' | |
Line 10: | Line 59: | ||
<br> | <br> | ||
<br> | <br> | ||
− | <span {{Template:Style_FuncDef_Inline2}}> | + | :''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}}> | + | :''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]]</noinclude> | + | [[Category:Filter_templates]][[Category:Talk]]</noinclude> |
Latest revision as of 14:55, 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)
- Scratch that suggestion; instead I propose adjusting Template:Par2, from
- clip =
- size int = 24
to
- clip =
- int size = 24
- Raffriff42 14:55, 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.