Metadata-Version: 2.4
Name: mkdocs-minify-html-plugin
Version: 0.3.15
Classifier: Framework :: MkDocs
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Rust
Classifier: Typing :: Typed
Requires-Dist: mkdocs>=1.4,<2
Requires-Dist: typing-extensions>=4.4 ; python_full_version < '3.12'
License-File: LICENSE
License-File: LICENSE-THIRD-PARTY
Summary: MkDocs plugin for minification using minify-html, an extremely fast and smart HTML + JS + CSS minifier
Author-email: monosans <hsyqixco@protonmail.com>
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: repository, https://github.com/monosans/mkdocs-minify-html-plugin

# <img src="https://raw.githubusercontent.com/monosans/mkdocs-minify-html-plugin/main/assets/logo.svg" alt="" width="40" align="top"> mkdocs-minify-html-plugin

[![Downloads](https://static.pepy.tech/badge/mkdocs-minify-html-plugin)](https://pepy.tech/project/mkdocs-minify-html-plugin)

MkDocs plugin that minifies the built HTML pages, including inline CSS and JS, with [minify-html](https://github.com/wilsonzlin/minify-html).

## Usage

Install:

```bash
uv add --dev mkdocs-minify-html-plugin
# or
pip install -U mkdocs-minify-html-plugin
```

Activate in `mkdocs.yml`:

```yaml
plugins:
  - search
  - minify_html
```

## Options

The options are the fields of minify-html's [`Cfg`](https://docs.rs/minify-html/latest/minify_html/struct.Cfg.html#fields). The defaults aim for the smallest output that stays spec-compliant:

```yaml
plugins:
  - search
  - minify_html:
      allow_noncompliant_unquoted_attribute_values: false
      allow_optimal_entities: false
      allow_removing_spaces_between_attributes: false
      keep_closing_tags: false
      keep_comments: false
      keep_html_and_head_opening_tags: false
      keep_input_type_text_attr: true
      keep_ssi_comments: false
      minify_css: true
      minify_doctype: false
      minify_js: true
      preserve_brace_template_syntax: false
      preserve_chevron_percent_template_syntax: false
      remove_bangs: false
      remove_processing_instructions: false
```

## License

[MIT](https://github.com/monosans/mkdocs-minify-html-plugin/blob/main/LICENSE)

