Template talk:Evaldemo

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search
This is the talk page for {{Evaldemo}} and {{Evaldemo/3}}

Documentation[edit]

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.

What gives[edit]

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:

  1. {{evaldemo|whatever|s=separator}},
  2. {{evdn|what|ever...|s=separator}},
  3. {{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]
    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:! (edittalklinkshistory) won't work as separator, use </td><td> to separate table cells as shown above.

See also[edit]

Discussion[edit]

Add issues below as you see fit, sign with ~~~~

replacing DIRMARK with DIRECTIONMARK[edit]

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)