HTML Tidy
5.1.25
The HTACG Tidy HTML Project
|
This is the syntax for invoking Tidy from the command line:
Tidy defaults to reading from standard input, so if you run Tidy without specifying the filename argument, it will just sit there waiting for input to read.
Tidy defaults to writing to standard output. So you can pipe output from Tidy to other programs, as well as pipe output from other programs to Tidy. You can page through the output from Tidy by piping it to a pager, e.g.:
To have Tidy write its output to a file instead, either use the
option, or redirect standard output to the file. For example:
All the above run Tidy on the file index.html
and write the output to the file output.html
, while writing any error messages to standard error.
Tidy defaults to writing its error messages to standard error (that is, to the console where you’re running Tidy). To page through the error messages along with the output, redirect standard error to standard output, and pipe it to your pager:
To have Tidy write the errors to a file instead, either use
option, or redirect standard error to a file:
Both the above run Tidy on the file index.html
and writes the output to the file output.html
, while writing any error messages to the file errs.txt
.
Writing the error messages to a file is especially useful if the file you are checking has many errors; reading them from a file instead of the console or pager can make it easier to review them.
You can use the or -m
or -modify
option to modify (in-place) the contents of the input file you are checking; that is, to overwrite those contents with the output from Tidy. For example:
That runs Tidy on the file index.html
, modifying it in place and writing the error messages to the file errs.txt
.
-m
option, you should first ensure that you have a backup copy of your file.