使用Jinja2模板来缩小Flask应用程序的HTML输出

问题描述:

是否有Flask或Jinja2配置标志/扩展名,以在呈现模板之后自动缩小HTML输出?

Is there a Flask or Jinja2 configuration flag / extension to automatically minify the HTML output after rendering the template?

看看这里 https://github.com/cobrateam/django-htmlmin#使用-html_minify函数

我意识到它主要用于django,但是这个例子展示了如何使用这个项目代码来做你想做的事情一个烧瓶视图,我认为。

I realise it is mainly used for django but the example shows how to use this projects code to do what you want with a flask view, i think.