A problem occured while loading the plugin: krl_flickr_photoset -> : Assigning the return value of new by reference is deprecated on line 18
kelvinluck.com: krl_geshiSyntaxHighlight released
Get Firefox! creative commons

krl_geshiSyntaxHighlight released

So – it’s finally deserving of a 0.1 release… There are still a few little teething problems but in general the krl_geshiSyntaxHighlight plugin is ready to go. For downloads, installation instructions please check out my project page for it, here.
Please leave any comments or suggestions for improvement at the bottom of this article…

  1. Hi Kelvin,

    I’m the author of GeSHi. Good to see you made a plugin using it :). And even better to see that you defeated the evil entity problems… the one gripe I have with syntax highlighting in my wordpress blog is that I have to encode everything first… but you seem to have gone to a lot of effort to make it easy for people, well done!
    Nigel McNie    Mar 3, 04:10    #
  2. Hi Nigel,

    Glad you like the plugin… I don’t think that I solved quite all of the evil entity problems yet but with Textpattern v1 hopefully coming out any day now I was going to wait until that came out before more hacking around in the textile core – hopefully they will have made notextile tags actually mean NO textile and I won’t need my hacks…
    Thanks for the feedback :)
    Kelvin    Mar 10, 22:02    #
  3. I take it you filed a bug report etc. etc. Good luck with the plugin :)
    Nigel McNie    Mar 11, 00:29    #
  4. erm… no!
    Thanks for the nudge – I’ve raised the point on the textpattern forums – hopefully in time to get a fix built into the v1 release :)
    Kelvin    Mar 11, 01:56    #
  5. I cannot, for the life of me, get txp to even execute the plugin!
    You can see the results here: http://jamie.ideasasylum.com/notebook/index.php?id=9
    If you view the source, you can see that the krl_geshiSyntaxHighlight tags are never replaced. I have the RC3 release.

    Any ideas?
    Jamie Lawrence    May 10, 15:56    #
  6. Ah, figured it out. Should the tags be?:
    <txp:krl_geshiSyntaxHighlight />
    Jamie Lawrence    May 10, 16:06    #
  7. Hi Jamie,

    It seems like you figured it out :)

    On another note, glad to hear that it is working with RC3 – I am still using an a hacked RC1 and hadn’t tested with anything newer…

    Hope you find the plugin useful,

    Kelvin :)
    Kelvin Luck    May 11, 01:06    #
  8. well, “working” is a relative thing… I can do the sytax highlighting but the notextile tag is still misbehaving and I don’t really want to have to hack each version of txp. However, I’m delighted that you’ve written the plugin as I was just about to start writing my own txp&GeSHi plugin.

    I also had to hack the plugin a little bit to change the php include path since my installation on Dreamhost uses PHP as a cgi module (and it seems safer leave it that way), it can’t make use of .htaccess file to change the include path. Basically, I just put this at the start of the plugin function:

    ini_set(“include_path”, ”/path/to/geshi/:.:/usr/local/lib/php” );

    Also note that the instructions you give for modifying geshi.php are a little out of date (v1.06 is the latest version and the constructor has changed slightly)

    I’ve also messed around a little bit to provide an option to remove the height restriction on the code box (i.e., only constrain the width of the div and let the code blocik flow down the page).

    My next thought: since the notextile tag is a pain in the perverbial, it would make more sense to use the file-based highlighting. I wonder if that could be integrated with txp’s new file upload facility to make things easier? i.e., upload the code file using txp and then refer to it using the txp name/id rather than the full path. This would avoid ftp’ing files around and remember paths etc. hmmm…
    Jamie Lawrence    May 11, 14:37    #
  9. Hi Jamie,

    Thanks for the feedback…

    Putting the ini_set in the function is probably a good idea although you could maybe make it more robust by doing:

    ini_set(“include_path”, ”/path/to/geshi/:”.ini_get(“include_path”));

    (untested) or something similar? Just so it doesn’t break anyone’s non-standard include paths…

    Re. removing the height, this makes good sense.

    And re. the notextile tag – yes, using the txp file upload capability would make sense. I’m actually a week into a 3 month trip around South America at the moment so unfortunately won’t be doing any changes myself in this time but you should feel free to and to post a link to the extended code here. Otherwise (and if the notextile tag still isn’t fixed) I’ll look into doing it when I get home…

    Cheers :)
    Kelvin Luck    May 12, 19:08    #
  10. I did this a few months ago and forgot to send you the fix. I forgot what all I had to do in-order to get this to work without the notextile block, but it does work.

    It could possibly have some bugs, but it will give you an idea of how to get around the notextile. I ‘think’ the problem was that content from plugins DO NOT get passed through textile in the first place.

    view the source here

    Cheers
    Justin Palmer    Jun 15, 23:53    #
  11. Hey Kelvin! Wanted to let you know I got a variant of your plugin up and running (very similar, trimmed away some of the stuff I didn’t need like OL support), and ran into a small snag in the TXP 4 classTextile. For some reason, it was picking up the code as a block element. To get around this, I redid the block function to support the notextile tag:

    New Block Function for classTextile.php (txt)

    Very amazing work Kelvin, and the hacks still apply well to the latest build.
    Jakob Heuser    Sep 12, 08:42    #
  12. Hi Jakob,

    Glad to hear that the plugin works more or less with the new build of TXP. I haven’t got around to updating yet but I guess I should soon. I’m guessing that they haven’t fixed the notextile not actually meaning notextile problem if the hacks are still necessary?

    Thanks for posting your updated block function,

    Cheers,
    Kelvin    Sep 18, 20:08    #
  13. It seems upgrading to Textpattern 4.0.3 broke the plugin :o
    ThaNerd    Jan 10, 10:33    #
  14. I haven’t upgraded my textpattern in quite a while… I’m planning to when I get a chance and then I will try to update the code in the plugin.
    Kelvin    Jan 10, 11:06    #
  15. Geshi sucks. I’ve tried it five times in my life, but couldn’t run it eith different CMS’s, including wikipedia. It just doesn’t work.

    Your plugin doesn’t work too. It just make the keywords appear italics. That’s all.


    — Loststylus    Oct 3, 20:26    #
  16. I don’t think Geshi sucks. It works fine for me. Don’t you see highlighted code here or here?


    Kelvin Luck    Oct 3, 21:45    #