![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
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?
|
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: at my computer desk
Posts: 138
Rep Power: 3
![]() |
you can make your own in C++
|
|
|
|
|
|
#3 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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. |
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: at my computer desk
Posts: 138
Rep Power: 3
![]() |
cant you make a text editor in C++ that does that?
|
|
|
|
|
|
#5 |
|
Programming Guru
![]() |
HTML TIDY is a good tool for cleaning up HTML. I don't think it works on CSS, however.
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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. |
|
|
|
|
|
|
#8 |
|
Professional Programmer
Join Date: Feb 2005
Location: PA, USA
Posts: 254
Rep Power: 4
![]() |
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.
__________________
I have never let my schooling interfere with my education. -Mark Twain- Xbox live gamertag: melbolt |
|
|
|
|
|
#9 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#10 | |
|
Newbie
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|