Template talk:Evaldemo
Latest comment: 16 years ago by לערי ריינהארט in topic replacing DIRMARK with DIRECTIONMARK
- This is the talk page for
{{Evaldemo}}
and{{Evaldemo/3}}
Documentation
editFor 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.
What gives
editThe 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.
See also
edit- template:Evaldemo (edit•talk•links•history)
- template:Evaldemo/3 (edit•talk•links•history) (allows parameters)
- Template:Xpdn (nested expression)
- Template:Xpd (allows parameters, successor)
- template:Tlx (edit•talk•links•history), a similar idea for ordinary templates
Discussion
edit- Add issues below as you see fit, sign with ~~~~
replacing DIRMARK with DIRECTIONMARK
editPlease 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)