On Mar 19, 2008, at 8:28 PM, Jonathan Rockway wrote: > * On Wed, Mar 19 2008, Sean Allen wrote: >> Thanks for the help. It got me a long way towards realizing that a >> with our templates, we just arent going to make it all the way. >> hmmm.. basic to square one on figuring out a way to mass clean them >> up. > > When I'm in this sort of situation, I usually write a program that I > can > run inside my text editor. Heuristics do most of the work, but it's > easy for me to manually edit something when an odd case arises. > > In one case, I needed to convert a $LARGE_COMPANY's website from a > bunch > of static pages to a site that was CMS-based. Basically I had to open > every file, move the content into a correctly-named CMS file, then > add a > an include statement to include the CMS engine in each of those files. > Since there were thousands of pages, I knew I was never going to > finish > it manually and so I automated it :) > > Basically, I wrote an emacs program that made a list of all the files > that needed to be modified, then opened them one at a time, applied a > minor mode that guessed the content (and applied a text property to > change the color, centered the content in my window, and added a > keymap > to let me select the start and end of the content), and then did the > necessary editing and file creation when I said I was ready to commit. > It worked great, and I finished the conversion in a few hours (after > spending a week learning emacs lisp). > > I think I still have the code around somewhere... if anyone wants it I > can give it to you. But it comes with no warranty because it's > junk :) >
I found a bundle ( aka mode ) for Textmate that got me 90% of the way there... a few regex got me the first 10% ( and some automations ) So basically, something rather similar. Which I had found it before I spent 6 hours today fighting with tidy before giving up. _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
