Regular Expression Puzzle

Hal Burgiss hal at burgiss.net
Sun Nov 29 15:26:13 UTC 2009


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




More information about the ubuntu-users mailing list