{"id":18812225,"url":"https://github.com/blobfolio/htminl","last_synced_at":"2026-01-23T05:39:13.559Z","repository":{"id":65512104,"uuid":"306812109","full_name":"Blobfolio/htminl","owner":"Blobfolio","description":"HTMinL is a CLI tool for x86-64 Linux machines that simplifies the task of minifying HTML in-place for production environments.","archived":false,"fork":false,"pushed_at":"2025-04-04T02:19:56.000Z","size":1875,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T13:45:51.795Z","etag":null,"topics":["html","html-minifier","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blobfolio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Blobfolio"}},"created_at":"2020-10-24T05:22:58.000Z","updated_at":"2025-04-04T02:17:51.000Z","dependencies_parsed_at":"2024-03-21T19:25:58.489Z","dependency_job_id":"7471190e-c69a-40f9-aede-691dbf6c677d","html_url":"https://github.com/Blobfolio/htminl","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blobfolio%2Fhtminl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blobfolio%2Fhtminl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blobfolio%2Fhtminl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blobfolio%2Fhtminl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blobfolio","download_url":"https://codeload.github.com/Blobfolio/htminl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782261,"owners_count":21160717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","html-minifier","rust"],"created_at":"2024-11-07T23:30:57.535Z","updated_at":"2026-01-23T05:39:13.555Z","avatar_url":"https://github.com/Blobfolio.png","language":"Rust","funding_links":["https://github.com/sponsors/Blobfolio"],"categories":[],"sub_categories":[],"readme":"# HTMinL\n\n[![ci](https://img.shields.io/github/actions/workflow/status/Blobfolio/htminl/ci.yaml?style=flat-square\u0026label=ci)](https://github.com/Blobfolio/htminl/actions)\n[![deps.rs](https://deps.rs/repo/github/blobfolio/htminl/status.svg?style=flat-square\u0026label=deps.rs)](https://deps.rs/repo/github/blobfolio/htminl)\u003cbr\u003e\n[![license](https://img.shields.io/badge/license-wtfpl-ff1493?style=flat-square)](https://en.wikipedia.org/wiki/WTFPL)\n[![contributions welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\u0026label=contributions)](https://github.com/Blobfolio/htminl/issues)\n\nHTMinL is a CLI tool for x86-64 Linux machines that simplifies the task of minifying HTML in-place for production environments.\n\n\n\n## Features\n\nHTMinL is a _fast_, in-place HTML minifier. It prioritizes safety and code sanity over _ULTIMATE COMPRESSION_, so may not save quite as many bytes as other tools, but it's also less likely to break shit. Haha.\n\nCritically, HTMinL is _not_ a stream processor; it constructs a complete DOM tree from the full source _before_ getting down to business. This allows for much more accurate processing and robust error recovery.\n\nSee the [minification](#minification) section for more details about the process, as well as the [cautions](#cautions) section for important assumptions, requirements, gotchas, etc.\n\n\n\n## Installation\n\nDebian and Ubuntu users can just grab the pre-built `.deb` package from the [latest release](https://github.com/Blobfolio/htminl/releases/latest), and Arch users can grab it from [AUR](https://aur.archlinux.org/packages/htminl-bin) (thanks @Dominiquini!).\n\nThis application is written in [Rust](https://www.rust-lang.org/) and can alternatively be built/installed from source using [Cargo](https://github.com/rust-lang/cargo):\n\n```bash\n# See \"cargo install --help\" for more options.\ncargo install \\\n    --git https://github.com/Blobfolio/htminl.git \\\n    --bin htminl\n```\n\n\n\n## Usage\n\nIt's easy. Just run `htminl [FLAGS] [OPTIONS] \u003cPATH(S)\u003e…`.\n\nThe following flags and options are available:\n\n| Short | Long | Value | Description |\n| ----- | ---- | ----- | ----------- |\n| `-h` | `--help` | | Print help information and exit. |\n| `-l` | `--list` | `\u003cFILE\u003e` | Read (absolute) file and/or directory paths from this text file — or STDIN if \"-\" — one entry per line, instead of or in addition to the trailing `\u003cPATH(S)\u003e`. |\n| `-p` | `--progress` | | Show progress bar while minifying. |\n| `-V` | `--version` | | Print program version and exit. |\n\nPaths can be specified as trailing command arguments, and/or loaded via text file (with one path per line) with the `-l` option. Directories are scanned recursively for `.htm`/`.html`.\n\nSome quick examples:\n\n```bash\n# Minify one file.\nhtminl /path/to/index.html\n\n# Tackle a whole folder at once with a nice progress bar:\nhtminl -p /path/to/html\n\n# Or load it up with a lot of places separately:\nhtminl /path/to/html /path/to/index.html …\n```\n\n\n\n## Minification\n\nHTMinL performs a lot of little optimizations to shrink the size of documents without affecting how they're rendered by web browsers, like:\n\n* Normalizing tag/attribute casing;\n* Removing (default) `type` attributes on `\u003cscript\u003e` and `\u003cstyle\u003e` tags;\n* Removing HTML comments;\n* Removing implied values on boolean HTML attributes;\n* Removing trailing slashes from void HTML element tags;\n* Removing XML processing instructions;\n* Replacing CRLF/CR literals with LF;\n* Rewriting the doctype as `\u003c!DOCTYPE html\u003e`;\n* Using self-closing sytnax on childless SVG elements;\n* Using the shorter of `'` and `\"` to quote value attributes;\n\nBut at the end of the day, most savings come down to basic whitespace manipulation.\n\nHTMinL parses HTML documents the same way web browsers do, and employs a ~~naive~~ conservative version of the same inline whitespace-collapsing strategies [they themselves use](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_text/Whitespace).\n\nUnlike some of the more aggressive minifiers, HTMinL does not assume strict adherence to layout/content and inline/block distinctions. This may leave a few extra bytes on the table, but it greatly decreases the risk of accidental render fuckery.\n\nAnd besides, any difference will be _negligible_ after proper [content encoding](https://github.com/Blobfolio/channelz/) anyway!\n\nNo sense going overboard. ;)\n\n\n\n## Cautions\n\nWhile care has been taken to balance savings and safety, there are some (intentional) limitations to be aware of:\n\n* Documents are expected to be encoded in UTF-8;\n* Documents are processed as **HTML**, _not_ XML, XHTML, liquid, markdown, PHP, etc.;\n* HTMinL's parsing is pretty forgiving, but doesn't officially recognize \"quirks mode\";\n* Whitespace collapsing _can_ adversely affect layouts when CSS properties like `white-space: pre` are applied to elements that don't normally have them;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblobfolio%2Fhtminl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblobfolio%2Fhtminl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblobfolio%2Fhtminl/lists"}