|
Posted by Ben C on 02/16/07 22:49
On 2007-02-16, dorayme <doraymeRidThis@optusnet.com.au> wrote:
> In article
><1171622169.646616.165350@k78g2000cwa.googlegroups.com>,
> "Andy Dingley" <dingbat@codesmiths.com> wrote:
>
>> On 16 Feb, 03:09, dorayme <doraymeRidT...@optusnet.com.au> wrote:
>>
>> > This is very easy technically. This is what I do: search for
>> > instances of ids and classes in the html files by using Search
>> > and Replace functions that come with any decent text editor.
>>
>> That sounds like hard work!
>
> Oh well, perhaps there are things I am missing. But I suspect -
> perhaps unfairly - that there is a Force of Unnecessary
> Complexity secretly acting on earthlings.
>
> I have done these things without much work at all, see my
> previous reply.
>
> Perhaps I need to explain more? The OP had a problem we all
> confront. Simple enough in most cases no matter how big the site.
>
> Suppose you want to know if a #navMonday css instruction can be
> safely removed from your CSS sheets. All you have to do is search
> for ' id="navMonday" ' over the folder that contains all the
> website files. It is a button press. What is hard about it? If
> the search comes up with nothing, you search for '#navMonday' and
> all instances in your css will show up and you delete them by
> hand because they are there at your fingertips (see my previous
> post). You can, when you get good at the S & R function be a
> little cleverer and get any class (as well as or instead of id)
> of this name. You can replace instances with nothing and so fix
> all up automatically. But for most situations it is so quick and
> easy, why bother your head, it is the finding not the deleting
> that takes time. I doubt many would need fancy doodle perling and
> reg exping and generally tooling about in some macho V8 flexing
> about...
The only detraction with your way of doing it is that don't you have to
manually do the search and replace for each class or id that you're
concerned with? Ideally one would like to get the complete list of dead
classes and ids in one go, and then maybe also delete them in one go.
It's quite interesting to see what different people's approaches are to
this.
Of course it depends how many there are to deal with. If it's a huge
site with thousands of them, or if I found myself making a habit of it,
I'd write a Python program. If there were about 20 or 30, I'd mess about
with grep and the editor in unnecessarily complex ways, get it all wrong
several times, take longer but have more fun; if there were only about 4
I'd do simple search and replacing.
Navigation:
[Reply to this message]
|