Registry / devops / mkdocs-minify-html-plugin

mkdocs-minify-html-plugin

JSON →
library0.3.11pypypiunverified

MkDocs plugin that minifies HTML, JS, and CSS output using the blisteringly fast minify-html Rust-based minifier. Current version 0.3.10, released June 2024. Active development with semver.

pip install mkdocs-minify-html-plugin
INSTALL
IMPORT
SIG · MKDOCS-MINIFY-HTML
M
mkdocs-minify-html-plugin
devopspythonv0.3.11
Install
3.4s avg
Import
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 50.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.4s · import 0.000s · 52MB
50MB installed
● package 50MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MinifyHTMLPlugin
from mkdocs_minify_html_plugin import MinifyHTMLPlugin
from mkdocs_minify_html_plugin import MinifyHTMLPlugin

Enable the plugin in your MkDocs configuration. The plugin automatically minifies all HTML, JS, and CSS output during build.

# mkdocs.yml plugins: - search - minify-html: minify_js: true minify_css: true htmlmin_opts: remove_comments: true collapse_whitespace: true
mkdocs --version
Debug
Known issues
breakingFrom version 0.3.0, the option names changed: 'minify_js' and 'minify_css' replaced 'js' and 'css'. The old names silently fail.
fix
Update your mkdocs.yml: replace 'js: true' with 'minify_js: true', same for css.
affects: <0.3.0
gotchaThe plugin must be listed after 'search' in the plugins list to ensure minification runs after search index generation.
fix
Order: start with 'search', then add 'minify-html'.
affects: all
deprecatedThe 'htmlmin_opts' sub-options are deprecated as of 0.4.0 (unreleased). Use top-level options instead.
fix
Migrate 'htmlmin_opts.remove_comments' to 'remove_comments: true' (once 0.4.0 lands). For now, both work.
affects: >=0.3.0
gotchaThe plugin does not minify inline CSS/JS inside <style> and <script> tags by default. Set 'minify_inline_css' and 'minify_inline_js' if needed.
fix
Add 'minify_inline_css: true' and 'minify_inline_js: true' to your plugin config.
affects: all
Upgrade
Version history
0.3.11latest on PyPI · released Jun 13, 2026
Audit
Dependencies
mkdocsrequiredCore MkDocs is required; plugin runs as a MkDocs build step.
minify-htmlrequiredRust-based minifier engine; pulled automatically as a Python wheel.
Agent activity
6 hits · last 30 days
node
6
Resources