Merge pull request #322 from stencilproject/feature/public-render

Make `render` method public
This commit is contained in:
David Jennes
2022-07-27 05:05:57 +02:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -9,6 +9,9 @@ _None_
- Made the `tokens` property on a `Template` public. - Made the `tokens` property on a `Template` public.
[Stefanomondino](https://github.com/stefanomondino) [Stefanomondino](https://github.com/stefanomondino)
[#292](https://github.com/stencilproject/Stencil/pull/292) [#292](https://github.com/stencilproject/Stencil/pull/292)
- Made the `Template.render(_:)` method (that accepts a `Context`) public.
[David Jennes](https://github.com/djbe)
[#322](https://github.com/stencilproject/Stencil/pull/322)
### Deprecations ### Deprecations

View File

@@ -67,7 +67,7 @@ open class Template: ExpressibleByStringLiteral {
} }
/// Render the given template with a context /// Render the given template with a context
func render(_ context: Context) throws -> String { public func render(_ context: Context) throws -> String {
let context = context let context = context
let parser = TokenParser(tokens: tokens, environment: context.environment) let parser = TokenParser(tokens: tokens, environment: context.environment)
let nodes = try parser.parse() let nodes = try parser.parse()