Re: Update to Zend Highlighter
| From: | Kalle Sommer Nielsen | Date: | Thu, 02 Apr 2009 16:23:16 +0000 |
| Subject: | Re: Update to Zend Highlighter | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43601@lists.php.net to get a copy of this message | ||
Hi Chris
2009/4/2 Chris Stockton <chrisstocktonaz@gmail.com>:
> On Thu, Apr 2, 2009 at 8:02 AM, Robert Cummings <robert@interjinn.com> wrote:
>>
>> Wrap the whole highlighted block in a div with a class:
>>
>> <div class="php-highlighted-code">
>> </div>
>>
>> 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.
I must honest, I don't really like this approach (passing an array
with class names), I think INI calls are better, or even better if we
wrap it all into a "Highlight" class which could make the API alot
easier not only for classes, but also inline colors and perhaps even
more options later on.
>
> -Chris
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Kalle Sommer Nielsen
kalle@php.net