mkdocs-minify-plugin
An MkDocs plugin to minify HTML, JS or CSS files prior to being written to disk
What it is and what it does
mkdocs-minify-plugin is an MkDocs plugin that automatically minifies HTML, JavaScript, and CSS assets during the documentation build process. It delegates minification to three specialized libraries: htmlmin2 for HTML, jsmin for JavaScript, and csscompressor for CSS. The plugin integrates into MkDocs' build pipeline and can be configured to minify specific file types or all three, with options to add cache-busting hashes to file names and to customize HTML minification behavior.
The plugin is useful when you want to reduce the size of generated documentation without manually running separate minification tools. It supports glob patterns for file selection and can automatically update references to minified files in your HTML output. The package is stable but dormant—last updated in early 2024—and carries no known security vulnerabilities.
Use it for:
- Reduce documentation site size and bandwidth for static MkDocs sites deployed to CDNs or hosting with bandwidth limits.
- Add cache-busting hashes to CSS and JS files to ensure browsers fetch fresh versions after updates.
- Automatically minify all HTML output from MkDocs without manual post-processing steps.
- Minify custom JavaScript and CSS files included in your documentation theme or configuration.
- Optimize documentation builds for low-bandwidth environments or mobile-first delivery.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Minifies HTML, JavaScript, and CSS files in MkDocs documentation builds before writing them to disk, reducing output size.
Yes, if you use MkDocs and want to reduce output size without extra build steps. Install friction is low, dependencies are stable, and there are no known vulnerabilities. The dormant maintenance status is not a blocker for a simple, focused plugin, but be aware that bug fixes or feature updates are unlikely. Suitable for production documentation builds.
Install
mkdocs-minify-plugin on PyPI
pip
pip install mkdocs-minify-pluginuv
uv add mkdocs-minify-pluginpoetry
poetry add mkdocs-minify-pluginInstalling mkdocs-minify-plugin
Before you install
Low friction install with a pure-Python wheel and four straightforward runtime dependencies. Maintenance is dormant—last release was 2024-01-29 and no commits since 2024-02-07—but the package is not archived and has no known vulnerabilities.
License in practice
MIT license is permissive; you can use this package freely in commercial or private projects with minimal restrictions.
Quickstart
pip install mkdocs-minify-plugin
In mkdocs.yml:
plugins:
- minify:
minify_html: true
minify_js: true
minify_css: true
js_files:
- path/to/file.js
css_files:
- path/to/file.css
Requires MkDocs to be installed and an active mkdocs.yml configuration file in your project.
Verify before relying
- Whether minification performance impact is measurable on large documentation sites.
- Compatibility with recent MkDocs versions beyond those listed in classifiers (3.10, 3.11).
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — mkdocs, htmlmin2, jsmin, csscompressor |
| Maintenance | dormant — 928 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,052,748/month — #4,439 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mkdocs_minify_plugin-0.8.0-py3-none-any.whl
Keywords: mkdocs, minify, publishing, documentation, html, css
Tags
More Documentation packages
Docutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
griffeGriffe extracts the complete structure and…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
minify-htmlMinifies HTML, JavaScript, and CSS in a single…
permissive · top 5,000 on PyPI
Flask-MinifyFlask extension that automatically minifies…
permissive · top 15,000 on PyPI
jsminMinifies JavaScript code by removing…
permissive · top 5,000 on PyPI
python-minifierTransforms Python source code into compact,…
permissive · top 15,000 on PyPI
htmlmin2Minifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
django-htmlminMinifies HTML by removing whitespace and…
permissive · top 5,000 on PyPI
htmlminMinifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
webassetsMerges and compresses JavaScript and CSS files…
permissive · top 15,000 on PyPI
Flask-AssetsIntegrates asset management into Flask…
permissive · top 15,000 on PyPI
css-html-js-minifyMinifies CSS, HTML, and JavaScript files or…
copyleft · top 15,000 on PyPI