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 not sure why, but using iG:Syntax Hiliter does not work in WP, whenI go to the options page all I get is
But I am logged in as Admin. That should work right? Thanks…
Well, as it happens, iG:Syntax Hiliter was & is for WP only, nothing else!!
What version of WP are you using? If its the latest v2.1 then I’m afraid that I don’t know about the plugin working with it or not as I’ve been kinda busy lately & haven’t even checked out v2.1!! 🙁 But this weekend or next I do plan to take sometime out & check it. 🙂
Sorry, I guess I forgot to add in 2.1 to the WP part. Should have been “does not work in WP 2.1” Its amazing how much that number can change a question. 😀
Yeah, that number can change the matter all together. There’ve been a lot of changes in WordPress recently & I haven’t been in touch off late & I think that v2.1 has brought in a lot of major changes. I’ll look into it, don’t worry. 🙂
Problem solved:
Is another person has this problem, what you need to do is go to the Users management page, check your user name and set the user to Administrator, log out and then log in again, everything should work. 🙂 Hope that helps… 🙂 Great plugin…
hmm, so you weren’t logged in as an administrator?? well, hardly the plugin’s fault in that case as I remember writing in the plugin’s manual(included in the plugin download package) that you need to be an administrator to modify plugin’s settings in the wp-admin section!!
I changed from fixed-width boxex to relative width, enjoy!
[css]
.syntax_hilite, li .syntax_hilite {
padding:3px 3px 10px 8px; border:1px solid #303130; background-color:#FEFEFE;
font-size:13px; font-family:’Courier New’,Courier,monospace;
/* comment the line below to remove scrolling in code boxes */
overflow:auto; white-space:nowrap;
}
/* change this line to set the width of code box */
.syntax_hilite { width:95%; }
/* change this line to set the width of code box in a list */
li .syntax_hilite { width:90%; }
.igBar, li .igBar {
background-color:#D6D3CE; font-family:courier,arial,verdana;
border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE;
border-right:1px solid #424142;
}
/* change this line to set the width of plain text bar above code box */
.igBar { width:97%; }
/* change this line to set the width of plain text bar above code box in a list */
li .igBar { width:93%; }
.igBar a, .igBar a:hover {
margin:0px 5px 0px 10px; font-weight:bold; color:#000000;
text-decoration:none;
}
.syntax_hilite .langName { color:#000000; font-weight:bold; }
.syntax_hilite textarea { margin:0px -5px -2px 0px; border:none; }
[/css]
Your syntax highlighter doesn’t seem to work with version 2.1.1 I am the main user of the site, I am using the admin that was created during the install, and I am not able to set up any settings, it says that I am not a level 8 user blah blah. I’ve already logged out and back in many times. I hope you can get this fixed. Oh, and by the way, you spelled highlighter wrong, it is spelled h-i-g-h-l-i-g-h-t-e-r , not hiliter.
Well, I’ll look into it as soon as I get time!
Ah, thanks for the english primer but then I want to spell it “hiliter” & not “highlighter”, do you mind? 😉 😛
A very good plugin.
For all people have the same problem with “Settings reset when changing plugins”
change line 522.
search:
} elseif((!empty($_GET[‘activate’])) && ($_GET[‘activate’]==’true’)) {
replace with:
} elseif((!empty($_GET[‘activate’])) && ($_GET[‘activate’]==’true’) && $_GET[‘plugin’]==”syntax_hilite.php”) {
I think it’s great..
but I think I found a bug:
I’ve some reason to belive that this line:
elseif (!($this->language == ‘html4strict’ && ‘>’ == $keyword )) {
return ‘‘;
}
should be
elseif ($this->language == ‘html4strict’ && ‘>’ != $keyword ) {
return ‘‘;
}
am i wrong?
sorry: it’s:
‘>’==$keyword
and
return ‘</a>’
sorry..
the right one is
!($this->language == ‘html4strict’ ||’>’ == $keyword )
Ced, I don’t think its a bug(pay attention to the negation sign at the start of first bracket, with negates both the conditions). 🙂 You forgot to mention the file, I assume its the “geshi.php” file. If thats the file & if you think its a bug then how about reporting it directly to GeSHi developer?
yes, the file is geshi.php, I think it’s a bug becouse in html highlighting it closes the link to the tag reference 2 times.
in the way i modified it doesn’t.. I will report it also to the geshi, I didn’t get that wasn’t your file, sorry 🙂
Was the setting reseting problem ever figured out? I’m having that issue with mine.
Great plugin though
Thanks
Dan, try Axel’s suggestion(7th comment above this one).
In the post which includes hilited code, auto-formatting is disabled not only in the code area but whole of the post. I want to texturize (e.g. replace two ‘-‘ to dash(–) ) out of the code area. Is it possible?
As far as I know, its not possible to selectively leave out any part which is not to be texturised, so its disabled for whole post because it ruins the code.
Thanks for this great plugin. I’m setting up my site to use this but I found the following features will be a great help in posting codes.
1. Customization of the source code box in the Admin page
2. Width Customization at code level posting
[PHP WIDTH=100]
3. Setting start line number like below:
[PHP LINE=23]
4. Ability to background highlighting on line/s of code
[PHP HIGHLIGHT=5] –> which highlights line 5
[PHP HIGHLIGHT=4,7] –> which highlights line 4 to 7
Thanks in advance.
Thanks for the suggestions Mark, I’ll see what can be done. 🙂
This feature is already there which lets you start your line numbers from a particular number. Read the manual for details. 😉
Thanks. I just found it yesterday.
Does this plugin remove spaces before the code? I pasted the code below to indent 3 spaces on 3rd and 7th line but it removes the indention.
if (window.XMLHttpRequest) // Mozilla, Safari
{
RqstObj = new XMLHttpRequest();
}
else if (window.ActiveXObject) // MS IE
{
RqstObj = new ActiveXObject(“Microsoft.XMLHTTP”);
}
[JS]
if (window.XMLHttpRequest) // Mozilla, Safari
{
RqstObj = new XMLHttpRequest();
}
else if (window.ActiveXObject) // MS IE
{
RqstObj = new ActiveXObject(“Microsoft.XMLHTTP”);
}
[/JS]
Mark, as you can see in your code highlighted above, the indents aren’t removed at all by the highlighter. 🙂
Hi,
I just installed this and it is great.
One thing though. It would be great if I could just have a link to the PLAIN TEXT and not have the code in my post. Oh and also once the window pops up it will be HIGHLIGHTED text.
Will
Will, the plugin’s a code highlighter & not a plain-text presenter!! 😉 Still it’ll be interesting to see if this can be made available as an option without much messing around! 🙂