HTML Tidy-050722

Introduction to HTML Tidy

The HTML Tidy package contains a command line tool and libraries used to read HTML, XHTML and XML files and write cleaned up markup. It detects and corrects many common coding errors and strives to produce visually equivalent markup that is both W3C compliant and compatible with most browsers.

Package Information



HTML Tidy is updated very frequently by its maintainers, and the source package listed above may not be available at the listed URL due to the release of a newer version. The most current source package can be always be downloaded from If this version is newer than the version listed above, the following instructions should work, but have not yet been tested by BLFS. If you'd rather download the version listed above, you can find it at

Additional Downloads



HTML Tidy Dependencies

Recommended (To Build the Man Page and Quick Reference Docs)




Installation of HTML Tidy

The HTML Tidy documentation is contained in a separate tarball. Unpack both the source and docs tarballs before starting the build.

Install HTML Tidy by running the following commands:

patch -Np1 -i ../tidy-050722-prevent_PRE_newlines-1.patch &&
sh build/gnuauto/ &&
./configure --prefix=/usr &&

This package does not come with a test suite.

Now, as the root user:

make install

If you have libxslt-1.1.14 installed, issue the following commands as an unprivileged user to build the man page and HTML documentation:

cd htmldoc &&
tidy -xml-help > tidy-help.xml &&
tidy -xml-config > tidy-config.xml &&
xsltproc -o tidy.1 tidy1.xsl tidy-help.xml &&
xsltproc -o quickref.html quickref-html.xsl tidy-config.xml &&
cd ..

If you built the man page and the Quick Reference HTML file, install the man page by issuing the following command as the root user:

install -v -m644 htmldoc/tidy.1 /usr/share/man/man1

Now finish the installation by installing the pre-built documentation as the root user:

install -v -m755 -d /usr/share/doc/tidy &&
cp -v -R htmldoc/* /usr/share/doc/tidy

Command Explanations

sh build/gnuauto/ This command prepares the source tree for building using the GNU “Auto” tools.

Configuring HTML Tidy

Config Files

The absolute path of the file specified in $HTML_TIDY.

Configuration Information

The default configuration options can be set in the file defined in $HTML_TIDY. Additional configuration options can be passed to tidy via command line parameters or the -config <file> parameter.


Installed Programs: tab2space and tidy
Installed Library: libtidy.[so,a]
Installed Directory: /usr/share/doc/tidy

Short Descriptions


is a utility to expand tabs and ensure consistent line endings.


validates, corrects, and pretty-prints HTML files.


libraries provide the HTML Tidy API functions to tidy and can also be called by other programs.

Last updated on 2005-08-01 13:29:19 -0600