home  documentation  examples downloads

Below are some examples of how to use HTB.

- Make Tags and Attributes lower case and use 4 for indenting.
"htb -l4 index.html newindx.html"

- Make Tags and Attributes upper case (default) and use 2 for indenting.
"htb -2 index.html newindx.html"

- Defaults + no Tag breaking, remove comments & treat non-HTML tags as XML.
"htb -nxz index.html newindx.html"

The content of HTML files can vary wildly, and the default behavior may not always be the best. Experiment with several options first. The options "-as", "-ams", and "-n" have given good results also.

Modern browsers are amazingly forgiving of poorly written HTML. HTB will usually report the line number and text of offending tags and ignores them in the re-formatting process. Occasionally with quoting inconsistencies, HTB will stop re-formatting at the point the problem was found.

This reporting mechanism makes HTB useful as a simple syntax validator, even if the generated output is not saved. HTB does not attempt to correct invalid files and in most cases still does a good job of re-formatting.

If syntax correction is needed, try Tidy from W3C which is a very good cleanup program. Tidy may even be used in combination with HTB using command-line piping and the HTB -f option. A companion command file, "runhtb.bat" for Windows NT/2000/XP allows conversion of multiple files directly from a Desktop icon.