The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Development Work in progress: Geshi-Plugin-Improvments

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

Postby pilif » Wed Apr 11, 2007 6:57 pm

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

User avatar
garvinhicking
Core Developer
 
Posts: 28971
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Thu Apr 12, 2007 10:59 am

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 5:02 pm

Postby pilif » Thu Apr 12, 2007 1:15 pm

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



Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest