![]() |
Tool to find & remove unnecessary CSS?
Does anybody know of a tool that can search your css, html, jsp, asp, etc pages and find css that is duplicated or unnecessary and flag it for you?
|
you can make your own in C++
|
Quote:
Besides, so far as I can see, the problem isn't a trivial one to solve. You'd need a CSS and HTML parser just to get started. |
cant you make a text editor in C++ that does that?
|
HTML TIDY is a good tool for cleaning up HTML. I don't think it works on CSS, however.
|
I've used Tidy. I think it doesn't meet the OP's desires. He is out to find and remove duplicate or unnecessary stuff, not just correct poorly written code. How one defines "unnecessary" is obviously a factor. Even so, as Arevos mentions, it wouldn't be a trivial process. I'd rather ask if someone knows of one, than write it.
|
Quote:
I don't think C++ would be a very good language to write it, however. It doesn't particularly matter if a parser takes 100ms or 10'000ms, and efficiency is really C++'s only advantage over other languages that may be better suited for the task. Knowing when to use a language is rather important, and C++ doesn't seem like the right tool for the job in this case. Java has a lot of libraries revolving around XML DOMs, and I ran across CSSEngine for Python, which looks interesting. Javascript may also be a possibility, as you can take advantage of the browser's DOM parsing without extra libraries. However, the most efficient solution may be to do it all manually. Or find a program that already does what you need. |
maybe try visual studio.
I don't know how it works on CSS but for HTML you can go into the options and make it very anal about your code, check to make sure it meets certain standards, it will pick out every little potential wrongdoing if you set it to do so. |
Again, it isn't about wrong or dirty code. It's about duplicate, unnecessary code. One might be defining the style of the "blah" class forty-leben times, all quite beautifully.
|
Quote:
|
| All times are GMT -5. The time now is 8:03 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC