Regular Expression Puzzle

Andrew Kane googoleyes at gmail.com
Sun Nov 29 19:32:33 UTC 2009


It reads to me as though he's trying to change semantic elements in
the markup rather than look-and-feel changes.
My suggestion would be instead to use the "id" attribute for each of
the divs in question (in case he later wants to address them
separately for css or search / replace) and to use sed as discussed
above to search & replace- except that I would possibly recommend to
include both lines in the file and just comment out the one I don't
want.
As you say, he should be using generated pages.

On Sun, Nov 29, 2009 at 7:26 AM, Hal Burgiss <hal at burgiss.net> wrote:
> On Sun, Nov 29, 2009 at 09:53:09AM -0500, Alan McKay wrote:
>> > Those sample lines iI provided are from the navigation links I put at
>> > the top of all of my web pages, and it would be nice to do a broadcast
>> > change to update, or change their appearance instead pf having to edit
>> > every single file by hand, which takes hours.
>>
>> You need a different approach to that problem - you should be using
>> generated pages
>
> Even better, if I read the intent right as being a change to the look/feel of
> the document, is to use css, which is around for just the reason. Apply a
> 'class' to each like element, put a definition in the site's stylesheet, and
> then when you want a global change, you can do it with a one line edit to that
> css rule.
>
> Also, if there is some consistency to the markup, you can use jQuery to
> dynamically to it all:
>
> <script type="text/javascript">
>        $("div a").css({'color:purple','background':'#ccc','font-weight':'bold'});
> </script>
>
> which would handle any anchor tag that is a child of a div tag. jQuery will be
> more useful though with good use of css selectors in the markup itself.
>
> --
> Hal
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>




More information about the ubuntu-users mailing list