Welcome to WebmasterWorld Guest from 54.166.46.226

Forum Moderators: travelin cat

Message Too Old, No Replies

Debloater for Mac HTML

Does one exist?

   
12:41 pm on Mar 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Anyone know of a program that will trawl a website on local disc and remove all the comments from the HTML?

I know that sounds like a daft thing to do, but I have a website based on Dreamweaver templates and libraries, for which the amount of "bloat" with dozens of "<--InstanceBeginEditable"s is adding about 15% to my website size and monthly bandwidth cost.

DerekH

1:11 pm on Mar 31, 2005 (gmt 0)

10+ Year Member



BBEdit has a remove comments tool. It's such a useful piece of software, I'd recommend it to any mac webmaster.

IIRC, BBEdit tools only work on the active window. If you want to de-comment your whole site at once, you could put together a find/replace that uses regular expressions and runs against a directory.

A bit more set up, but much quicker for more than a handful of pages.

1:56 pm on Mar 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And the regular expression Deodato mentions might look like this:

<!--.¦\r*?-->

Do Apple-F, click "Use grep" to do the regular expression thing, and extend selection to match multiline comments.

Definitely back up your site first, though.

Also, if you don't want to spend money today, TextWrangler will do the same thing in the same way. It's a free product from the same company that makes BBEdit.

3:48 pm on Mar 31, 2005 (gmt 0)

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Regarding the regular expression above, that might strip out commented CSS styling and javascript blocks, so you'd want to have a more specific regex.

I have a website based on Dreamweaver templates and libraries

It adds a step, but if you have Dreamweaver and are using templates and libraries there is an option to publish a site with all the comments and other dreamweaver junk ripped out. Look for it here:

Modify Menu > Templates > Export without Markup...

Just make sure to export to a new folder and to backup before doing it. :)

3:50 pm on Mar 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



DW can also do the regex in a site wide find and replace ..
11:11 pm on Mar 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Modify Menu > Templates > Export without Markup...

Now I feel REALLY stupid!
Thank you.
I really must read the online help more carefully (I lost the plot after the first 2000 pages!)

Thanks
DerekH

2:29 pm on Apr 3, 2005 (gmt 0)