Forum Moderators: open
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! ;)