Forum Moderators: phranque
HTML Tidy is well integrated into my editor -- HTML-Kit. In it, there's an option to output only the content within the body of my documents. This is a nice feature that works well on a per-file basis. I especially like it b/c I prefer for everything from the doctype thru the opening body tag in my files to be left-justified (no tag indentation), while I prefer indentation within the body. If I simply run Tidy on the entire file, it indents everything from beginning to end.
In any event, I've got thousands of files that I've inherited from a legacy project, and I would like to prettify/modify batches of the files in a single operation.
Thus far, I have noodled with the Tidy command-line and have sort of dead-ended with the following:
C:\tidy>tidy --show-body-only yes --write-back yes --vertical-space yes c:\temp\foo.htm
which does the trick EXCEPT for a major drawback -- it removes the doctype, head, opening body, closing body, and html tags. This is obviously a complete show-stopper.
Does anyone know of a way to use Tidy across multiple files (batch process) to prettify/modify only the body content within them w/out stripping off the content that's not within the scope of the show-body-only argument?
I destroyed my site with HTML Tidy
[webmasterworld.com...]
several options to edit multiple files simultaneously are discussed here:
How to edit a bunch of static HTML files at once?
[webmasterworld.com...]