Why Minify HTML?
The biggest reason people do this is to strip comments from an HTML file before deploying it.
Stripping comments and extra whitespace from a file can also reduce its size, which means faster page loads—especially on cellular networks.
CodeKit uses HTML-Minifier to shrink HTML files.
Select an HTML file (or any type of file that compiles to HTML, such as Haml or Pug), then just check the "minify" box. That's it.
Warning: Valid Syntax Required
The minifier will fail to run on files that are not HTML or that have syntax errors. In these cases, it may also produce invalid or incorrect output. If that happens, check your original file for syntax issues.
NOTE: You can use HTML-Minifier on files that are not strict HTML (Kit, Pug, Slim, Markdown, etc.) because CodeKit will first compile the file to HTML and then run the minifier.
Currently, no options are exposed for the HTML-Minifier. It will strip comments, delete insignificant whitespace, and remove duplicate/unneeded attributes.
Pro-Tip: if there's a comment you want to keep, use !:
<!--! YOU SHALL NOT PASS -->
The reason more configuration options are not exposed is that they tend to break your HTML. With the defaults, you get all the biggest optimizations without any risk of broken files.