Template talk:Evaldemo
From Meta
- This is the talk page for {{Evaldemo}} and {{Evaldemo/3}}
Contents |
[edit] Documentation
For examples see the template pages of evaldemo, evaldemo/3, evdn, and evd.
In theory {{evd}} is designed to replace all, in practice its code is not exactly trivial.
{{evaldemo}} and {{evdn}} support optional substitution.
[edit] What gives
The default separator " gives " is kind of annoying if you've seen it too often. It's simple to overwrite the word gives, but not its leading and trailing space:
- {{evaldemo|whatever|s=separator}},
- {{evdn|what|ever...|s=separator}},
- {{evaldemo/3|what|...ever|s=separator}}.
This allows some tricks:
- <small>{{evaldemo|#expr: 1234567890|s=</small>=}} rendered as
"{{#expr: 1234567890}}"gives "1234567890" [1]- Handy to squeeze very long expressions into a single line without folding.
- ;Expression {{evaldemo|#expr: 1234567890|s=gives:}} rendered as
-
- Expression
"{{#expr: 1234567890}}"gives "1234567890" [2]
- Expression
- Here semicolon and colon arranged the output as definition list.
-
- {{evaldemo|#expr: 1234567890|s==<b>}}</b> rendered as
"{{#expr: 1234567890}}"gives "1234567890" [3]- Be bold, <tt>, <b><tt>, <span style="color: red">, or whatever.
- {{evaldemo|#expr: 1/0|s== <font color="red"><em>}}</em></font>
"{{#expr: 1/0}}"gives "Expression error: Division by zero" [4]- Not recommended, but possible for hardcore backwards compatibility.
- {| border="1" cellpadding="5"
!code!!result
|-
|{{evaldemo|#expr: 123456789*10|s=</td><td>}}
|}
-
-
code result "{{#expr: 123456789*10}}"gives "1234567890" [5]
-
-
- Please note that Wiki markup including template:! (edit•talk•links•history) won't work as separator, use </td><td> to separate table cells as shown above.
[edit] See also
- template:Evaldemo (edit•talk•links•history)
- template:Evaldemo/3 (edit•talk•links•history) (allows parameters)
- template:xpdn ( talk edit history links ) (nested expression)
- template:xpd ( talk edit history links ) (allows parameters, successor)
- template:Tlx (edit•talk•links•history), a similar idea for ordinary templates
[edit] Discussion
- Add issues below as you see fit, sign with ~~~~
[edit] replacing DIRMARK with DIRECTIONMARK
Please remember that {{DIRECTIONMARK}} is the magic word and {{DIRMARK}} is an alias in MessagesEn.php. Please see the discussion at w:en:template talk:DIRMARK. Best regards
·לערי ריינהארט·Th·T·email me· 06:21, 16 February 2008 (UTC)

