From d67330dfb5a285230f68ddc0d2487b7222cd59d5 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 14 May 2024 16:00:08 -0400 Subject: [PATCH] pref: migrate to minify-html-onepass (#55) --- deepmodeling_sphinx/inject.py | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deepmodeling_sphinx/inject.py b/deepmodeling_sphinx/inject.py index d711a8f..70ab160 100644 --- a/deepmodeling_sphinx/inject.py +++ b/deepmodeling_sphinx/inject.py @@ -3,7 +3,7 @@ from pathlib import Path from typing import Any, Dict -import htmlmin +import minify_html_onepass from cssmin import cssmin from jinja2 import Template from jsmin import jsmin @@ -120,7 +120,7 @@ def minify_html_files(app, pagename, templatename, context, doctree): def render(self, template, render_context): content = old_render(template, render_context) - return htmlmin.minify(content) + return minify_html_onepass.minify(content, minify_js=True) render.__dict__.update(old_render.__dict__) render._deepmodeling_minified = True diff --git a/pyproject.toml b/pyproject.toml index 2426d70..63b50c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ ] dependencies = [ 'sphinx', - 'htmlmin', + 'minify-html-onepass', 'jsmin', 'cssmin', 'jinja2',