Seeing me freak out at solving maths equations, my mom used to say that solving maths problems is fun once you get the hang of it. I thought that she’s just telling me that to finish up my homework, but I now understand because its not that solving maths has become fun for me but I’ve found coding & solving problems in there to be fun, which apparently some people don’t. So logically speaking, when you get going in something, it starts looking fun to you, whatever it maybe, be it solving maths problems or logical equations while coding or cooking!!
But then since I’m into coding & this blog is about that, so lets stick to that, and while we are at it, I would like to announce the v3.5 of iG:Syntax Hiliter. This version is an update to the v3.1.1 and has bugfixes and new features and the new GeSHi engine(v1.0.7.6) and two new languages, Ruby and MySQL. While the Ruby language file was created by me, I’ve included the MySQL language file from the GeSHi package to allow for hiliting of MySQL specific SQL. But then, as you should know, since v3.0 you are no longer bound to the language files included with the plugin, you can use any language file supported by the GeSHi version bundled with the plugin. So what’s new in this release, some of you might ask & here’s what I’ve to say:
- Tested for compatability with both WP1.5.2 and WP2.0.1
- You can use any other BB tag based plugin with iG:Syntax Hiliter now. A check is done for the existence of the language file in the appropriate directory and if the language file is not present there, the code is returned as it is with the tags, no parsing done on it.
- Code posted in the comments can be hilited using the appropriate code tags. However this feature can be enabled/disabled from the admin interface of iG:Syntax Hiliter.
- A colour picker is now available for you to pick colours of the line numbers displayed with your code.
- A new type of “Plain Text” view of code is available that gives you the plain text code within the code box itself.
That’s apparently not all. There was a bug reported where the “C” language’s code was not being hilited & its been squashed. For full details, please refer to the Manual, its not very much but it has some details. π
So without any further ado, download iG:Syntax Hiliter v3.5. Any bugs etc. that you may find or have anything to say about the plugin, please leave a comment here or on the official thread at the WordPress support forums at http://wordpress.org/support/topic/10533.
Colourful Coding to you all!! π
UPDATE:- The new “Plain Text” view of displaying plain text code in the codebox itself is kinda experimental. It has one known problem of the codebox getting resized to a small height making it impossible to view the code if it contains 1-2 lines of code. This is being looked into, so if you have a problem with this, please don’t report it as a bug. Patience is a virtue. You can report anything else that’s not already reported!! π
UPDATE:- The thread at WordPress forums seems to have been closed by the moderators there!! I don’t know why since I’m quite infrequent at the forums there now, so all questions etc. regarding the plugin go here. π
I’m using WordPress 2.2 and Geshi 3.5, thank’s for the help.
Plugin could not be activated because it triggered a fatal error.
I’m on WordPress 2.2.1.
-Danny
I have the same error:
Plugin could not be activated because it triggered a fatal error.
My WP version is 2.2. Can you give me some solution?
Thanks
Danny, Antoniy, sorry guys but right now I can’t suggest anything, not without looking into v2.2 for which I’ll need some time!!
Hi,
Great plugin! But can i get it to not assign colours when set to [code]?
Heres an example
http://www.yeleek.co.uk/images/sample.jpg
Many thanks
Ben
Don’t worry re the above – edited the code php and stripped out colours/bold.
THanks
With WordPress 2.2 and version 3.5 of this plugin, I can’t remove the line numbers in the options. Keeps resetting to default of yes.
What line would I change to make the default no in the code?
lhoff, you will have to hack a bit & the solution wouldn’t be dynamic. I mean if you feel the need to display line numbers again, you would have to modify the plugin file again. If you are game then open the “syntax_hilite.php” file & in that comment out lines 139 to 149 and also comment out line 151. Now line numbers won’t be shown for your code.
FWIW, I just upgraded my WP install locally to WP 2.3 and popped this plugin in with no problems at all. Everything worked perfectly! I could configure it without problem.
This is the only plugin I use, so now I’ll upgrade the live site and I’m good to go again.
Thanks for this plugin, I’ve been using it since the beginning and love it!
Thanks for the info & appreciation. π
I also upgraded to WP 2.3 and it didn’t break anything.
A question, would it be possible to add a Word Wrap for themes that have fixed width so that the code box doesn’t overflow? I would guess during plain text mode, it would have to turn off word wrap so that they can copy the code properly, but during the dynamic display it should be able to wrap around. See this post as an example of the text overflowing the bounds of the post area.
Secondary off topic question, what plugin runs the comments on this page? Is this the coComment thing?
Brian, the overflow is only in the inner div so that the code doesn’t break by wrapping, so it produces those scrollbars. The overall width of the box is fixed, its just that the post area of your theme is small & hence the box is running off. Check the CSS file of the plugin & fix the width as per your need! π
Come again? don’t think I got you. This blog is coComment compatible(because of coComment plugin) if thats what you want to know, meaning that coComment will work perfectly with this blog! π If thats not what you mean then please explain.
I’ll check the CSS of the plugn. Thank you.
Yeah, I was just wondering what made the cool comment box that I type this in. I was digging the stuff to the left, and the avatars in some of the comments.
I am presently experimenting with Intense Debate as a comment system (just added it today), and it doesn’t seem compatable with the highlighter, I think they are doing something to the code before it posts as it shows the brackets, the language setting and then strips all the spacing. So I am going to guess they have something to fix on their end. Just an FYI in the event other blogs who use this start saying stuff.
Also, the support thread the post says to use is close, so you may need to edit the post. π
ah, the comment box on this blog? I made it myself along with this current “Grey Storm” theme. The Javascript that powers the functionality of toolbar(left) in this comment box was borrowed from the quicktags.js file of WordPress & modified by me. π Styles & buttons & colours are of my own design! π
Thanks for the heads up on Intense Debate thing, seems to look like a cool service, will check it out. And yeah, I noticed the closed thread at WordPress forums as well, but never got around to updating this post! Have done so now!! π
Great plugin! I got a question about indentation. It works for the first time when you paste your code. You get a properly indented code. But when you edit and resave all the indents get lost. Actually if you just open your post for editing the indents are already absent in the post editor.
Maybe somebody knows how to resolve the problem? I tried to wrap the code in but the result is bad in browsers. How to make the post editor render the code correctly when your post is reopened?
Thnx!
@websash
Are you using the Rich Text Editor(WYSIWYG) that comes with WordPress? I’ve seen such things, like code messing up or indentation loss etc., happening only when WYSIWYG editor is used. The normal plain text editor doesn’t mess up code in anyway. So if you are using WYSIWYG editor then don’t use it when writing/editing a post which contains code that you want to hilite. A warning is already there in the plugin manual about using it. π
Oops I forgot about it. Thanx a lot. Yes I unchecked the “Use the visual editor when writing” checkbox under Users -> Your Profile and it’s working π
Amit, Is it possible to run two version of IG Syntax Hiliter simultaneously? I need to show two very different presentations of code simultaneously. I’m hoping I can just make a copy of the plugin and modify a few settings so one doesn’t overwrite the other, either during activation or when changing option settings. Would you be able to point me to what needs to be altered?
@websash:
You are welcome π
@Rich:
Yes its possible but you will have to first modify the names of all the option keys that the plugin stores in the DB so that they are not overwritten(unless you don’t mind same settings in both versions). Then you will have to edit the tag parsing & make tags of 1 version a bit different than the other so that each version parses its own tags.
Hi I am trying to get your plugin to work, but as a few other people here I have a problem when I try to activate it. I get “Plugin could not be activated because it triggered a fatal error.”
Did you ever manage to figure out what is causing that ?
I am using WordPress 2.3.2 with the new XMLRPC patch.
Thanks
Sorry Claus but haven’t had time off late to look into later versions of WP & see what might be the problem. π
@Amit: Thnx for the great plugin.
@ALL: All those who are having “fatal error” issues, the “fix” is very simple. The plugin installation has to be a bit different. instead of putting “ig_syntax hiliter plugin” folder in your plugins directory, put its contents there. This means that syntax-hilite.php will be directly under plugins directory plus the folder ig_syntax_hilite will also be there directly under plugins directory. (Fixed it in a couple of seconds cuz looking at the error straightaway told that a file was being included from wrong path)
Awesome plugin. Just installed and works like a charm. I was having problems with the <code> tag in WordPress and Googled until I found your script. Thanks again!
The plugin seems to be having troubles with the WordPress 2.3.3 Update the code does not wrap on the box and it shows all the lines.
Any insight on this issue ???
Hey Amit,
i have a tiny problem: When i use smartypants (daringfireball.net/projects/smartypants), all straight quotes will be turned into curly ones. Which is dandy for Γ’β¬ΕordinaryΓ’β¬Β text, but it shouldnΓ’β¬β’t be done with the code, obviously. Well, smartypants will not beautify straight quotes if they are inside , <code>, , or tag blocks.
So, if you use smartypants and IG:Syntax Hitliter, you have to wrap code like this: <code>[php ] actual code here [/php ]</code>.
Is there a way to fix that in the plugins code?
Besides that, i am having no problems under WP 2.3.3 so far π