Difference between revisions of "Template:Option"

From VideoLAN Wiki
Jump to navigation Jump to search
(Done testing. Works well enough for now. Now it links to valid definitions. For example on Documentation:Modules/image, string (valid page) is linked but png, jpeg (invalid page) is not)
m (Insert space, hex entity)
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
* '''{{{name}}} {{#if:{{{value|}}}|{{#ifexist:{{{value|}}}|<[[{{{value}}}]]>|<{{{value|}}}>|}}|}} ''': {{{description}}}. {{#if:{{{default|}}}|''default value: {{{default}}}''|}}<noinclude>
+
* '''{{{name}}}{{#if:{{{alias|}}}<!--
----
+
              -->|{{#if:{{{alias2|}}}<!--
Syntax: <nowiki>{{Option | name=<foo> | value=<bar> | description=<baz> | default=<quux>}}</nowiki>
+
                -->|''', '''{{{alias}}}''' or '''{{{alias2}}}'''<!--
 +
              -->}}<!--
 +
              -->''' or '''{{{alias}}}'''<!--
 +
            -->}} {{#if:{{{value|}}}<!--
 +
                -->|<{{#switch:{{{value}}}
 +
                        |boolean  = [[boolean]]
 +
                        |float    = [[float]]
 +
                        |integer  = [[integer]]
 +
                        |string  = [[string]]
 +
                        |#default = {{{value}}}
 +
                      }}{{#if:{{{select|}}}<!--
 +
                      -->|> <span style="overflow-wrap:break-word;">{{{select}}}</span><!--
 +
                      -->|{{#if:{{{min|}}}<!--
 +
                          -->|{{#if:{{{max|}}}<!--
 +
                            -->|&#x20;&#x5B;{{{min}}} .. {{{max}}}&#x5D;<!--
 +
                          -->}}<!--
 +
                        -->}}><!--
 +
                    -->}}<!--
 +
                -->|{{{select|}}}<!--
 +
              -->}} ''': {{{description<includeonly>|?</includeonly>}}}{{#if:{{{default|}}}<!--
 +
                                                                      -->|&#x20;''default value: {{{default}}}''<!--
 +
                                                                    -->}}<noinclude>
  
* ''name'' and ''description'' are required.
+
Usage:
* ''value'' and ''default'' will be omitted if not specified.</noinclude>
+
* name (required)
 +
** alias (optional): an alias for the name
 +
** alias2 (optional): a second alias for the name
 +
* value (optional)
 +
** min (optional)
 +
** max (optional)
 +
* select (optional): takes precedence over <code>min</code> and <code>max</code>. <code>{}</code> will not be provided if not given (to avoid doubling). Use as e.g. <code>{png,jpg,tiff}</code> for documentation of options for <code>--snapshot-format</code>
 +
* description (required)
 +
* default (optional)
 +
 
 +
min and max are only shown if both of them are specified, because no range should be given unbounded (if you think that is stupid, change it!)
 +
 
 +
[[Category:Templates]]
 +
</noinclude>

Latest revision as of 07:32, 22 May 2019

  • {{{name}}} : {{{description}}}

Usage:

  • name (required)
    • alias (optional): an alias for the name
    • alias2 (optional): a second alias for the name
  • value (optional)
    • min (optional)
    • max (optional)
  • select (optional): takes precedence over min and max. {} will not be provided if not given (to avoid doubling). Use as e.g. {png,jpg,tiff} for documentation of options for --snapshot-format
  • description (required)
  • default (optional)

min and max are only shown if both of them are specified, because no range should be given unbounded (if you think that is stupid, change it!)