README.txt
----------

TclTidy 1.0

This release of TclTidy provides a Tcl Extension for the Tidy program
written by Dave Raggett <dsr@w3.org>.  The changes involved to produce
this extension required changes to just about every file from the Tidy
sources, and this README.txt is provided to inform the user that the
code is not the original as provided at the Tidy homepage at the W3C.

The changes for TclTidy are Copyright (c) 2000 Ajuba Solutions, Inc.
and are provided under the terms of the original Copyright Notice of
Tidy (see tidy.cpp):

  COPYRIGHT NOTICE:
 
  This software and documentation is provided "as is," and
  the copyright holders and contributing author(s) make no
  representations or warranties, express or implied, including
  but not limited to, warranties of merchantability or fitness
  for any particular purpose or that the use of the software or
  documentation will not infringe any third party patents,
  copyrights, trademarks or other rights. 

  The copyright holders and contributing author(s) will not be
  liable for any direct, indirect, special or consequential damages
  arising out of any use of the software or documentation, even if
  advised of the possibility of such damage.

  Permission is hereby granted to use, copy, modify, and distribute
  this source code, or portions hereof, documentation and executables,
  for any purpose, without fee, subject to the following restrictions:

  1. The origin of this source code must not be misrepresented.
  2. Altered versions must be plainly marked as such and must
     not be misrepresented as being the original source.
  3. This Copyright notice may not be removed or altered from any
     source or altered source distribution.
 
  The copyright holders and contributing author(s) specifically
  permit, without fee, and encourage the use of this source code
  as a component for supporting the Hypertext Markup Language in
  commercial products. If you use this source code in a product,
  acknowledgment is not required but would be appreciated.

Tcl Extension
-------------

The Tcl extension is provided as a shared library.  In order to
accomplish this, the code in Tidy needed to be modified to handle
input and output buffers instead of from files/stdin/stdout/stderr.
In addition, the code was change to C++ in order to use namespaces to
achieve unique names in the shared library, in order to prevent symbol
collisions on platforms where loading shared libraries may cause such
behavior (such as Solaris).

Usage:
------

Using TclTidy is pretty simple, the package name is "Tidy" and it
contains one command, "tidy" which has the following syntax:

  tidy [-<option> <value>]* <inputbuffer>

Where <option is any of the options listed in the documentation for
the Configuration File options of Tidy, with a few modifications (see
below).  The command-line version of Tidy uses a -- to indicate using
an option of that form, where the Tcl extension uses just - to
indicate it.  Here is an example:

   tidy -indent 1 -indent-spaces 4 -tidy-mark 0 -output-xhtml 1 $data

This takes a buffer of HTML data, stored in the Tcl variable "data",
converts it to XHTML, indents the result with an indent size of 4
spaces, and does not leave the Tidy meta tag in the result. The result
is returned as the return value of the procedure call.

The following changes were made regarding the options:

    * show-warnings  ---  the default is "no"
    * tidy-mark      ---  the default is "no"
    * char-encoding  ---  since Tcl uses UTF-8, this option has been
                          disabled in the Tcl extension
    * error-file     ---  this option does not make sense when using
                          buffers and has been disabled
    * slide-style    ---  this option does not make sense when using
                          buffers and has been disabled
    * verbose        ---  This option has been added and causes the
                          error summary to be produced with a boolean
                          value of yes, the default is "no" in the Tcl
			  extension but the equivalent behavior in the
			  Tidy program is to produce the summary

Download
--------

The TclTidy sources are currently available from the Ajuba Solutions
public NetCVS server.  Tarballs (or zip files) of the sources and
possibly binary releases may become available in the future on the FTP
site.  To access the NetCVS server, see the following URL:

    http://dev.scriptics.com/software/tcltk/netcvs.html

The CVS module name for the TclTidy sources is "tidy", although it may
not be listed on the web page.

        
Installation
------------

TclTidy is set up to use the Tcl Extension Architecture (TEA) build
system.  It requires the use of cygwin and VC++ 5.0+ to build on
Windows.  On Unix, only GCC has been tested, but any C++ compiler that
has support for namespaces should work (but may require changes to the
configure script).  To find more information on TEA, see the following
web site:

    http://dev.ajubasolutions.com/doc/tea/

Once you uncompress, unzip, or get the sources using NetCVS, you need
to perform the following steps:

   cd tidy
   autoconf
   configure --with-tcl=<path-to-tcl> <other-options> --prefix=<installdir>
   make
   make install

The other options should include "--enable-gcc" if you are using GCC.
The same process works on Windows using cygwin.

Binary distributions may become available on the Ajuba Solutions FTP
site.


Future Work
-----------

I would like to find some way of merging these changes with the
original Tidy sources and plan on working with the Tidy community and
Dave Raggett to accomplish this (if they are willing).


Acknowledgements
----------------

Dave Raggett (HP) for writing such a cool program and being supportive of
this effort.
Dan Kuchler (Ajuba) for pawning this work off onto me and using the
result in his work with the Ajuba3 product (B2B XML Server/Authoring
tool).
Ajuba Solutions for agreeing to release this code back into the
community.


Scott Redman
Software Engineering Manager
Ajuba Solutions, Inc.

redman@ajubasolutions.com

