Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43602 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41035 invoked from network); 2 Apr 2009 16:32:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2009 16:32:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Received: from [66.11.173.122] ([66.11.173.122:56953] helo=interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/14-22853-298E4D94 for ; Thu, 02 Apr 2009 11:32:19 -0500 Received: from [192.168.1.3] (blobule.suds [192.168.1.3]) by interjinn.com (Postfix) with ESMTP id 027E711FB6F; Thu, 2 Apr 2009 12:31:56 -0400 (EDT) To: Chris Stockton Cc: Kalle Sommer Nielsen , Scott MacVicar , David Coallier , Justin Martin , internals@lists.php.net In-Reply-To: References: <6F.F0.47115.84534D94@pb1.pair.com> <2dedb8a0904020508r6306c189peda001421d4e830f@mail.gmail.com> <2dedb8a0904020515k6bd68cdarea0ebd9bb3a8f6c9@mail.gmail.com> <49D4CE5F.3070805@php.net> <2dedb8a0904020745gf2d9e19wd0f1167dae53ac2d@mail.gmail.com> <1238684543.8765.141.camel@localhost> Content-Type: text/plain Organization: InterJinn Date: Thu, 02 Apr 2009 12:32:23 -0400 Message-ID: <1238689943.8765.157.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Update to Zend Highlighter From: robert@interjinn.com (Robert Cummings) On Thu, 2009-04-02 at 09:13 -0700, Chris Stockton wrote: > On Thu, Apr 2, 2009 at 8:02 AM, Robert Cummings wrote: > > > > Wrap the whole highlighted block in a div with a class: > > > >
> >
> > > > Add one more INI setting to change that class. Let users leverage > > hierarchical CSS rules: > > > > div.php-highlighted-code span.keyword { color: red; } > > I like that, and would further elaborate instead of INI changes etc, > allow a key-value pair array to be passed as a third argument. Perhaps > ini changes could be the "default" names. > > mixed highlight_file (string $filename [, bool $return= false [, array > $class_names]]); > > comment|default|keyword|html|string) > > Array( > 'div_wrapper' => 'xyz-cms-div-wrapper', > 'default' => 'xyz-cms-default', > 'etc' => 'xyz-cms-etc', > ); > > The good thing about this as well, is for some odd or logical reason > if your using highlighting multiple times, you can change the class > names of each highlight without something like ini_set. To be honest I don't think it's necessary, and on further reflection I don't think you even need to offer an INI setting to change the class name since if you want different styling you can merely wrap the the main div in your own div and use another hierarchical level:
And the css: div.alt-highlighting div.php-highlighted-code span.keyword { color: blue; } So being able to change the outer class name seems redundant. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP