Tidy Service

Updated: 2007.04.09
Author: Scott Ahten
pixel at pixelfreak dot net


WHAT IS IT?

Tidy Service is a OS X Service that cleans up markup
using the powerful HTML Tidy library originally created by
Dave Raggett. The version of HTML Tidy used in this build
corresponds to the binary version released on February 11th, 2007.

You can find out more information about HTML Tidy at...

http://tidy.sourceforge.net/

HOW DO I INSTALL IT?

Tidy Service can be installed for a single user or for all
users on your system by copying the TidyService.service file
to the appropriate location.

Singe user: /Users/<your home directory>/Library/Services/
All users: /Library/Services/

Note: You may need to create the directory "Services" if it
does not already exist.

Update: After copying the file to the correct location, Tidy Sevice
will not appear in the Services menu until you log-out, then log-in
again or restart your system. (thanks to Samuel Miller for reporting
this issue) This is also required after installing a new version of Tidy Service.

HOW DO I USE IT?

Tidy Service can be used to clean up HTML markup in any
application that supports services by selecting the
markup in question and choosing one of the Tidy menu items
from the Services menu.



Currently, there are two processing options: Tidy Markup and
Tidy to XHTML. Tidy to XHTML instructs the Tidy engine to
generate valid XHTML, while Tidy Markup does not.

In addition, you can override any of the default HTML Tidy
options by creating a HTML Tidy config file in your home
folder called "TidyService.conf". Note: The name of the file is
case sensitive.

On my system, this file is located at..

/Users/scott/TidyService.conf

Here's a few of the most commonly used options and example values.

indent: yes
indent-spaces: 2
wrap: 72
markup: yes
output-xml: no
input-xml: no
show-warnings: yes
numeric-entities: yes
quote-marks: yes
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no

A detailed listing of options can be found at the following URL...

http://tidy.sourceforge.net/docs/quickref.html

In this version of Tidy Service, warnings and errors detected
are sent to the console. You can view this output by running the
Console application found at /Applications/Utilties/Console. February 11th, 2007

VERSION HISTORY

1.1.0 - 2007.04.09 :

. Tidy Service is now a Universal Binary
- Added display of warnings and errors. (truncated)
- Improved text handling with with non UTF-8 encoding
- Updated to HTML Tidy library released on February 11th, 2007

1.0.1 - 2005.02.23 : Updated to HTML Tidy library released on February 1st, 2005.

1.0 - 2004.08.29 : Inital Release

 

WHAT'S NEXT?

Planned improvements include...

- Better display of warnings and errors
- GUI for HTML Tidy options

FEEDBACK

Have a feature suggestion? Something not working as advertised?
Send bug reports and suggestions to pixel at pixelfreak dot net.

FAQ

Q: I'm trying to use Tidy Service with application xyz,
but the Service menu items are grayed out. What's the dealio?

A: Tidy Service only works with applications which support
OS X Services. Many Carbon applications (cough...
Dreamweaver ... cough) do not support services at this
time. If you're intersted in using Tidy Service with an unsported application, I recommend
contacting the developers to request support
in a future release. In addition, menu items will not
be enabled unless you select markup in your application.

Q: Help! Tidy Service is adding / removing / doing annoying things
while processing my markup? Make it stop!

A: There are several HTML Tidy options that can restore order to
your markup processing world. Create a file called "TidySerivce.conf"
in your home directory and add one or more commands found on
the HTML Tidy quick-start page found at..

http://tidy.sourceforge.net/docs/quickref.html

Q: Are there separate config files for Tidy Markup and Tidy to XHTML?

A: No. Both Tidy Markup and Tidy to XHTML share the same settings found in TidyService.conf. Tidy to XHTML simply adds 'output-xhtml: yes' to any options you may have specified.

Q: Hey! Where did the warnings and errors go? I know you're hiding them somewhere...

A: Only the first 5-6 errors are displayed onscreen. The remaining output from HTML Tidy is sent to the console. Errors and warnings can be viewed by opening the the Console application, located in the Utilities subdirectory of your Applications folder. A future version of Tidy Service will optionaly show errors and warnings in a text area.

LEGAL STUFF

Tidy Service is copyright 2004-2007 Scott Ahten and is free for
personal or commercial use. You may redistribute Tidy Service
as long as a link to this document is included in the distribution. You may
not charge for distribution beyond reasonable costs for media or
delivery services.

THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
HOLDERS 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.

COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
SOFTWARE OR DOCUMENTATION.

Tidy Service contains source code from HTML Tidy, originally
created by Dave Raggett and Copyright 2004-2003 World Wide Web
Consortium.

http://tidy.sourceforge.net/license.html