diff --git a/README.md b/README.md index cc2f37fd..2c9aba59 100644 --- a/README.md +++ b/README.md @@ -34,17 +34,15 @@ _TODO: [Write more extension Documentation](https://github.com/SwiftGen/StencilS * `percent` * `escapeReservedKeywords`: Escape keywods reserved in the Swift language, by wrapping them inside backticks so that the can be used as regular escape keywords in Swift code. -## SwiftTemplate +## StencilSwiftTemplate -This framework also contains [a `SwiftTemplate` class](https://github.com/SwiftGen/StencilSwiftKit/blob/master/Sources/SwiftTemplate.swift#L10), which is a subclass of `Stencil.Template` dedicated to remove extra newlines when rendering the template. +This framework also contains [a `StencilSwiftTemplate` class](https://github.com/SwiftGen/StencilSwiftKit/blob/master/Sources/StencilSwiftTemplate.swift#L10), which is a subclass of `Stencil.Template` dedicated to remove extra newlines when rendering the template. -Indeed, such extra newlines could otherwise be inserted in the generated output because you want your template to be well formatted, and that can end up with Stencil nodes like `{% for … %}` and `{% if … %}` be alone in some lines of your template and that would render into nothing by themselves, generating empty lines in the output. +Indeed, such extra newlines could otherwise be inserted in the generated output because you want your template to be well formatted, and that can end up with Stencil nodes like `{% for … %}` and `{% if … %}` be alone in some lines of your template and that would render into nothing by themselves, generating empty lines in the output. This template subclass aims to remove those lines generated by using a simple workaround when rendering, until there's an embeded way to handle that in Stencil proper (see [Stencil/#22](https://github.com/kylef/Stencil/issues/22)). -## Stencil.Extension +## Stencil.Extension & swiftStencilEnvironment -This framework also contains a [`stencilSwiftExtension()`](https://github.com/SwiftGen/StencilSwiftKit/blob/master/Sources/SwiftTemplate.swift#L45-L61) function which returns a `Stencil.Extension` already configured with all the nodes and filters listed above. - -Use it when you configure your code to tell `Stencil` to register those nodes & filters, for example when building your `Stencil.Environment(extension: …, templateClass: …)` +This framework also contains [helper methods for `Stencil.Extension` and `Stencil.Environment`](https://github.com/SwiftGen/StencilSwiftKit/blob/master/Sources/Environment.swift), to easily register all the tags and filters listed above on an existing `Stencil.Extension`, as well as to easily get a `Stencil.Environment` preconfigured with both those tags & filters `Extension` and the `StencilSwiftTemplate`.