Page 1 of 1

Work in progress: Geshi-Plugin-Improvments

Posted: Wed Apr 11, 2007 6:57 pm
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

Re: Work in progress: Geshi-Plugin-Improvments

Posted: Thu Apr 12, 2007 10:59 am
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

Re: Work in progress: Geshi-Plugin-Improvments

Posted: Thu Apr 12, 2007 1:15 pm
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