Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43604 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44466 invoked from network); 2 Apr 2009 16:38:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2009 16:38:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=lewiswright@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lewiswright@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.179 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: lewiswright@gmail.com X-Host-Fingerprint: 209.85.219.179 mail-ew0-f179.google.com Received: from [209.85.219.179] ([209.85.219.179:57666] helo=mail-ew0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 22/00-44124-12AE4D94 for ; Thu, 02 Apr 2009 11:38:58 -0500 Received: by ewy27 with SMTP id 27so642478ewy.23 for ; Thu, 02 Apr 2009 09:38:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=EA/17DU5cYEpT3r3Q804aA/sfjzfazA3X6qyVDyg5aA=; b=EtIH+MD8X0pduiPXFdQj5/hhyV0kfgZ1PyJfjRRskPystnCndjRj4pJPQsN3CyTjjh ufwDVBsQIgTnHnxQMxXfQyTiCkFTEY2rTD/Jxn6WhkdhLCO1Qb37saNcJHXLrXsih5Ql n9tzv9bqlHP+54EBJ08RJWfRYJHoQnkIJonAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=c0Jmhn1rr4l/k8gqn7kj5PPXTaCuTcVJPHhSY9Umo7FkrLa2M9CQJLRzzn0m0wgRcr I3Adk42nGq9Vow5Qnjg2o4JiTXHz1aQJLWSV9kbPyELYsQfgF9t/odm6LBzYh28ITsas aFRSHACutf/hv0fX20LZ1kmarq6aRJcIPVDiU= MIME-Version: 1.0 Received: by 10.210.56.9 with SMTP id e9mr135738eba.49.1238690335318; Thu, 02 Apr 2009 09:38:55 -0700 (PDT) In-Reply-To: <1238689943.8765.157.camel@localhost> 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> Date: Thu, 2 Apr 2009 17:38:55 +0100 Message-ID: To: Robert Cummings Cc: Chris Stockton , Kalle Sommer Nielsen , Scott MacVicar , David Coallier , Justin Martin , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Update to Zend Highlighter From: lewiswright@gmail.com (Lewis Wright) 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 w= rote: >> > >> > Wrap the whole =A0highlighted block in a div with a class: >> > >> > =A0 =A0
>> > =A0 =A0
>> > >> > 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=3D false [, array >> $class_names]]); >> >> comment|default|keyword|html|string) >> >> Array( >> =A0 =A0 'div_wrapper' =3D> 'xyz-cms-div-wrapper', >> =A0 =A0 'default' =3D> 'xyz-cms-default', >> =A0 =A0 'etc' =3D> '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 > { > =A0 =A0color: 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 > >