HTML Tidy  5.6.0
The HTACG Tidy HTML Project
Tidy Options and Configuration

From the Terminal (Console)

To get a list of available options, use:

tidy -help

To get a list of all configuration settings, use:

tidy -help-config

To read the help output a page at time, pipe it to a pager, e.g.,:

1 tidy -help | less
2 tidy -help-config | less

Single-letter options other than -f may be combined; for example:

tidy -f errs.txt -imu foo.html

Using a configuration file

The most convenient way to configure Tidy is by using separate configuration file.

Assuming you have created a Tidy configuration file named config.txt (the name and extension don’t matter), you can instruct Tidy to use it via the command line option -config config.txt; for example:

tidy -config config.txt file1.html file2.html

Alternatively, you can name the default config file via the environment variable named HTML_TIDY, the value of which is the absolute path for the config file.

You can also set config options on the command line by preceding the name of the option immediately (no intervening space) with the string "`--`"; for example:

tidy --break-before-br true --show-warnings false

You can find Quick Reference documentation for your version of Tidy that describe the full set of configuration options on our API and Quick Reference Page.

Sample Configuration File

The following is an example of a Tidy config file.

1 // sample config file for HTML tidy
2 indent: auto
3 indent-spaces: 2
4 wrap: 72
5 markup: yes
6 output-xml: no
7 input-xml: no
8 show-warnings: yes
9 numeric-entities: yes
10 quote-marks: yes
11 quote-nbsp: yes
12 quote-ampersand: no
13 break-before-br: no
14 uppercase-tags: no
15 uppercase-attributes: no
16 char-encoding: latin1
17 new-inline-tags: cfif, cfelse, math, mroot,
18  mrow, mi, mn, mo, msqrt, mfrac, msubsup, munderover,
19  munder, mover, mmultiscripts, msup, msub, mtext,
20  mprescripts, mtable, mtr, mtd, mth
21 new-blocklevel-tags: cfoutput, cfquery
22 new-empty-tags: cfelse