Difference between revisions of "Template:Variable"

From FreeCAD Documentation
Jump to: navigation, search
(Use padding in em, instead of fixed pixels.)
(The fourth argument is optional, to specify a modifier to the first type.)
 
Line 1: Line 1:
 
{{#if:{{{2|}}}
 
{{#if:{{{2|}}}
     |<span style="font-size:60%; padding-right:0.8em;">{{{2}}}</span>
+
     |<span style="font-size:60%; padding-right:0.8em;">{{{2}}}{{#if:{{{4|}}}
 +
                                                                  |<span style="font-style:italic;"> ({{{4}}})</span>
 +
                                                                  |}}</span>
 
     |}}'''{{{1}}}'''{{#if:{{{3|}}}
 
     |}}'''{{{1}}}'''{{#if:{{{3|}}}
                      |<span style="font-size:80%;"> ({{incode|{{{3}}}}})</span>
+
                        |<span style="font-size:80%;"> ({{incode|{{{3}}}}})</span>
                      |}}<noinclude>
+
                        |}}<noinclude>
  
 
----
 
----
Line 20: Line 22:
 
----
 
----
  
You can optionally also specify a type to be shown before the variable.
+
The second argument is optional, to specify a type to be shown before the variable.
  
 
Example:
 
Example:
Line 33: Line 35:
 
----
 
----
  
You can optionally also specify a second type to be shown after the variable.
+
The third argument is optional, to specify a second type to be shown after the variable.
  
 
  <nowiki>
 
  <nowiki>
Line 41: Line 43:
  
 
{{Variable|MyAttribute|Type|Type2}}: some variable.
 
{{Variable|MyAttribute|Type|Type2}}: some variable.
 +
 +
----
 +
 +
The fourth argument is optional, to specify a modifier to the first type.
 +
 +
<nowiki>
 +
{{Variable|MyAttribute|Type|Type2|Mod1}}: some variable.
 +
{{Variable|MyAttribute|Type||Mod1}}: some variable.</nowiki>
 +
 +
Result:
 +
 +
{{Variable|MyAttribute|Type|Type2|Mod1}}: some variable.
 +
 +
{{Variable|MyAttribute|Type||Mod1}}: some variable.
  
 
[[Category:Template:Text Format]]
 
[[Category:Template:Text Format]]
 
[[Category:Administration]]
 
[[Category:Administration]]
 
</noinclude>
 
</noinclude>

Latest revision as of 08:49, 18 January 2020

{{{1}}}


Use this template where you want to show a value or parameter.

Example:

{{Variable|MyAttribute}}: some variable.

Result:

MyAttribute: some variable.


The second argument is optional, to specify a type to be shown before the variable.

Example:

{{Variable|MyAttribute|Type}}: some variable.

Result:

TypeMyAttribute: some variable.


The third argument is optional, to specify a second type to be shown after the variable.

{{Variable|MyAttribute|Type|Type2}}: some variable.

Result:

TypeMyAttribute (Type2): some variable.


The fourth argument is optional, to specify a modifier to the first type.

{{Variable|MyAttribute|Type|Type2|Mod1}}: some variable.
{{Variable|MyAttribute|Type||Mod1}}: some variable.

Result:

Type (Mod1)MyAttribute (Type2): some variable.

Type (Mod1)MyAttribute: some variable.