iG:Syntax Hiliter Plugin
-
I released iG:Syntax Hiliter Plugin yesterday. Its available at https://blog.igeek.info/still-fresh/2004/08/06/igsyntax-hiliter-plugin-release/. Its for highlighting/colour coding your code snippets. The current version is v1.0 & at present it supports HTML, CSS, PHP, JAVA & SQL codes. This thread will be here for entertaining bug reports( ?? ) and any feature requests. ??
-
I’ve just released the v2.0 Final of iG:Syntax Hiliter. It has lots of new things & its really really better than before. Go ahead & take it out for a spin. ??
Amit: This is great, just what I’ve been looking for. Two questions – Can I add keywords to the array in vb.php (I already added one, but is it alright to add them and is there a limit)?
Can I change the font-family to “Courier New, Courier, monospace” and where would I do that?
ThanksMe again: Could you look at
https://www.dicks-blog.com/archives/2004/11/30/alerts-when-sharing-and-unsharing/
and tell me why the code is in a scrollable text box? I ended up enclosing the VB tags in <font face=Courier New> tags, but I can’t believe that would cause it. It doesn’t show that way in the preview when I’m editing the post, just on the site.
Any help is appreciated. Dick K.It appears to be rendering in monospace font now, I don’t know what’s changed. As for the textbox, I commented out ~line 742 right below where it says “comment this line to not have fixed width/length”, etc. Duh!
I also noticed that if I have blank lines in the code that is screws up the formatting. Putting a single space in those blank lines seems to fix it.dkusleika:
Can I add keywords to the array in vb.php (I already added one, but is it alright to add them and is there a limit)?
Yes, you can add keywords to any language file, there’s no limit. If you want, you can share your vb.php file so that it can be put in the next release.
Can I change the font-family to “Courier New, Courier, monospace” and where would I do that?
Yes, you can change the font-family too. In the plugin file on line 737 starts the function that outputs the styles for the code boxes. You can put your own styles in there.
tell me why the code is in a scrollable text box?…….It doesn’t show that way in the preview when I’m editing the post, just on the site.
The scrollbars are there by default so that long lines in your code are not wrapped in multiple lines & confuse readers. You can disable them by commenting line #742. Also it doesn’t show in the preview as the head action which outputs the styles applies only to posts & not in admin section.
Oh!! I see you already configured the scrollbars in code boxes. ??
zertox:the plugin works in 1.3 but the page wont be valid xhtml anymore
i checked and it adds “p” tags around the 2 closing divs?Well that’s strange!! The plugin works OK in v1.2 & v1.2.1 without any of those tags. That’s a v1.3 bug, you should report it.
Anyway another bug came to my notice as of that. So guys, an update is available, please download the fixed plugin file, no need to download the whole package again if you already have v2Final.
https://blog.igeek.info/still-fresh/2004/11/22/igsyntax-hiliter-2-final/amit: Thanks for the help. I’m using vb.php for vba (Excel) which has some additional/different keywords. When I get it updated, I’ll make it available and you can support vba in your next version – if people want to make that distinction.
If you have a chance, could you look at the blank line issue I’m having. In the second code block on this post
https://www.dicks-blog.com/archives/2004/12/07/using-copypaste-in-userforms/
The “Option Explicit” is one font and everything after the blank line is another. If I put a space in that blank like (or anything else), then it formats everything the same. It happens in the first code block on that post too, the second one is a little shorter and easier to explain.
Thanks for this plugin. It has been a huge time saver for me.dkusleika:
If you have a chance, could you look at the blank line issue I’m having. In the second code block on this post
https://www.dicks-blog.com/archives/2004/12/07/using-copypaste-in-userforms/
The “Option Explicit” is one font and everything after the blank line is another. If I put a space in that blank like (or anything else), then it formats everything the same.I’ll look into it, its pretty strange. Are you using the latest version after the bugfix?
amit: Just to be safe I downloaded it again, but I have the same problems. The modifications I made are to set linenumbers to false, change the gpath, comment out the fixed width line, and remove the strong-hlang-strong-br part of the div. Sorry I don’t know the line numbers of those changes, but I can count them if you need.
With LINE_NUMBERS = True the font it fine. It seems to happen when I change that to false. If you can track it down, that would be great. If not, I’ll live.
Thanks for you help so far.
Dick K.amit: When (if) you look into the blank line thing, check out line 1933 of geshi.php. It looks like the line that should be handling blanks, but maybe there’s a problem with the syntax or something. (Everything I know about php I learned from reading your code and geshi.php over the last few days, so discount what I say as appropriate.)
Another problem I have: See https://www.dicks-blog.com/archives/2004/12/09/selection-stats/ a long comment that uses a line continuation character (space underscore) isn’t all green as it should be. I’m (almost) sure the line continuation character is common to VBA and VB. I presume this is a problem in geshi’s code parsing, but I didn’t know where to report this potential bug. If you want to point me to the place to suggest this, I will do it.
Thanks
Dick K.a long comment that uses a line continuation character (space underscore) isn’t all green as it should be. I’m (almost) sure the line continuation character is common to VBA and VB.
This isn’t supported as of yet, however you are welcome to suggest this to the GeSHi developer by going to GeSHi website at https://qbnz.com/highlighter/
Hi, I am using 2.01 of the plugin but its not doing any colorizing ??
https://www.swaroopch.info/archives/2005/01/17/snakes-and-stones/Can somebody help me figure out the problem?
Thanks
Upgrading to the latest version solved the problem.
Thanks
I’m still having a validation problem after downloading the “patch” 2.01. At the end of the code block it puts:
<p></div></div></p>
Which doesn’t validate. Any help?
One other thing while I’m asking – when I use PHP code blocks, it hyperlinks keywords to their definition. Is there any way to turn that off? I looked through the code and couldn’t find it anywhere. – Nevermind – found it. Still having the validation problems though.
Permalink to a post with code:
Php stuffWhen you write code like this:
[as]
trace(‘hello’);
[/as]You get a
br
tag after the code.
You have to write[as]
trace(‘hello’);[/as]instead, which isn’t as readable.
In php, if you use the open and closing tags, the open tag gets writen like
< ?php
not
<?php
as it should. (a non braking space is added).
- The topic ‘iG:Syntax Hiliter Plugin’ is closed to new replies.