A lot more updates

This commit is contained in:
Garen Torikian
2015-03-20 16:51:51 -07:00
parent 99db066e2a
commit 1aeb8a3305
10 changed files with 62 additions and 0 deletions

View File

@@ -1,3 +1,11 @@
---
title: map
---
Collects an array of properties from a hash.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ product | map: 'tag' }}`{% endraw %} | `["sale", "mens", "womens", "awesome"]` |
In the sample above, assume that `product` resolves to: `[{ tags: "sale"}, { tags: "mens"}, { tags: "womens"}, { tags: "awesome"}]`.

View File

@@ -1,3 +1,9 @@
---
title: minus
---
Subtracts two numbers.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ 100 | minus: 10 }}`{% endraw %} | `90` |

View File

@@ -1,3 +1,9 @@
---
title: modulo
---
Performs a modulo operation (eg., fetches the remainder).
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ 2 | modulo: 2 }}`{% endraw %} | `1` |

View File

@@ -1,3 +1,9 @@
---
title: newline_to_br
---
Replace every newline (`n`) with an HTML break (`<br>`).
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ "hello\nthere" | newline_to_br }}`{% endraw %} | `hello<br/>there` |

View File

@@ -1,3 +1,9 @@
---
title: plus
---
Adds two numbers.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ 100 | plus: 10 }}`{% endraw %} | `110` |

View File

@@ -1,3 +1,9 @@
---
title: prepend
---
Prepends a string onto another.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ 'world' | prepend: 'hello ' }}`{% endraw %} | `hello world` |

View File

@@ -1,3 +1,9 @@
---
title: remove
---
Removes every occurrence of a given string.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ 'hello, hello world' | remove: 'hello' }}`{% endraw %} | `, world` |

View File

@@ -1,3 +1,9 @@
---
title: remove_first
---
Removes the first occurrence of a given string.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ 'hello, hello world' | remove_first: 'hello' }}`{% endraw %} | `, hello world` |

View File

@@ -1,3 +1,9 @@
---
title: replace
---
Replaces every occurrence of a given string.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ 'hello, hello world' | replace: 'hello', 'goodbye' }}`{% endraw %} | `goodbye, goodbye world` |

View File

@@ -1,3 +1,9 @@
---
title: replace_first
---
Replaces the first occurrence of a given string.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ 'hello, hello world' | replace_first: 'hello', 'goodbye' }}`{% endraw %} | `goodbye, hello world` |