I'm making a simple script that works on Jinja2 templates. Right now it's just reading files in from disk manually, i.e. no Jinja Loaders. I have 2 strings (A
and B
), representing 2 templates. I want to make one template (B
) inherit from the other (A
), i.e. I have {% block body %}{% endblock %}
in A
, and I want to make the body block be the contents of B. How can I get the rendered output of this?
Normally I'd use {% extends 'filename' %}
in B
and it'd use the right one, however I don't have the filename (per se) for A.