Rename to minify-html

This commit is contained in:
Wilson Lin 2020-07-12 01:29:34 +10:00
commit dc376d7c7f
47 changed files with 182 additions and 191 deletions

View file

@ -1,11 +1,11 @@
[package]
publish = false
name = "minify-html"
name = "minify_html"
description = "Fast allocation-less HTML minifier with smart whitespace handling"
license = "MIT"
homepage = "https://github.com/wilsonzlin/hyperbuild"
homepage = "https://github.com/wilsonzlin/minify-html"
readme = "README.md"
repository = "https://github.com/wilsonzlin/hyperbuild.git"
repository = "https://github.com/wilsonzlin/minify-html.git"
version = "0.2.4"
authors = ["Wilson Lin <code@wilsonl.in>"]
edition = "2018"
@ -15,7 +15,7 @@ name = "minify_html"
crate-type = ["cdylib"]
[dependencies]
hyperbuild = { path = "..", features = ["js-esbuild"] }
minify-html = { path = "..", features = ["js-esbuild"] }
[dependencies.pyo3]
version = "0.11.1"
features = ["extension-module"]

View file

@ -1,4 +1,4 @@
use hyperbuild::{Cfg, hyperbuild as hyperbuild_native};
use minify_html::{Cfg, in_place as minify_html_native};
use pyo3::prelude::*;
use pyo3::exceptions::SyntaxError;
use pyo3::wrap_pyfunction;
@ -7,7 +7,7 @@ use std::str::from_utf8_unchecked;
#[pyfunction(py_args="*", minify_js="false")]
fn minify(code: String, minify_js: bool) -> PyResult<String> {
let mut code = code.into_bytes();
match hyperbuild_native(&mut code, &Cfg {
match minify_html_native(&mut code, &Cfg {
minify_js,
}) {
Ok(out_len) => Ok(unsafe { from_utf8_unchecked(&code[0..out_len]).to_string() }),