Metadata-Version: 2.1
Name: Flask-Hmin
Version: 1.0.1
Summary: Flask压缩Html
Home-page: https://github.com/zhenzi0322/Flask-Hmin
Author: Long
Author-email: 82131529@qq.com
License: BSD-3-Clause
Platform: any
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup :: HTML
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# Flask-Hmin

## 安装
使用`pip`进行安装：
```shell
pip install Flask-Hmin
```

或者使用`pipenv`：
```shell
pipenv install Flask-Hmin
```

或者使用`poetry`：
```shell
poetry add Flask-Hmin
```

您也可以下载存储库并手动安装它，执行以下操作：
```shell
git clone https://github.com/zhenzi0322/Flask-Hmin.git
cd Flask-Hmin
python setup.py install
```

## 使用方法

### 所有模板视图html都压缩
```python
from flask import Flask, render_template
from flask_hmin import HMin

app = Flask(__name__)
app.config["HMIN_COMPRESS_HTML"] = True

HMin(app=app)

@app.route("/")
def home():
    return render_template("index.html")

if __name__ == '__main__':
    app.run()
```

### 指定某个模板视图不压缩
```python
from flask import Flask, render_template
from flask_hmin import HMin

app = Flask(__name__)
app.config["HMIN_COMPRESS_HTML"] = True

hmin = HMin(app=app)


@app.route("/")
@hmin.not_compress
def home():
    # 该视图模板不压缩
    return render_template("index.html")


@app.route("/test")
def test():
    return render_template("index.html")


if __name__ == '__main__':
    app.run()
```

