HTML Tidy is a tool that was originally written by Dave Raggett of the [Off Site]World Wide Web Consortium (W3C). It is designed to fix mistakes in HTML, tidy up the layout (hence the name), assist with web accessibility, convert HTML to XHTML and many other things.

The software is now maintained by a group of volunteers working as an [Off Site]Open Source Community at Source Forge and this is the place to go for more information.

The version down-loadable from this page has been taken from a recent ‘Beta’ source released by the Source Forge volunteers and compiled for Win32 using [Off Site]MinGW (Minimalist GNU for Windows). This produces a very compact binary which requires no additional libraries or environment in which to run. It is now built from the “tidylib” sources without the Asian and UTF16 character encodings or the Accessibility checks. There are two executables in the ZIP file, tidy.exe and tab2space.exe.

I try to keep my system virus free but you do check downloaded files yourself, don’t you? <g>

Download the latest version

Version of 1 Sep 2005 — built 8 Dec 2005

tidy.zip (<230K)

Signature

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3 - not licensed for commercial use: www.pgp.com

iQA/AwUAQ5i/0N+E1RVVVycKEQInFwCeLo2NeLlCWI01c3csQpCRjOj4g6wAoNSg
25sjwRsuIUOfJHquAJrJr/s1
=4h9n
-----END PGP SIGNATURE-----

My public key can be found on my home site or on the public key servers—identified by Rick Parsons & west-penwith.org.uk.

Install and Uninstall

These tools do not require any external libraries or environment. Just unzip them to where they are needed, preferably a folder which is in the search path.

Uninstall? Just delete the two files.

To run Tidy

This is a command line application so you will need a Cmd or DOS window. Make sure that the tidy.exe is in a folder contained in the search path (defined in AUTOEXEC.BAT before Win-XP or in My Computer —> Properties —> Advanced —> Environment Variables —> System Variables —> Path for Win-XP). The program is run using the command

C:\>tidy [-switches] file.htm

See the documentation at [Off Site]Source Forge for a full instruction manual.

I am unable to help with the use of this program and accept no liability for any problems with it, however caused. Use at your own risk.

Build notes

To build the tidy system you need the MinGW “composite” system (I am currently using version 3.1.0-1) and also the Make component (version 3.80.0-3). Then put the binary directory (probably C:\MinGW\bin)into the path. To do this (from an admin account in Win-XP) select My Computer —> Properties —> Advanced —> Environment Variables and edit the Path in the System Variables section adding ;C:\MinGW\bin to the end (that is a semi-colon at the start).

There were some minor issues during the build that are worth mentioning.

  1. For some reason there is no alias make or gmake in the MinGW directory so the procedure is to cd to tidy\build\gmake and issue the command mingw32-make.
  2. The make objected to all the lines of the form

    if [ ! -d $(DIR) ]; then mkdir $(DIR); fi
    

    Whether that is something fundamental I have not checked, but in the mean time a workaround is to create the required directories by hand (bin & lib in the root directory, obj in the build\gmake directory) and ignore the syntax errors. Update—with version 3.80.0-3 of make from MinGW I have had to comment these lines out of the Makefile as the syntax errors are fatal.

  3. MinGW make does not require (in fact objects to) the explicit request for the c library ( -lc switch). I commented out the line in the Makefile

    # LIBS=-lc
    

NoteTab Pro

To install as a plugin to NoteTab Pro, I use the following tidy.cfg file in the NoteTab Pro install folder. Some of these are my personal preferences.

tab-size: 8
indent: auto
enclose-text: yes
wrap-script-literals: no
tidy-mark: yes
doctype: auto
output-xhtml: yes
numeric-entities: yes
quiet: yes