I have two files:
base.html
Good question. I believe Jinja2 does not do this.
The main question you need to ask yourself is why you want the HTML to be correctly indented, since browsers do not care. In a production application it is more efficient to go the other way and strip all the white space to make the page smaller.
If you are interested in doing this during development then you can pass the HTML generated by render_template()
through an indenter such as prettify()
from BeautifulSoup. I do not recommend this for a production system, since your functions will take longer to run.