7次发布

0.3.3 2022年5月26日
0.3.2 2021年1月24日
0.3.1 2020年11月8日
0.3.0 2020年10月16日
0.1.0 2019年7月25日

#6 in #minification

Download history · Rust 包仓库 624/week @ 2024-03-08 · Rust 包仓库 583/week @ 2024-03-15 · Rust 包仓库 812/week @ 2024-03-22 · Rust 包仓库 527/week @ 2024-03-29 · Rust 包仓库 633/week @ 2024-04-05 · Rust 包仓库 670/week @ 2024-04-12 · Rust 包仓库 779/week @ 2024-04-19 · Rust 包仓库 470/week @ 2024-04-26 · Rust 包仓库 343/week @ 2024-05-03 · Rust 包仓库 683/week @ 2024-05-10 · Rust 包仓库 334/week @ 2024-05-17 · Rust 包仓库 248/week @ 2024-05-24 · Rust 包仓库 499/week @ 2024-05-31 · Rust 包仓库 59/week @ 2024-06-07 · Rust 包仓库

626 每月下载量
用于 html5minify-cli

MIT 许可证

33KB
650 代码行

Actions Status HTML5 minify documentation

HTML5压缩

基于Servo的html5ever实现的HTML5压缩器。

功能

  • 高性能
  • 输入使用AsRef<[u8]> / io::Read
  • 输出到Vec<u8> / io::Write

示例

use html5minify::Minify;

// Using Minify trait on &str:
let html = "<html> \n<link href=\"test.css\">\n<h2   id=\"id_one\"    >Hello\n</h2>    \n<p>\nWorld</p>";
let minified = html.minify().expect("Failed to minify HTML");

// Using minifier with omit doctype option set:
let mut minified = vec![];

Minifier::new(&mut minified)
    .omit_doctype(true)
    .minify(&mut html.as_bytes())
    .expect("Failed to minify HTML");

lib.rs:

HTML5标记压缩器。

依赖

~1.9–7.5MB
~50K SLoC