Re: SSI support

>>>>> On Wed, 10 May 2000, "Egor" == Egor Shokurov wrote:

Egor> Any opinions how to do that without modifying Tidy?

 and later lange@cyperfection.de said:
>with minor modifications, you could use the PERL wrapper for tidy that
>I am  currently writing. It should do what you want - parse and
>correct the  content of your shtml-file and strip tidy's added
>document tags.

Egor,

I too work mostly with SSI's. The script that Sebastian Lang is working on is 
a polished function that will do what you want. Until his is ready for 
prime-time, you can use the attached Perl script. I call it "stidy"; it's a 
fairly crude solution but it's a functional utility that does exactly what you 
need.  It basically just runs Tidy on your file, then strips out all 
document-level tags. I've been using it quite successfully for almost a week 
to clean up my SSI/CGI programs.

Usage is simple and mimic's Tidy's:

stidy inputFile.txt > outputFile.txt

Notes:

It's only a wrapper, so I didn't bother getting very elaborate with options; 
(just use -c to specify your Tidy's config file and you can use all your 
favorite Tidy options). As such, I did add two options for xhtml/indentation, 
respectively, because I personally toggle those two a lot from the command 
line...

Just run stidy -h for help/usage. Comments in the script are self-explanatory. 


- I don't know if this works under Windows or not. I can't see any reason for 
it not to, but I haven't bothered to trying...

Perhaps you can play with/improve it and send feedback to the list, myself and 
most importantly Sebastian, so he can incorporate any input into his final, 
program.

Enjoy!

(Hey Sebastian: this version has a few minor changes from the one I sent you 
yesterday.)
~pete

Received on Wednesday, 10 May 2000 15:35:36 UTC