I’ve been sitting on it for over a week now, I can’t hold it any longer. π
Ladies & Gentlemen, I give you the much awaited, iG:Syntax Hiliter v2.0 Final. π
After really serious coding & much fretting, the final release of iG:Syntax Hiliter v2.0 is knocking on your doorstep. This is really an update to which a lot of you’ve been looking forward to(so it seemed from all the eMails that I got). π I believe that this release wouldn’t disappoint you & will prove to be worth the wait. π
I won’t say anything here(partly b’coz I’m feeling sleepy, its past midnight & I’ll have a long day tomorrow).
I’d just like to point that this release has over 700 lines of code, totally re-written. When I finished writing it at first, it was over 850 lines of code but then I sat down again to prune it & managed to keep it around 750 lines. π If you compare the earlier versions & this version, you’ll find the code totally different. Finally I clustered all the hiliting functions into a class & made that class re-usable, so you can just pull it out & use it to hilite your code your way(you’ll still need GeSHi).
So just go, download the plugin, read the MANUAL & you’ll understand. π
Even better would be to take it out for a spin. π
IMPORTANT:- This plugin has been tried & known to work with WP 1.2 & WP1.2.1. It has not been tried with any present releases of WP1.3(as its not stable yet) & though it might work with it, its not certain.
Comments & Bug Reports(ah!!) as always are invited. If you have any problems using this plugin or have found a bug, you can post it at http://wordpress.org/support/10/10533/.
You can see the old examples here. π
UPDATE:-
There’s been a bug that came to my attention following this post in the support thread at WP Forums. Because of this bug, the two <br /> tags were replaced by a </p> tag making the code non xHTML compliant(as per my desires π ). This has been fixed. So those who haven’t downloaded the v2Final yet, can download the whole package while those who have v2Final are requested to download the fixed plugin file which they can replace with their old plugin file(you’ll have to change it again for your settings about line numbers & physical path to GeSHi directory). π
Sounds like a great idea, and a great plug-in!
Is there a demo page somewhere? So we can see what it will look like?
Yep, you can view the demo here but its only a few languages, not all which are supported now. π
I’ve got it up and running (with slight style modifications so it’s readable) at my blog, so you can see it working there π
Actually, I’m not sure what’s happening here – it seems that syntax highlighted blocks end up closing an extra two <div>s (do an edit->view source to see what I mean). Is this your plugin doing this? As you can see, the font sizes seem to change dramatically for some reason…
And I see there’s an error with multiline strings, but I’m guessing that’s a geshi error that could be solved if I enable_classes()’d the code.
Yes, its my plugin doing this & its not closing any extra DIVs. Its closing the 2 DIVs which it opened. Actually I was trying one more feature & that’s why I wrapped the CODE in an extra DIV. Its a kind of placeholder for that feature which I’ll probably be able to sort out for next version. The code is valid, no need to worry about it. π
Where? Oh!! you mean the font size that has gone so small after the first code box? I don’t see why that has happened, as nothing of the sort has happened with me. You can see my other posts where I’ve used this plugin & they appear alright, like this one.
Also, I haven’t heard this problem from anyone else. Maybe you should lookup the CSS or something. I’ll see if I can get this problem on my test blogs. π
What error? π
That won’t work. π I tried using enable_classes() & output the classes at runtime to the head section but there’s some problem, WP is not allowing the classes to be outputted. π
Hmm, I’ll check my CSS then, though I can’t see what’s happening… I’m not too familiar with wordpress.
And the font sizes change because it’s in an ol (-10%) and then in an li (-10% + 200% line height) – I just changed the stylesheet to make it look much nicer :). I used ol[start=””] to do it, but since I’ve banned internet explorer from my blog I’m not worried about compatibility π
Oh, and the multiline string thing *was* a geshi error – I’ve fixed it for the 1.0.3 release, due out today if I can get it out in time.
Well, that’s the most unpleasant thing you’ve done till date in my knowledge. πΏ I use IE extensively & so do most of the people. And the message you display to IE users just suck. That’s not a nice way. It means you are doing a kind of cheap publicity for FireFox. Also, you shouldn’t tell your visitors what browser should they use. Its their choice & they get what they use. If they use IE & your website doesn’t support IE, then they’ll get a broken website & you can display a message that if they are not able to view the website correctly, then they should get FireFox. That’s the pleasant way of doing it.
But blocking out IE users totally is just un-ethical. π WordPress renders all well in IE, so what’s you got against it? π
What was that error, I didn’t spot it!! I’ll try & plug the latest version in the next iG:Syntax Hiliter quickly. π π
Yeah, well I don’t care that IE users see what they see. It’s my blog, and I’ll do with it what I please.
I don’t give a monkeys if they think it’s unpleasent, or get all offended.
But, and I have asked this to many people, with no answer: would it be better if I change the links on the page to browsehappy.com instead of spreadfirefox.com?
Err, right.
Changing the links to Browserhappy would be better as it means that people are given a choice, they can get any of the so called safe browsers. But I’d say, from some of the reasons for switching I’ve read, most of them are just stupid reasons that they changed to FireFox from IE as FireFox is free & its nice!! I mean when I last heard, IE was still free. π And they could’ve explained more on what they found nice about FireFox that they didn’t find in IE, instead of ranting about who they are & what they do. π They seemed to think that they were giving some kind of personal interview where their identity is dominant.
IE is free cos nobody with a brain would actually pay for it π
Anyway, I’ve changed the links now. That should shut them up at spreadfirefox.com as well ;).
Now now, that’s just the opinion of a few narrow minded persons & you. Browsers for which users have to pay to use, like Opera, don’t have a bigger following as starting from Netscape & Mozilla back in the starting of WWW, people have taken browsers for free, so why should they pay for something when better alternatives are available for free? And don’t forget that IE was there before FireFox was even a blueprint.
Also, IE has contributed to the Internet revolution more than any other browser or you wouldn’t be seeing all those Flash animations in your FireFox.
The last version, IE6 came out 4 years back, so if you are gonna compare that with the latest version of the rival browser, its not gonna be fair. FireFox is being developed everyday, while IE is not, so there are gonna be quite a lot of differences.
But I’m glad that the work on IE7 has started & we’ll soon see what Micosoft dishes out next with Longhorn.
And, please, don’t turn this post in another Bad IE Good FireFox discussion. I use both IE & FireFox and I don’t care. I have uses for both. If you have anything to say against IE, this is certainly not the best place.
With regard to that IE trap: I ran into it and I’m not using IE at all. I’m using Galeon (Mozilla based Gnome browser) which just fakes its identity to get past those silly browser detection scripts that just know about two or three browsers and keep you out if you use a browser they don’t know.
So please either refine your browser detection in a way that it really gets that right, or better, disable it completely. You’re harming your site and nothing else.
<!– CENSORED –>
And also, as for that update: I think that was what was causing my styles to go all funny (see above), IΓ’β¬β’ll install the plugin and tell you if that is it.
[me again] It wasn’t entirely the plugin – instead, it’s an issue with paragraphs inside list items and their styles…
I don’t think so, as you are using v1.2.1 & I’m using the same & if it doesn’t go funny on my blog then how come it effects yours? Maybe you are using relative sizes while I’m using fixed sizes. π
Hmm, I’ll look into that!! π
Naah, don’t bother: It’s definately not your fault. The paragraph was aggravating the problem, but it is to do with that wonderful CSS concept of “relativity”…
However: I was trying to post some syntax-highlighted code the other day, and I ran into problems – I think that WP tried to parse the code to make it compliant, and unfortunately screwed it completely. It seems to do it before your plugin gets to it to highlight it, so the plugin was perfectly highlighting a whole lot of crap ;). Do you have any idea why that would happen, and how to stop it doing that?
Well, that’s why I use pixelised dimensions for fonts & percentage for layout. π
Well, I haven’t run across this situation yet but if you can eMail me the link to the post where you are having the code screwed up by WP, & what the actual code should have been, maybe I can figure out something. π
http://qbnz.com/blog/index.php
As you can see in that post about GeSHi (the first one), a < /> seems to have been added, and the <?php seems to have been split, among other things. I’m not running any other plugin…
Uhh, I wondered why you put a </> in your code, but now I understand. π WP prevents you to put any PHP code in your posts so that might be causing problems. I get around them by using the HTML encoding of the < & >. That way there’s no problem in using any tags in my post. And to make things easier, I created a quicktag so that whenever I select some text & click that button, its closed as a tag.
However, I’ll see to what I can do, but don’t keep your hopes high as this is a WP problem. π
Yeah, I’m getting sick of not being able to post code properly. You know that problem I’ve been having with wierd font sizes? It’s because WP wasn’t putting content inside ordered lists into paragraphs correctly, so some of the content was and some wasn’t. I really don’t like how I have to use HTML to format stuff – it’s far safer, and easier for the poster, if we are allowed to post HTML as-is, and use some other kind of formatting language like BBCode.
It makes far more sense if I can just, for example, write <code> foo < bar</code> straight off, rather than having to encode it…
True, it’d sure be easier if the user doesn’t have to encode the tags manually but then the thing is that without this being implemented, you can use HTML in your post if you wish & some people do that(to display the AdSense ads possibly!!). π
But this can be fixed on plugin level(I think so). I’ll try & see if I can encode the tags enclosed in the code tags of my plugin. π
Yeah, that would be cool. I don’t know why WP insists on adding random </> parts to the code, but if you could somehow tell it to ignore any HTML inside a code block that would be awesome π