Template:Par2b

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (remove conditional)
m (notes)
 
Line 39: Line 39:
  
 
[[User:Raffriff42|Raffriff42]] 05:16, 26 December 2015 (CET)
 
[[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&nbsp;&nbsp;''<span {{Template:Style_FuncDef_Inline2}}></span> = '' ''<br>
 +
:''int&nbsp;&nbsp;''<span {{Template:Style_FuncDef_Inline2}}>size</span> = ''24 ''<br>
 +
</div>
 +
:[[User:Raffriff42|Raffriff42]] 14:55, 26 December 2015 (CET)
  
  

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.


Personal tools