diff --git a/_filters/round.md b/_filters/round.md
index f449506..86c4301 100644
--- a/_filters/round.md
+++ b/_filters/round.md
@@ -1,3 +1,12 @@
---
title: round
---
+
+Rounds the output to the nearest integer or specified number of decimals.
+
+| Input | Output |
+|:-------------------------------------------|:-------|
+| {% raw %}`{{ 4.6 | round }}` {% endraw %} | 5 |
+| {% raw %}`{{ 4.3 | round }}` {% endraw %} | 4 |
+| {% raw %}`{{ 4.5612 | round: 2 }}` {% endraw %} | 4.56 |
+
diff --git a/_filters/slice.md b/_filters/slice.md
index e2d3ddf..3fb7628 100644
--- a/_filters/slice.md
+++ b/_filters/slice.md
@@ -1,3 +1,20 @@
---
title: slice
---
+
+The slice filter returns a substring, starting at the specified index. An optional second parameter can be passed to specify the length of the substring. If no second parameter is given, a substring of one character will be returned.
+
+
+| Input | Output |
+|:------------------------------------------------|:-------|
+| {% raw %}`{{ "hello" | slice: 0 }}`{% endraw %} | h |
+| {% raw %}`{{ "hello" | slice: 1 }}`{% endraw %} | e |
+| {% raw %}`{{ "hello" | slice: 1, 3 }}`{% endraw %} | ell |
+
+
+If the passed index is negative, it is counted from the end of the string.
+
+| Input | Output |
+|:------------------------------------------------|:-------|
+| {% raw %}`{{ "hello" | slice: -3, 2 }}`{% endraw %} | ll |
+
diff --git a/_filters/truncate.md b/_filters/truncate.md
index 29314aa..60b307e 100644
--- a/_filters/truncate.md
+++ b/_filters/truncate.md
@@ -1,3 +1,10 @@
---
title: truncate
---
+
+
+
Truncates a string down to 'x' characters, where x is the number passed as a parameter. An ellipsis (...) is appended to the string and is included in the character count.
+ +| Input | Output | +|:-------------------------------------------|:-------| +| {% raw %}`{{ "The cat came back the very next day" | truncate: 10 }}`{% endraw %} | "The cat..." | diff --git a/_filters/truncatewords.md b/_filters/truncatewords.md index bc1aca3..4747838 100644 --- a/_filters/truncatewords.md +++ b/_filters/truncatewords.md @@ -1,3 +1,10 @@ --- title: truncatewords --- + + +Truncates a string down to 'x' words, where x is the number passed as a parameter. An ellipsis (...) is appended to the truncated string.
+ +| Input | Output | +|:-------------------------------------------|:-------| +| {% raw %}`{{ "The cat came back the very next day" | truncatewords: 4 }}`{% endraw %} | The cat came back...| diff --git a/_filters/uniq.md b/_filters/uniq.md index 1730f1e..0f36115 100644 --- a/_filters/uniq.md +++ b/_filters/uniq.md @@ -1,3 +1,10 @@ --- title: uniq --- + + +Removes any duplicate instances of an element in an array.
+ +| Input | Output | +|:-------------------------------------------|:-------| +| {% raw %}`{% assign fruits = "orange apple banana apple orange" %} {{ fruits | split: ' ' | uniq | join: ' ' }}`{% endraw %} | orange apple banana | diff --git a/_filters/upcase.md b/_filters/upcase.md index 62ee820..1b50d88 100644 --- a/_filters/upcase.md +++ b/_filters/upcase.md @@ -1,3 +1,11 @@ --- title: upcase --- + +Converts a string into uppercase.
+ + +| Input | Output | +|:-------------------------------------------|:-------| +| {% raw %}`{{ 'loud noises' | upcase }}`{% endraw %} | LOUD NOISES | +