Skip to content

Commit

Permalink
Update changelog entry and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed May 31, 2017
1 parent 4b6b1e0 commit 35af75f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Due to the removal of legacy code, there are a few breaking changes in this new
* Added the `removeNewlines` filter to remove newlines (and spaces) from a string.
[David Jennes](https://github.com/djbe)
[#47](https://github.com/SwiftGen/StencilSwiftKit/pull/47)
[#48](https://github.com/SwiftGen/StencilSwiftKit/pull/48)

### Internal Changes

Expand Down
38 changes: 21 additions & 17 deletions Documentation/filters-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,27 @@ Transforms an arbitrary string so that only the first "word" is lowercased.

## Filter: `removeNewlines`

Removes all newlines and whitespace characters from the string.

| Input | Output |
|-----------------------|-----------------------|
| ` \ntest` | `test` |
| `test \n\t ` | `test` |
| `test\n test` | `testtest` |
| `\r\ntest\n test\n` | `testtest` |

By default it removes whitespace characters, unless a single optional argument is set to "false", "no" or "0":

| Input | Output |
|-----------------------|-----------------------|
| ` \ntest` | ` test` |
| `test \n\t ` | `test \t ` |
| `test\n test` | `test test` |
| `\r\ntest\n test\n` | `test test` |
This filter has a couple of modes that you can specifiy using an optional argument (defaults to "all"):

**all**: Removes all newlines and whitespace characters from the string.

| Input | Output |
|------------------------|-----------------------|
| ` \ntest` | `test` |
| `test \n\t ` | `test` |
| `test\n test` | `testtest` |
| `test, \ntest, \ntest` | `test,test,test` |
| ` test test ` | `testtest` |

**leading**: Removes leading whitespace characters from each line, and all newlines. Also trims the end result.

| Input | Output |
|------------------------|-----------------------|
| ` \ntest` | `test` |
| `test \n\t ` | `test` |
| `test\n test` | `testtest` |
| `test, \ntest, \ntest` | `test, test, test` |
| ` test test ` | `test test` |

## Filter: `snakeToCamelCase`

Expand Down

0 comments on commit 35af75f

Please sign in to comment.