Work in progress: Geshi-Plugin-Improvments

Discussion corner for Developers of Serendipity.
Post Reply
pilif
Regular
Posts: 11
Joined: Thu Jan 06, 2005 4:02 pm
Contact:

Work in progress: Geshi-Plugin-Improvments

Post by pilif »

Hi there,

today I added the geshi plugin to my collection of s9y plugins because I was beginning to post more and more sourcecode on my blog. After installing, I noticed a large difference between options exposed via the [geshi]-tag and options exposed via the actual geshi-API.

This is what made me begin with this patch to the plugin which does the following:
  • It correctly parses the [geshi]-tag in a way that the order of the attributes doesn't matter.
  • It adds an extendable framework allowing different attributes setting different settings in the geshi-API.
So far the patch implements the better parser and the ln-Attribute, but this time with added features, exposing the whole functionality of the enable_line_numbers method of gehsi.

The stuff is still very rough and needs to be extended greatly (adding option handlers for more geshi-APIs) and cleaned up. I'm just leaving my computer for now, so I guessed I better post here and ask for early feedback on this because naturally, I'd like to see my changes going in ultimatly :-)

So: What do you think?

Philip
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Work in progress: Geshi-Plugin-Improvments

Post by garvinhicking »

Hi!

Your code is PHP5 only, so that would be a reason where we would need to split the plugin into two versions...

Apart from that I sadly don't use geshi so I can't talk about advantages :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
pilif
Regular
Posts: 11
Joined: Thu Jan 06, 2005 4:02 pm
Contact:

Re: Work in progress: Geshi-Plugin-Improvments

Post by pilif »

Hi,
garvinhicking wrote: Your code is PHP5 only, so that would be a reason where we would need to split the plugin into two versions...
I'd certainly be willing to adapt to PHP4. That patch I provided is just a quick hack I came up with while still trying to be as clean as possible which involved at least some OO-design :-).
garvinhicking wrote: Apart from that I sadly don't use geshi so I can't talk about advantages :)
Geshi provides a very featurefull api to configure how the hightlighted source code should look like. The current interface - besides being a bit unintuitive as it requires the ln-attribute to come after the lang one is very, very limited as it basically only provides to turn line numbers on or off. That's why I began working on this.

My plan is now to make the linked patch more feature-complete, so people using geshi can try it out and then rework it to be PHP4 compliant.

Philip
Post Reply