.\" tidy man page for the HTML Tidy
.TH TIDY 1 "" "HTML Tidy" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH NAME
\fBtidy\fR - check, correct, and pretty-print HTML(5) files
.SH SYNOPSIS
\fBtidy\fR [\fIoptions\fR] [\fIfile\fR ...] [\fIoptions\fR] [\fIfile\fR ...] ...
.SH DESCRIPTION
Tidy reads HTML, XHTML, and XML files and writes cleaned-up markup.
For HTML variants, it detects, reports, and corrects many common coding errors
and strives to produce visually equivalent markup that is both conformant
to the HTML specifications and that works in most browsers.
.LP
A common use of Tidy is to convert plain HTML to XHTML.
For generic XML files, Tidy is limited to correcting basic well-formedness
errors and pretty printing.
.LP
If no input file is specified, Tidy reads the standard input.
If no output file is specified, Tidy writes the tidied markup to the
standard output. If no error file is specified, Tidy writes messages
to the standard error.
.SH OPTIONS
Tidy supports two different kinds of options.
Purely \fIcommand-line\fR options, starting with a single dash '\fB-\fR',
can only be used on the command-line, not in configuration files.
They are listed in the first part of this section.
\fIConfiguration\fR options, on the other hand, can either be passed
on the command line, starting with two dashes \fB--\fR,
or specified in a configuration file,
using the option name without the starting dashes.
They are listed in the second part of this section.
.LP
For \fIcommand-line\fR options that expect a numerical argument,
a default is assumed if no meaningful value can be found.
On the other hand, \fIconfiguration\fR options cannot be used
without a value; a \fIconfiguration\fR option without a value
is simply discarded and reported as an error.
.LP
Using a \fIcommand-line\fR option is sometimes equivalent to setting
the value of a \fIconfiguration\fR option. The equivalent option
and value are shown in parentheses in the list below, as they would
appear in a configuration file. For example,
\fB-quiet, -q\fR (\fIquiet: yes\fR) means that using the
\fIcommand-line\fR option \fB-quiet\fR or \fB-q\fR
is equivalent to setting the \fIconfiguration\fR option
\fIquiet\fR to \fIyes\fR.
.LP
Single-letter \fIcommand-line\fR options without an associated value
can be combined; for example '\fB-i\fR', '\fB-m\fR' and '\fB-u\fR'
may be combined as '\fB-imu\fR'.
.LP
\fIConfiguration\fR options can be specified
by preceding each option with \fB--\fR at the command line,
followed by its desired value,
OR by placing the options and values in a configuration file,
and telling tidy to read that file with the \fB-config\fR option:
.LP
.in 1i
\fBtidy --\fR\fIoption1 \fRvalue1 \fB--\fIoption2 \fRvalue2 ...
.br
\fBtidy -config \fIconfig-file \fR ...
.LP
\fIConfiguration\fR options can be conveniently grouped
in a single config file.
A Tidy configuration file is simply a text file, where each option
is listed on a separate line in the form
.LP
.in 1i
\fIoption1\fR: \fIvalue1\fR
.br
\fIoption2\fR: \fIvalue2\fR
.br
etc.
.LP
The permissible values for a given option depend on the option's Type.
There are five Types: \fIBoolean\fR, \fIAutoBool\fR, \fIDocType\fR,
\fIEnum\fR, and \fIString\fR.
\fIBoolean\fR Types allow any of \fByes/no, y/n, true/false, t/f, 1/0\fR.
\fIAutoBool\fRs allow \fBauto\fR in addition to the values allowed
by \fIBooleans\fR.
\fIInteger\fR Types take non-negative integers.
\fIString\fR Types generally have no defaults, and you should provide them in
non-quoted form (unless you wish the output to contain the literal quotes).
.LP
\fIEnum\fR, \fIEncoding\fR, and \fIDocType\fR Types have a fixed repertoire
of items, which are listed in the \fISupported values\fR sections below.
.LP
You only need to provide options and values for those whose defaults you wish
to override, although you may wish to include some already-defaulted options
and values for the sake of documentation and explicitness.
.LP
Here is a sample config file, with at least one example of each of
the five Types:
.LP
\fI// sample Tidy configuration options
output-xhtml: yes
add-xml-decl: no
doctype: strict
char-encoding: ascii
indent: auto
wrap: 76
repeated-attributes: keep-last
error-file: errs.txt
\fR
.LP
Below is a summary and brief description of each of the options.
They are listed alphabetically within each category.
.SH ENVIRONMENT
.TP
.B HTML_TIDY
Name of the default configuration file. This should be an absolute path,
since you will probably invoke \fBtidy\fR from different directories.
The value of HTML_TIDY will be parsed after the compiled-in default
(defined with -DTIDY_CONFIG_FILE), but before any of the files specified
using \fB-config\fR.
.TP
.B RUNTIME CONFIGURATION FILES
You can also specify runtime configuration files from which \fBtidy\fR will
attempt to load a configuration automatically.
.IP
The system runtime configuration file (),
if it exists will be loaded and applied first, followed by the user runtime
configuration file ().
Subsequent usage of a specific option will override any previous usage.
.IP
Note that if you use the \fBHTML_TIDY\fR environment variable, then the user
runtime configuration file will not be used. This is a feature, not a bug.
.SH "EXIT STATUS"
.IP 0
All input files were processed successfully.
.IP 1
There were warnings.
.IP 2
There were errors.
.SS File manipulation
file-manip
.SS Processing directives
process-directives
.SS Character encodings
char-encoding
.SS Miscellaneous
misc
.SS XML
xml
.TP
\fB\fR
,
(\fI
\fR)
.SS Document Display options
TidyDisplay
.SS Document In and Out options
TidyDocumentIO
.SS File Input-Output options
TidyFileIO
.SS Diagnostics options
TidyDiagnostics
.SS Encoding options
TidyEncoding
.SS Cleanup options
TidyMarkupCleanup
.SS Entities options
TidyMarkupEntities
.SS Repair options
TidyMarkupRepair
.SS Transformation options
TidyMarkupXForm
.SS Teaching Tidy options
TidyMarkupTeach
.SS Pretty Print options
TidyPrettyPrint
.rs
.TP
\fB
--
\fR
\fI
\fR
.br
See also:
\fB--\fR
,
(
\fB
\fR
if unset)
Supported values:
\fB
\fR
.SH SEE ALSO
For more information about HTML Tidy:
.RS 4
.LP
http://www.html-tidy.org/
.RE
.LP
For more information on HTML:
.RS 4
.LP
\fBHTML: Edition for Web Authors\fR (the latest HTML specification)
.br
http://dev.w3.org/html5/spec-author-view
.LP
\fBHTML: The Markup Language\fR (an HTML language reference)
.br
http://dev.w3.org/html5/markup/
.RE
.LP
For bug reports and comments:
.RS 4
.LP
https://github.com/htacg/tidy-html5/issues/
.RE
.LP
Or send questions and comments to \fBpublic-htacg@w3.org\fR.
.LP
Validate your HTML documents using the \fBW3C Nu Markup Validator\fR:
.RS 4
.LP
http://validator.w3.org/nu/
.RE
.SH AUTHOR
\fBTidy\fR was written by \fBDave Raggett\fR <dsr@w3.org>,
and subsequently maintained by a team at http://tidy.sourceforge.net/,
and now maintained by \fBHTACG\fR (http://www.htacg.org).
.LP
The sources for \fBHTML Tidy\fR are available at
https://github.com/htacg/tidy-html5/ under the MIT Licence.
at \fI\fR
\fI
\fR
\fB
\fR
.sp 1
.sp 1
.sp 1
.sp 1
\fB\fR