This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Running Tidy on generated content



>> # 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]