Difference between revisions of "Template:Template Parameter"

m (Progressing.)
m
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
+
<noinclude>{{Template Overview
{{tocright}}
+
|usedon=template
 
+
|purpose=explain a parameter's function and usage
[[Template:Parameter Explanation]] is designed for use on template pages to explain each parameter's function and usage.
+
|template=<nowiki>{{Template Parameter
 
+
==Full Template==
+
<pre>
+
{{Parameter Explanation
+
 
|name=
 
|name=
 
|usage=
 
|usage=
Line 13: Line 9:
 
|generates=
 
|generates=
 
|defaultvalue=
 
|defaultvalue=
 +
|anonymous=
 
|othernotes=
 
|othernotes=
 
|validvalues=
 
|validvalues=
 +
}}</nowiki>
 +
|category=Information
 +
}}
 +
{{Template Parameter
 +
|name=name
 +
|usage=mandatory
 +
|takes=a string
 +
|denotes=the name of the parameter
 +
|generates=the parameter's section header, as well as to display the parameter's name in the description
 +
|validvalues=Any string.
 +
}}
 +
{{Template Parameter
 +
|name=usage
 +
|takes=a string
 +
|denotes=whether the use of the parameter is mandatory or optional
 +
|generates=the "Usage" bullet point
 +
|defaultvalue=Optional
 +
|othernotes=The value of "Optional" will also be displayed if a value is supplied that is not "mandatory."
 +
|validvalues="mandatory"
 +
}}
 +
{{Template Parameter
 +
|name=takes
 +
|usage=mandatory
 +
|takes=a string or strings
 +
|denotes=what type of values the parameter takes in
 +
|generates=the middle of the first sentence in the parameter's "Description" bullet point
 +
|validvalues=Any string or strings.
 +
}}
 +
{{Template Parameter
 +
|name=denotes
 +
|usage=mandatory
 +
|takes=a string or strings
 +
|denotes=what the value passed to the parameter corresponds to
 +
|generates=the end of the first sentence in the parameter's "Description" bullet point
 +
|validvalues=Any string or strings.
 +
}}
 +
{{Template Parameter
 +
|name=generates
 +
|usage=mandatory
 +
|takes=a string or strings
 +
|denotes=what the parameter's data is used for
 +
|generates=the second sentence in the parameter's "Description" bullet point
 +
|validvalues=Any string or strings.
 +
}}
 +
{{Template Parameter
 +
|name=defaultvalue
 +
|takes=a string or strings
 +
|denotes=what will be displayed if a parameter that has a default value is left blank or omitted
 +
|generates=a sentence reading "If this parameter is left blank or omitted, a default value of {{Monospace|defaultvalue}} is displayed." after the sentence generated by {{Monospace|generates}}
 +
|validvalues=Any string or strings.
 +
}}
 +
{{Template Parameter
 +
|name=anonymous
 +
|takes=the value "true"
 +
|denotes=that the only parameter in the template is an anonymous numbered parameter
 +
|generates=a sentence indicating this fact
 +
|validvalues="true"
 +
}}
 +
{{Template Parameter
 +
|name=othernotes
 +
|takes=a string or strings
 +
|denotes=any other relevant information about the parameter
 +
|generates=a sentence or sentences at the end of the "Description" bullet point
 +
|validvalues=Any string or strings.
 +
}}
 +
{{Template Parameter
 +
|name=validvalues
 +
|usage=mandatory
 +
|takes=a string or strings
 +
|denotes=any and all values that are valid to be passed to the parameter
 +
|generates=the "Valid Value(s)" bullet point
 +
|validvalues=Any string or strings.
 
}}
 
}}
</pre>
 
 
==Parameters==
 
 
===name===
 
* '''Usage:''' {{#ifeq:  | optional | Optional | Mandatory}}
 
* '''Description:''' The <span style="font-family:monospace;">name</span> parameter takes a string denoting the name of the parameter. This is used to generate the parameter's section header, as well as to display the parameter's name in the description. {{#if:  | If this parameter is left blank or omitted, a default value of "{{{defaultvalue}}}" is displayed. | }} {{#if:  | {{{othernotes}}} | }}
 
* '''Valid Value(s):''' Any string.
 
 
 
===usage===
 
* '''Usage:''' {{#ifeq:  | optional | Optional | Mandatory}}
 
* '''Description:''' The <span style="font-family:monospace;">usage</span> parameter takes a string denoting whether the use of the parameter is Mandatory or Optional. This is used to generate the "Usage" bullet point. {{#if: Optional | If this parameter is left blank or omitted, a default value of "Optional" is displayed. | }} {{#if:  | {{{othernotes}}} | }}
 
* '''Valid Value(s):''' "mandatory"
 
 
 
===takes===
 
* '''Usage:''' {{#ifeq:  | optional | Optional | Mandatory}}
 
* '''Description:''' The <span style="font-family:monospace;">takes</span> parameter takes a string or strings denoting what type of values the parameter takes in. This is used to generate the middle of the first sentence in the parameter's "Description" bullet point. {{#if:  | If this parameter is left blank or omitted, a default value of "{{{defaultvalue}}}" is displayed. | }} {{#if:  | {{{othernotes}}} | }}
 
* '''Valid Value(s):''' Any string or strings.
 
 
 
===denotes===
 
* '''Usage:''' {{#ifeq:  | optional | Optional | Mandatory}}
 
* '''Description:''' The <span style="font-family:monospace;">denotes</span> parameter takes a string or strings denoting what the value passed to the parameter corresponds to. This is used to generate the end of the first sentence in the parameter's "Description" bullet point. {{#if:  | If this parameter is left blank or omitted, a default value of "{{{defaultvalue}}}" is displayed. | }} {{#if:  | {{{othernotes}}} | }}
 
* '''Valid Value(s):''' Any string or strings.
 
 
 
===generates===
 
* '''Usage:''' {{#ifeq:  | optional | Optional | Mandatory}}
 
* '''Description:''' The <span style="font-family:monospace;">generates</span> parameter takes a string or strings denoting what the parameter's data is used for. This is used to generate the second sentence in the parameter's "Description" bullet point. {{#if:  | If this parameter is left blank or omitted, a default value of "{{{defaultvalue}}}" is displayed. | }} {{#if:  | {{{othernotes}}} | }}
 
* '''Valid Value(s):''' Any string or strings.
 
 
</noinclude><includeonly>==={{{name}}}===
 
</noinclude><includeonly>==={{{name}}}===
* '''Usage:'''
+
* '''Usage:''' {{#ifeq: {{{usage|}}} | mandatory | Mandatory | Optional}}
* '''Description:''' The <span style="font-family:monospace;">{{{name}}}</span> parameter takes {{{takes}}} denoting {{{denotes}}}. This is used to generate {{{generates}}}. {{#if: {{{defaultvalue|}}} | If this parameter is left blank or omitted, a default value of "{{{defaultvalue}}}" is displayed. | }} {{#if: {{{othernotes|}}} | {{{othernotes}}} | }}
+
* '''Description:''' The {{Monospace|{{{name}}}}} parameter takes {{{takes}}} denoting {{{denotes}}}. This is used to generate {{{generates}}}. {{#if: {{{defaultvalue|}}} | If this parameter is left blank or omitted, a default value of "{{{defaultvalue}}}" is used. | }} {{#if: {{{anonymous|}}} | {{#ifeq: {{{anonymous}}} | true | This parameter, the template's only one, is an anonymous parameter, which means that no parameter name needs to be explicitly specified when using [[{{FULLPAGENAME}}]]. }} }} {{#if: {{{othernotes|}}} | {{{othernotes}}} }}
 
* '''Valid Value(s):''' {{{validvalues}}}</includeonly>
 
* '''Valid Value(s):''' {{{validvalues}}}</includeonly>

Latest revision as of 14:29, 19 December 2011

Template:Template Parameter is designed for use on template pages to explain a parameter's function and usage.

Template

{{Template Parameter
|name=
|usage=
|takes=
|denotes=
|generates=
|defaultvalue=
|anonymous=
|othernotes=
|validvalues=
}}

Parameters

name

  • Usage: Mandatory
  • Description: The name parameter takes a string denoting the name of the parameter. This is used to generate the parameter's section header, as well as to display the parameter's name in the description.
  • Valid Value(s): Any string.

usage

  • Usage: Optional
  • Description: The usage parameter takes a string denoting whether the use of the parameter is mandatory or optional. This is used to generate the "Usage" bullet point. If this parameter is left blank or omitted, a default value of "Optional" is used. The value of "Optional" will also be displayed if a value is supplied that is not "mandatory."
  • Valid Value(s): "mandatory"

takes

  • Usage: Mandatory
  • Description: The takes parameter takes a string or strings denoting what type of values the parameter takes in. This is used to generate the middle of the first sentence in the parameter's "Description" bullet point.
  • Valid Value(s): Any string or strings.

denotes

  • Usage: Mandatory
  • Description: The denotes parameter takes a string or strings denoting what the value passed to the parameter corresponds to. This is used to generate the end of the first sentence in the parameter's "Description" bullet point.
  • Valid Value(s): Any string or strings.

generates

  • Usage: Mandatory
  • Description: The generates parameter takes a string or strings denoting what the parameter's data is used for. This is used to generate the second sentence in the parameter's "Description" bullet point.
  • Valid Value(s): Any string or strings.

defaultvalue

  • Usage: Optional
  • Description: The defaultvalue parameter takes a string or strings denoting what will be displayed if a parameter that has a default value is left blank or omitted. This is used to generate a sentence reading "If this parameter is left blank or omitted, a default value of defaultvalue is displayed." after the sentence generated by generates.
  • Valid Value(s): Any string or strings.

anonymous

  • Usage: Optional
  • Description: The anonymous parameter takes the value "true" denoting that the only parameter in the template is an anonymous numbered parameter. This is used to generate a sentence indicating this fact.
  • Valid Value(s): "true"

othernotes

  • Usage: Optional
  • Description: The othernotes parameter takes a string or strings denoting any other relevant information about the parameter. This is used to generate a sentence or sentences at the end of the "Description" bullet point.
  • Valid Value(s): Any string or strings.

validvalues

  • Usage: Mandatory
  • Description: The validvalues parameter takes a string or strings denoting any and all values that are valid to be passed to the parameter. This is used to generate the "Valid Value(s)" bullet point.
  • Valid Value(s): Any string or strings.