tpl/math: Add log function

It might be very useful for building tag clouds.
This commit is contained in:
Artem Sidorenko
2017-07-03 00:20:49 +02:00
committed by Bjørn Erik Pedersen
parent 41805dca9e
commit 34c566773a
4 changed files with 64 additions and 1 deletions

View File

@@ -432,6 +432,12 @@ favicon.ico: {{.Width}} x {{.Height}}
<td><code>{{div 6 3}}</code> → 2</td>
</tr>
<tr>
<td><code>math.Log</code></td>
<td>Natural logarithm of one float.</td>
<td><code>{{math.Log 1.0}}</code> → 0</td>
</tr>
<tr>
<td><code>mod</code></td>
<td>Modulus of two integers.</td>
@@ -714,7 +720,7 @@ e.g.
* `{{ "this is a text" | truncate 10 " ..." }}``this is a ...`
* `{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}``<em>Keep my …</em>`
* `{{ "With [Markdown](#markdown) inside." | markdownify | truncate 10 }}``With <a href='#markdown'>Markdown …</a>`
* `{{ "With [Markdown](#markdown) inside." | markdownify | truncate 10 }}``With <a href='#markdown'>Markdown …</a>`
### split