mkdocs-minify-html-plugin 0.3.12__cp315-cp315-win32.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
@@ -0,0 +1,20 @@
1
+ def minify(
2
+ code: str,
3
+ /,
4
+ *,
5
+ allow_noncompliant_unquoted_attribute_values: bool,
6
+ allow_optimal_entities: bool,
7
+ allow_removing_spaces_between_attributes: bool,
8
+ keep_closing_tags: bool,
9
+ keep_comments: bool,
10
+ keep_html_and_head_opening_tags: bool,
11
+ keep_input_type_text_attr: bool,
12
+ keep_ssi_comments: bool,
13
+ minify_css: bool,
14
+ minify_doctype: bool,
15
+ minify_js: bool,
16
+ preserve_brace_template_syntax: bool,
17
+ preserve_chevron_percent_template_syntax: bool,
18
+ remove_bangs: bool,
19
+ remove_processing_instructions: bool,
20
+ ) -> str: ...
@@ -0,0 +1,50 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+
5
+ from mkdocs.config import config_options as c
6
+ from mkdocs.config.base import Config
7
+ from mkdocs.config.defaults import MkDocsConfig
8
+ from mkdocs.plugins import BasePlugin
9
+ from mkdocs.structure.pages import Page
10
+
11
+ from mkdocs_minify_html_plugin._minify_html import minify
12
+
13
+ if sys.version_info >= (3, 12):
14
+ from typing import override
15
+ else:
16
+ from typing_extensions import override
17
+
18
+
19
+ class MinifyHtmlConfig(Config):
20
+ allow_noncompliant_unquoted_attribute_values = c.Type(bool, default=False)
21
+ allow_optimal_entities = c.Type(bool, default=False)
22
+ allow_removing_spaces_between_attributes = c.Type(bool, default=False)
23
+ keep_closing_tags = c.Type(bool, default=False)
24
+ keep_comments = c.Type(bool, default=False)
25
+ keep_html_and_head_opening_tags = c.Type(bool, default=False)
26
+ keep_input_type_text_attr = c.Type(bool, default=True)
27
+ keep_ssi_comments = c.Type(bool, default=False)
28
+ minify_css = c.Type(bool, default=True)
29
+ minify_doctype = c.Type(bool, default=False)
30
+ minify_js = c.Type(bool, default=True)
31
+ preserve_brace_template_syntax = c.Type(bool, default=False)
32
+ preserve_chevron_percent_template_syntax = c.Type(bool, default=False)
33
+ remove_bangs = c.Type(bool, default=False)
34
+ remove_processing_instructions = c.Type(bool, default=False)
35
+
36
+
37
+ class MinifyHtmlPlugin(BasePlugin[MinifyHtmlConfig]):
38
+ @override
39
+ def on_post_page(
40
+ self, output: str, *, page: Page, config: MkDocsConfig
41
+ ) -> str | None:
42
+ return minify(output, **self.config)
43
+
44
+ @override
45
+ def on_post_template(
46
+ self, output_content: str, *, template_name: str, config: MkDocsConfig
47
+ ) -> str | None:
48
+ if template_name.endswith(".html"):
49
+ return minify(output_content, **self.config)
50
+ return output_content
File without changes
@@ -0,0 +1,82 @@
1
+ Metadata-Version: 2.4
2
+ Name: mkdocs-minify-html-plugin
3
+ Version: 0.3.12
4
+ Classifier: Framework :: MkDocs
5
+ Classifier: Natural Language :: English
6
+ Classifier: Operating System :: MacOS
7
+ Classifier: Operating System :: Microsoft :: Windows
8
+ Classifier: Operating System :: POSIX :: Linux
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: 3.15
17
+ Classifier: Programming Language :: Python :: Implementation :: CPython
18
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
19
+ Classifier: Programming Language :: Rust
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: mkdocs>=1.4,<2
22
+ Requires-Dist: typing-extensions>=4.4 ; python_full_version < '3.12'
23
+ License-File: LICENSE
24
+ Summary: MkDocs plugin for minification using minify-html, an extremely fast and smart HTML + JS + CSS minifier
25
+ Author-email: monosans <hsyqixco@protonmail.com>
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
28
+ Project-URL: repository, https://github.com/monosans/mkdocs-minify-html-plugin
29
+
30
+ # mkdocs-minify-html-plugin
31
+
32
+ [![Downloads](https://static.pepy.tech/badge/mkdocs-minify-html-plugin)](https://pepy.tech/project/mkdocs-minify-html-plugin)
33
+
34
+ MkDocs plugin for minification using [minify-html](https://github.com/wilsonzlin/minify-html), an extremely fast and smart HTML + JS + CSS minifier.
35
+
36
+ ## Usage
37
+
38
+ Install:
39
+
40
+ ```bash
41
+ pip install -U mkdocs-minify-html-plugin
42
+ ```
43
+
44
+ Activate in `mkdocs.yml`:
45
+
46
+ ```yaml
47
+ plugins:
48
+ - search
49
+ - minify_html
50
+ ```
51
+
52
+ ## Options
53
+
54
+ A description of all options is available in the [minify_html docs](https://docs.rs/minify-html/0.16.4/minify_html/struct.Cfg.html#fields).
55
+
56
+ The default plugin options are aimed at the best possible minification while maintaining compliance with the specification:
57
+
58
+ ```yaml
59
+ plugins:
60
+ - search
61
+ - minify_html:
62
+ allow_noncompliant_unquoted_attribute_values: false
63
+ allow_optimal_entities: false
64
+ allow_removing_spaces_between_attributes: false
65
+ keep_closing_tags: false
66
+ keep_comments: false
67
+ keep_html_and_head_opening_tags: false
68
+ keep_input_type_text_attr: true
69
+ keep_ssi_comments: false
70
+ minify_css: true
71
+ minify_doctype: false
72
+ minify_js: true
73
+ preserve_brace_template_syntax: false
74
+ preserve_chevron_percent_template_syntax: false
75
+ remove_bangs: false
76
+ remove_processing_instructions: false
77
+ ```
78
+
79
+ ## License
80
+
81
+ [MIT](https://github.com/monosans/mkdocs-minify-html-plugin/blob/main/LICENSE)
82
+
@@ -0,0 +1,11 @@
1
+ mkdocs_minify_html_plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ mkdocs_minify_html_plugin/_minify_html.cp315-win32.pyd,sha256=OBq4UjAAAtsZzmewiQh2N2MOXyQysoEO9lmsi43XVOs,11680256
3
+ mkdocs_minify_html_plugin/_minify_html.pyi,sha256=hpIaalCWhA9ReQ7Cy4yNgBOeThypb6_dccR1Bi7LR9Q,609
4
+ mkdocs_minify_html_plugin/plugin.py,sha256=iB4bU0EnqLDfS3920x6BsaLCRvBRnrM7Itgc4GCA6Ag,1884
5
+ mkdocs_minify_html_plugin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ mkdocs_minify_html_plugin-0.3.12.dist-info/METADATA,sha256=Tvxh658MeNOJxOozH46mU6WwIx8T0U9nbBr4GV9cSpQ,2838
7
+ mkdocs_minify_html_plugin-0.3.12.dist-info/WHEEL,sha256=EfmT5yHmSsKCMf88H0y_gDJxXP11dyYwZSLaX0aGPEg,93
8
+ mkdocs_minify_html_plugin-0.3.12.dist-info/entry_points.txt,sha256=A_wXAYr3Az8ibTw3A3u7BQYvmPDu5zNeOgAWcg2CUR4,79
9
+ mkdocs_minify_html_plugin-0.3.12.dist-info/licenses/LICENSE,sha256=CXoglBzFBps3W6thE0bcqKjrms8H1rtzq7Vf3tXrxUQ,1086
10
+ mkdocs_minify_html_plugin-0.3.12.dist-info/sboms/mkdocs-minify-html-plugin.cyclonedx.json,sha256=Es3eQu5MlssuAbwwpVZ-tnQghsNaQyEJmwGi7pu_xv8,225916
11
+ mkdocs_minify_html_plugin-0.3.12.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.15.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp315-cp315-win32
@@ -0,0 +1,2 @@
1
+ [mkdocs.plugins]
2
+ minify_html=mkdocs_minify_html_plugin.plugin:MinifyHtmlPlugin
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 monosans
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.