This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: Running Tidy on generated content
- From: Rory Hunter <roryh at dcs dot ed dot ac dot uk>
- Cc: Carlos <carlos at cvc dot edu>,"docbook-apps at lists dot oasis-open dot org" <docbook-apps at lists dot oasis-open dot org>
- Date: Tue, 15 Jan 2002 19:24:45 -0500
- Subject: Re: DOCBOOK-APPS: Running Tidy on generated content
- Organization: That'll be the day
- References: <B869ABA4.2F6D%carlos@cvc.edu> <3C44B504.6070702@dcs.ed.ac.uk>
>> # How do you make the line below work
>> # @tidy *.html > *.html
>
> You want the "-m" flag, for "modify file". Check the output of -h.
Should have added this really;
roryh@ulfr tmp 0 1921>> ls
ed.html google.html redhat.html
roryh@ulfr tmp 0 1921>> /usr/local/bin/tidy -i -m -wrap 80 *.html
This does what you want (plus indenting and line wrapping). Again, check
the output of tidy -h.
For even more fun, add this to ~/.bashrc
tidy ()
{
local EXT=$(echo $1 | perl -pe 's/^.*\.(\w+)$/\L$1/');
case $EXT in
html)
TIDYARGS='-i -m -wrap 80'
;;
xml)
TIDYARGS='-i -m -xml -wrap 80'
;;
*)
TIDYARGS=
;;
esac;
# Or wherever...
/usr/local/bin/tidy $TIDYARGS $*
}
--
roryh