Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43608 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61312 invoked from network); 2 Apr 2009 17:45:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2009 17:45:24 -0000 Received: from [127.0.0.1] ([127.0.0.1:20787]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 0C/02-44124-3B9F4D94 for ; Thu, 02 Apr 2009 12:45:24 -0500 Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 208.38.184.4 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 208.38.184.4 unknown Linux 2.6 Received: from [208.38.184.4] ([208.38.184.4:43208] helo=dacorp.digarc.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B6/11-44124-164F4D94 for ; Thu, 02 Apr 2009 12:22:42 -0500 Received: from localhost (localhost [127.0.0.1]) by dacorp.digarc.com (Postfix) with ESMTP id 99E7529FD2; Thu, 2 Apr 2009 13:22:38 -0400 (EDT) X-Virus-Scanned: amavisd-new at digarc.com X-Spam-Flag: NO X-Spam-Score: -4.398 X-Spam-Level: X-Spam-Status: No, score=-4.398 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599, HTML_MESSAGE=0.001] Received: from dacorp.digarc.com ([127.0.0.1]) by localhost (dacorp.digarc.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a3wwp0efy2Bx; Thu, 2 Apr 2009 13:22:35 -0400 (EDT) Received: from isis.digarc.com (75.77.13.2.nw.nuvox.net [75.77.13.2]) (Authenticated sender: dshafik) by dacorp.digarc.com (Postfix) with ESMTPA id B14A229EB5; Thu, 2 Apr 2009 13:22:34 -0400 (EDT) Message-ID: <49D4F45A.5090207@daveyshafik.com> Date: Thu, 02 Apr 2009 13:22:34 -0400 User-Agent: Postbox 1.0b10 (Macintosh/2009032714) MIME-Version: 1.0 To: Lewis Wright CC: Robert Cummings , Chris Stockton , Kalle Sommer Nielsen , Scott MacVicar , David Coallier , Justin Martin , internals@lists.php.net 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> <1238689943.8765.157.camel@localhost> In-Reply-To: Content-Type: multipart/alternative; boundary="------------070003000501020902090201" Subject: Re: [PHP-DEV] Update to Zend Highlighter From: me@daveyshafik.com (Davey Shafik) --------------070003000501020902090201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Why not just re-use the same highlight.*, they can be colors or classes... or you switch this based on "highlight.use_external_styles". You could also add a: "highlight.add_stylesheet" to add a default stylesheet created by PHP... - Davey Lewis Wright wrote: > Why not allow a class prefix as an option to the function? > > Eg: > > 'php-highlighted-' as the prefix would produce things like > 'php-highlighted-keyword'. > > That way there's no risk of collision and there's no need to > over-complicated things. > > 2009/4/2 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 >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> > > --------------070003000501020902090201--