Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43609 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63054 invoked from network); 2 Apr 2009 17:50:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2009 17:50:03 -0000 X-Host-Fingerprint: 66.183.89.177 unknown Received: from [66.183.89.177] ([66.183.89.177:20747] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/52-44124-ACAF4D94 for ; Thu, 02 Apr 2009 12:50:03 -0500 Message-ID: To: internals@lists.php.net Date: Thu, 02 Apr 2009 10:49:59 -0700 User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 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> <49D4F45A.5090207@daveyshafik.com> In-Reply-To: <49D4F45A.5090207@daveyshafik.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 66.183.89.177 Subject: Re: [PHP-DEV] Update to Zend Highlighter From: frozenfire@thefrozenfire.com (Justin Martin) I do like using the same INI setting name which depends on the use_external_styles setting. However, no stylesheet should be automatically included. The highlight functions do not produce a whole page, except in the case of a .phps (PHP Source file). It should be up to the user to manage how they want their stylesheet included. Thanks, Justin Davey Shafik wrote: > 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 >>> >>> >>> >> >> >