.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.5. .TH HTMLMIN "1" "December 2017" "htmlmin 0.1.12" "User Commands" .SH NAME htmlmin \- htmlmin is a configurable HTML Minifier with safety features. .SH DESCRIPTION usage: htmlmin [\-h] [\-c] [\-s] [\-\-remove\-all\-empty\-space] .IP [\-\-keep\-optional\-attribute\-quotes] [\-H] [\-k] [\-a PRE_ATTR] [\-p [TAG [TAG ...]]] [\-e ENCODING] [INPUT] [OUTPUT] .PP Minify HTML .SS "positional arguments:" .TP INPUT File path to html file to minify. Defaults to stdin. .TP OUTPUT File path to output to. Defaults to stdout. .SS "optional arguments:" .TP \fB\-h\fR, \fB\-\-help\fR show this help message and exit .TP \fB\-c\fR, \fB\-\-remove\-comments\fR When set, comments will be removed. They can be kept on an individual basis by starting them with a '!': . The '!' will be removed from the final output. If you want a '!' as the leading character of your comment, put two of them: . .TP \fB\-s\fR, \fB\-\-remove\-empty\-space\fR When set, this removes empty space betwen tags in certain cases. Specifically, it will remove empty space if and only if there a newline character occurs within the space. Thus, code like \&'x y' will be left alone, but code such as \&' ... .TP .TP \&...' will become '......'. Note that this CAN break your html if you spread two inline tags over two lines. Use with caution. .TP \fB\-\-remove\-all\-empty\-space\fR When set, this removes ALL empty space betwen tags. WARNING: this can and likely will cause unintended consequences. For instance, 'X Y' will become 'XY'. Putting whitespace along with other text will avoid this problem. Only use if you are confident in the result. Whitespace is not removed from inside of tags, thus ' ' will be left alone. .TP \fB\-\-keep\-optional\-attribute\-quotes\fR When set, this keeps all attribute quotes, even if they are optional. .TP \fB\-H\fR, \fB\-\-in\-head\fR If you are parsing only a fragment of HTML, and the fragment occurs in the head of the document, setting this will remove some extra whitespace. .TP \fB\-k\fR, \fB\-\-keep\-pre\-attr\fR HTMLMin supports the propietary attribute 'pre' that can be added to elements to prevent minification. This attribute is removed by default. Set this flag to keep the 'pre' attributes in place. .TP \fB\-a\fR PRE_ATTR, \fB\-\-pre\-attr\fR PRE_ATTR The attribute htmlmin looks for to find blocks of HTML that it should not minify. This attribute will be removed from the HTML unless '\-k' is specified. Defaults to 'pre'. .TP \fB\-p\fR [TAG [TAG ...]], \fB\-\-pre\-tags\fR [TAG [TAG ...]] By default, the contents of 'pre', and 'textarea' tags are left unminified. You can specify different tags using the \fB\-\-pre\-tags\fR option. 'script' and 'style' tags are always left unmininfied. .TP \fB\-e\fR ENCODING, \fB\-\-encoding\fR ENCODING Encoding to read and write with. Default 'utf\-8'. When reading from stdin, attempts to use the system's encoding before defaulting to utf\-8.