Open rgwood opened 1 year ago
Hi, thanks for writing+maintaining Tera; it's great!
Given a template like this:
{{ foo }} {% block bar_block %} {{ bar }} {% endblock %}
Is it possible to render just the bar_block block using Tera? From skimming the API docs I don't think it is, but maybe I'm missing something.
bar_block
The use case I have is an HTMX UI, where it's useful to be able to render parts of a template. Prior art: the jinja2-fragments library, the render_block function in Minijinja.
render_block
Not currently but this is something I'm thinking of adding for v2, I'm working on block support for it and will likely do a render_block fn anyway internally so it shouldn't be too hard to expose
Hi, thanks for writing+maintaining Tera; it's great!
Given a template like this:
Is it possible to render just the
bar_block
block using Tera? From skimming the API docs I don't think it is, but maybe I'm missing something.The use case I have is an HTMX UI, where it's useful to be able to render parts of a template. Prior art: the jinja2-fragments library, the
render_block
function in Minijinja.