minify_html 0.6.9 → 0.7.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad2b02f242030707bf0a464b960c607b0d53072aecfc264cec925c1e3059d86a
4
- data.tar.gz: eb5acbe28866cca0e8217e057cbe1fb6c6e7e11bb4ad7a90f7498e2419388e40
3
+ metadata.gz: 958ee640acc4c9e36b4e2cd5e758eff11ec7e3ae5993904df8bbdcfda2273672
4
+ data.tar.gz: 2d3d15ca9ae0163aac94942522539fa717f40de197402c53a12de76ef1440995
5
5
  SHA512:
6
- metadata.gz: dbf61cd9b0a466431cf47a6f40a187ec4b4289497853a65fd5f36a422ea727be9650c18ffb54631f03512b3b6fe302271d6193b0facf66c43eef56a1dc6b6da0
7
- data.tar.gz: a9861b72300ce112e94688828bd8be160c89c9eefb08916b537f58fc91848ef74b637ae6029ba1fb106fa85217b82d8d1a3cd25124942d48eb5da8a2cb3bd438
6
+ metadata.gz: 0d796a8f1913e38acf2eeae1365a69c49d0b9e41650cf1607d57328226b27af22c4a67247ad2c57c4c31fb0e03abb173ce68563f4c5ca232c4fd6d2e16dfa079
7
+ data.tar.gz: c5db520f59e8c761ecbe07b8f9d815189ef2670991801be483560c4fced146f5666b53ceda71cc5911733f7ae34e1464156882134abfb228cd8872344be26bb1
data/README.md CHANGED
@@ -19,11 +19,11 @@ A Rust HTML minifier meticulously optimised for speed and effectiveness, with bi
19
19
 
20
20
  Comparison with [html-minfier](https://github.com/kangax/html-minifier) and [minimize](https://github.com/Swaagie/minimize), run on the top web pages. [See the breakdown here.](./bench)
21
21
 
22
- <img width="415" alt="Chart showing speed of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.6.9/core/average-speeds.png"><img width="415" alt="Chart showing compression of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.6.9/core/average-sizes.png">
22
+ <img width="400" alt="Chart showing speed of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.7.2/core/average-speeds.png"><img width="400" alt="Chart showing compression of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.7.2/core/average-sizes.png">
23
23
 
24
24
  The [onepass](https://github.com/wilsonzlin/minify-html/tree/master/rust/onepass) variant is even more optimised for speed. See its [README](https://github.com/wilsonzlin/minify-html/tree/master/rust/onepass) for more details.
25
25
 
26
- ## Usage
26
+ ## Compatibility and usage
27
27
 
28
28
  <details>
29
29
  <summary><img width="24" src="https://wilsonl.in/minify-html/icon/cli.png"> <strong>CLI</strong></summary>
@@ -32,10 +32,11 @@ Precompiled binaries are available for Linux, macOS, and Windows.
32
32
 
33
33
  ### Get
34
34
 
35
- [Linux x86-64](https://wilsonl.in/minify-html/bin/0.6.9-linux-x86_64) |
36
- [Linux ARM](https://wilsonl.in/minify-html/bin/0.6.9-linux-arm64) |
37
- [macOS](https://wilsonl.in/minify-html/bin/0.6.9-macos-x86_64) |
38
- [Windows](https://wilsonl.in/minify-html/bin/0.6.9-windows-x86_64.exe)
35
+ [Linux x64](https://wilsonl.in/minify-html/bin/0.7.2-linux-x86_64) |
36
+ [Linux ARM64](https://wilsonl.in/minify-html/bin/0.7.2-linux-arm64) |
37
+ [macOS x64](https://wilsonl.in/minify-html/bin/0.7.2-macos-x86_64) |
38
+ [macOS ARM64](https://wilsonl.in/minify-html/bin/0.7.2-macos-arm64) |
39
+ [Windows x64](https://wilsonl.in/minify-html/bin/0.7.2-windows-x86_64.exe)
39
40
 
40
41
  ### Use
41
42
 
@@ -54,7 +55,7 @@ minify-html --output /path/to/output.min.html --keep-closing-tags --minify-css /
54
55
 
55
56
  ```toml
56
57
  [dependencies]
57
- minify-html = { version = "0.6.9", features = ["js-esbuild"] }
58
+ minify-html = { version = "0.7.2", features = ["js-esbuild"] }
58
59
  ```
59
60
 
60
61
  Building with the `js-esbuild` feature requires the Go compiler to be installed as well, to build the [JS and CSS minifier](https://github.com/wilsonzlin/esbuild-rs).
@@ -72,7 +73,7 @@ Check out the [docs](https://docs.rs/minify-html) for API and usage examples.
72
73
 
73
74
  - Package: [@minify-html/js](https://www.npmjs.com/package/@minify-html/js)
74
75
  - Binding: [N-API](https://nodejs.org/api/n-api.html)
75
- - Platforms: Linux (ARM64 and x86-64), macOS (x86-64), Windows (x86-64); Node.js 8.6.0 and higher
76
+ - Platforms: Linux (ARM64 and x64), macOS (ARM64 and x64), Windows (x64); Node.js 8.6.0 and higher
76
77
 
77
78
  ### Get
78
79
 
@@ -90,24 +91,18 @@ yarn add @minify-html/js
90
91
 
91
92
  ### Use
92
93
 
93
- ```js
94
- const minifyHtml = require("@minify-html/js");
95
-
96
- // Refer to TypeScript definitions for details.
97
- const cfg = minifyHtml.createConfiguration({ keep_closing_tags: true, remove_bangs: false });
98
- const minified = minifyHtml.minify("<p> Hello, world! </p>", cfg);
99
- ```
100
-
101
- minify-html is also available for TypeScript:
94
+ TypeScript definitions are available.
102
95
 
103
96
  ```ts
104
97
  import * as minifyHtml from "@minify-html/js";
105
- import * as fs from "fs";
98
+ // Or `const minifyHtml = require("@minify-html/js")` if not using TS/ESM.
106
99
 
107
100
  const cfg = minifyHtml.createConfiguration({ keep_spaces_between_attributes: true, keep_comments: true });
108
101
  const minified = minifyHtml.minify("<p> Hello, world! </p>", cfg);
109
102
  ```
110
103
 
104
+ All [`Cfg` fields](https://docs.rs/minify-html/latest/minify_html/struct.Cfg.html) are available as snake_case properties on the object provided to `createConfiguration`; if any are not set, they default to `false`.
105
+
111
106
  </details>
112
107
 
113
108
  <details>
@@ -125,7 +120,7 @@ Add as a Maven dependency:
125
120
  <dependency>
126
121
  <groupId>in.wilsonl.minifyhtml</groupId>
127
122
  <artifactId>minify-html</artifactId>
128
- <version>0.6.9</version>
123
+ <version>0.7.2</version>
129
124
  </dependency>
130
125
  ```
131
126
 
@@ -143,6 +138,8 @@ Configuration cfg = new Configuration.Builder()
143
138
  String minified = MinifyHtml.minify("<p> Hello, world! </p>", cfg);
144
139
  ```
145
140
 
141
+ All [`Cfg` fields](https://docs.rs/minify-html/latest/minify_html/struct.Cfg.html) are available as camelCase setter methods on the `Builder`; if any are not set, they default to `false`.
142
+
146
143
  </details>
147
144
 
148
145
  <details>
@@ -150,7 +147,7 @@ String minified = MinifyHtml.minify("<p> Hello, world! </p>", cfg);
150
147
 
151
148
  - Package: [minify-html](https://pypi.org/project/minify-html)
152
149
  - Binding: [PyO3](https://github.com/PyO3/pyo3)
153
- - Platforms: Linux, macOS, Windows; Python 3.7 and higher
150
+ - Platforms: Linux (ARM64 and x64), macOS (ARM64 and x64), Windows (x64); Python 3.8 to 3.10
154
151
 
155
152
  ### Get
156
153
 
@@ -164,6 +161,8 @@ import minify_html
164
161
  minified = minify_html.minify("<p> Hello, world! </p>", minify_js=True, remove_processing_instructions=True)
165
162
  ```
166
163
 
164
+ All [`Cfg` fields](https://docs.rs/minify-html/latest/minify_html/struct.Cfg.html) are available as Python keyword arguments; if any are omitted, they default to `False`.
165
+
167
166
  </details>
168
167
 
169
168
  <details>
@@ -185,6 +184,8 @@ require 'minify_html'
185
184
  print MinifyHtml.minify("<p> Hello, world! </p>", { :keep_spaces_between_attributes => true, :minify_js => true })
186
185
  ```
187
186
 
187
+ All [`Cfg` fields](https://docs.rs/minify-html/latest/minify_html/struct.Cfg.html) are available; if any are omitted, they default to `false`.
188
+
188
189
  </details>
189
190
 
190
191
  ## Minification
@@ -423,7 +424,7 @@ Bangs, [processing instructions](https://en.wikipedia.org/wiki/Processing_Instru
423
424
 
424
425
  ## Parsing
425
426
 
426
- minify-html can process any HTML, handling all possible syntax (including invalid ones) gracefully like browsers. See [Parsing.md](./notes/Parsing.md) for more details.
427
+ minify-html can process any HTML, handling all possible syntax (including invalid ones) gracefully like browsers. See [Parsing.md](./notes/Parsing.md) for more details.
427
428
 
428
429
  ## Issues and contributions
429
430
 
data/lib/linux-ruby2.5 CHANGED
Binary file
data/lib/linux-ruby2.6 CHANGED
Binary file
data/lib/linux-ruby2.7 CHANGED
Binary file
data/lib/macos-ruby2.5 CHANGED
Binary file
data/lib/macos-ruby2.6 CHANGED
Binary file
data/lib/macos-ruby2.7 CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minify_html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wilson Lin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-23 00:00:00.000000000 Z
11
+ date: 2021-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fiddle