Difference between revisions of "Template:Variable"

From FreeCAD Documentation
Jump to navigation Jump to search
(The condition is more visible)
(The fourth argument is optional, to specify a modifier to the first type.)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{#if:{{{2|}}}
 
{{#if:{{{2|}}}
     |<span style="font-size: 0.6em; padding-right:10px;">{{{2}}}</span>
+
     |<span style="font-size:60%; padding-right:0.8em;">{{{2}}}{{#if:{{{4|}}}
     |}}'''{{{1}}}'''<noinclude>
+
                                                                  |<span style="font-style:italic;"> ({{{4}}})</span>
 +
                                                                  |}}</span>
 +
     |}}'''{{{1}}}'''{{#if:{{{3|}}}
 +
                        |<span style="font-size:80%;"> ({{incode|{{{3}}}}})</span>
 +
                        |}}<noinclude>
 +
 
 
----
 
----
  
Line 9: Line 14:
  
 
  <nowiki>
 
  <nowiki>
{{Variable|MyAttribute}}</nowiki>
+
{{Variable|MyAttribute}}: some variable.</nowiki>
  
 
Result:
 
Result:
  
{{Variable|MyAttribute}}
+
{{Variable|MyAttribute}}: some variable.
  
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:
  
 
  <nowiki>
 
  <nowiki>
{{Variable|MyAttribute|Type}}</nowiki>
+
{{Variable|MyAttribute|Type}}: some variable.</nowiki>
 +
 
 +
Result:
 +
 
 +
{{Variable|MyAttribute|Type}}: some variable.
 +
 
 +
----
 +
 
 +
The third argument is optional, to specify a second type to be shown after the variable.
 +
 
 +
<nowiki>
 +
{{Variable|MyAttribute|Type|Type2}}: some variable.</nowiki>
 +
 
 +
Result:
 +
 
 +
{{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:
 
Result:
  
{{Variable|MyAttribute|Type}}
+
{{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 07: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.