Welcome to WebmasterWorld Guest from 54.166.54.215

Forum Moderators: open

HTML Tidy: Uses & Customizations

HTML Tidy, it's not just about pretty code.

   
8:06 pm on Jul 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One of the included utilities in Macromedia's Homesite Editor is Dave Raggett's HTML Tidy (now an open source project). Tidy also ships with a number of other programs; it is also available as a free download.

I love this program. For me, it is a great time saver: it inserts my <!doctype> of choice and formats my HTML to my specifications. I admit it: I like (love!) pretty code!

What some users might not realise is that HTML Tidy can be custom configured. You can even open the .tdy files and edit changes directly.

Here is my custom xhtml.tdy:

markup:yes
wrap:100
tab-size:1
indent:auto
indent-spaces:2
hide-endtags:no
input-xml:no
output-xml:no
output-xhtml:yes
char-encoding:ASCII
numeric-entities:no
quote-marks:no
quote-ampersand:yes
quote-nbsp:no
wrap-script-literals:no
uppercase-tags:no
break-before-br:no
uppercase-tags:no
uppercase-attributes:no
clean:no
write-back:yes
show-warnings:yes
split:no
add-xml-pi:yes
doctype:STRICT
fix-backslash:no
wrap-asp:yes
drop-font-tags:no
word-2000:no
tidy-mark:no
wrap-attributes:no
wrap-jste:no
wrap-php:no
assume-xml-procins:yes
logical-emphasis:no
drop-empty-paras:no
enclose-text:yes
fix-bad-comments:yes
keep-time:no
quiet:no
alt-text:
error-file:TidyOut.log
new-inline-tags:
new-blocklevel-tags:
new-empty-tags:<br />
new-pre-tags:
logerrors:yes
runsilently:no

/* end example */

I have several, though I tend to use this one most of the time. There are other methods to customize Tidy, but this works best for my usage. I would like to know what your opinions are and what customizations you might use.

Besides formatting code, Tidy also fixes many common, and some not so common, coding errors. I use it well before sending a page to the W3C Validator. Pretty AND useful! What a combination! ;)

9:17 pm on Jul 23, 2002 (gmt 0)

10+ Year Member



I'm an HTML tidy fan too - well sort of. I actually use JTidy which is a Java port of the original HTML tidy. I tend to use it as a plugin with jedit. The great thing about this is that because jedit is cross-platform you can use the same familiar editor for all your coding on Windows, Linux, Mac, etc..
 

Featured Threads

Hot Threads This Week

Hot Threads This Month