Regular Expression Puzzle

Ray Parrish crp at cmc.net
Sun Nov 29 21:22:59 UTC 2009


Hal Burgiss 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.
>   
I'm no stranger to using css and javascript to change the look of my web 
site, I even have a page where my users can select the background image, 
or color, and the text size they prefer while on my site.

That is part of the reason I wanted to have a block oriented multiple 
document search and replace editor, as when I add a new "skin" to my web 
site it necessitates that I add the new call to the new .css sheet on 
every page on my site.

I also have a button bar at the top of every page which allows changing 
the skins, and I need to add a new button, [i.e., table data cell with a 
line of code] to every page as well when I add a new skin.

Thankfully, I have my multi-document, block oriented search and replace 
program already written, so I'm good to go in that respect. I have some 
small cosmetic things to iron out with it's Xdialog provided GUI 
interface, and I haven't finished giving it the acid test to iron out 
any unexpected surprises, but it is working quite well already.

I will be releasing it as open source software on my Ray's Links site 
within the next couple of days, so have a look when it gets there. Any 
web master will benefit from it's use. It is a little slow when handling 
60 files all at once, but it is a bash script after all. 8-)

Later, Ray Parrish

-- 
The Future of Technology.
http://www.rayslinks.com/The%20Future%20of%20Technology.html
Ray's Links, a variety of links to usefull things, and articles by Ray.
http://www.rayslinks.com
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.
http://www.writingsoftheschizophrenic.com






More information about the ubuntu-users mailing list