Skip to content

Commit

Permalink
add docs fot the render and render_str method for Template
Browse files Browse the repository at this point in the history
  • Loading branch information
livioribeiro committed Dec 17, 2023
1 parent 3d20183 commit 287e8fe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ To render templates, inject the `selva.web.templates.Template` dependency and ca
</html>
```

## Render templates to str

The `Template` interface provide methods to render templates into an str, instead
of rendering to the response.

The method `Tempate.render` accepts a template name and returns a string with the
rendered template.

The method `Template.render_str` accepts a template string, compiles it and returns
the result.

## Configuration

Jinja can be configured through the `settings.yaml`. For exmaple, to activate extensions:
Expand Down

0 comments on commit 287e8fe

Please sign in to comment.