WordPress.org

Ready to get started?Download WordPress

Forums

124

iG:Syntax Hiliter Plugin (104 posts)

  1. Amit Gupta
    Member
    Posted 9 years ago #

    I released iG:Syntax Hiliter Plugin yesterday. Its available at http://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( :o ) and any feature requests. :)

  2. ieure
    Member
    Posted 9 years ago #

    "Unknown host blog.igeek.info"

  3. Amit Gupta
    Member
    Posted 9 years ago #

    check your connection again. The webserver is online & accessible. Try http://blog.igeek.info/ instead of just putting blog.igeek.info :)

  4. Beel
    Member
    Posted 9 years ago #

    It was inaccessible for awhile, at least the actual download. Seems fine now.

  5. davidprince
    Member
    Posted 9 years ago #

    I have followed the directions in the manual but am encountering the following error when trying to use the plugin.
    Fatal error: Cannot instantiate non-existent class: geshi in (path)/syntax_hilite.php on line 31
    Any thoughts?

  6. Amit Gupta
    Member
    Posted 9 years ago #

    Have you followed the directions in the Manual word-to-word?
    The syntax_hilite.php file should be in your plugins directory.
    Before activating the plugin, change $pPath variable to the physical path to the directory(wp-includes recommended) where you uploaded the geshi directory & geshi.php, also note that relative paths won't work.

  7. davidprince
    Member
    Posted 9 years ago #

    Yes I followed the directions in the manual word for word.
    The syntax_hilite.php file was in my plugins directory and was activated. I changed $pPath however I may have messed this step up, as I don't comletely understand physical path. Lets say that the geshi.php and geshi directory are in http://davidblog.ws/blog/wp-content/. What should this line be.
    I have a feeling I have it correct at the moment because otherwise I recieve many more errors on all of my blog pages. But who knows, I am pretty slow sometimes.

  8. benramsey
    Member
    Posted 9 years ago #

    The site's not coming up for me, either. The domain name isn't resolving in my browser, nor can I ping it. It just times out.
    Looks like your site's either down, or a router is down between me and your site.

  9. Amit Gupta
    Member
    Posted 9 years ago #

    @davidprince:-

    as I don't comletely understand physical path

    Create a new PHP file & copy the following code in it.


    <?php
    $pPath = $_SERVER["PATH_TRANSLATED"];
    echo $pPath;
    ?>


    Name this file as path.php & place it the same directory where you have placed geshi.php & the geshi directory. Call this file in the browser. So if you have placed this file in the wp-contents directory, then you call it as http://davidblog.ws/blog/wp-content/path.php Copy whatever the file outputs on screen, & remove path.php from its end. Now you have the physical path of the directory where geshi.php & geshi directory resides. Place this path in the $pPath variable of your syntax_hilite.php file. Just make sure that it has no spaces at either end of it & it ends with a trailing slash(/).
    @benramsey:-

    Looks like your site's either down, or a router is down between me and your site.

    The site isn't down or I would have known. I've got 5 website monitoring services checking on it all the time. :) Looks there's a problem with the router between you & the website.

  10. dodo
    Member
    Posted 9 years ago #

    hrm why isn't my code color coded? test
    http://pure-essence.net/index.php?p=890

  11. dodo
    Member
    Posted 9 years ago #

    i tried apply the filter to comment_text but it seems to work differently...

  12. Anonymous
    Unregistered
    Posted 9 years ago #

    This version conflicts with Textile 2 (improved)
    http://jimandlissa.com/project/textilephp
    Results in recursive looping output.

  13. Anonymous
    Unregistered
    Posted 9 years ago #

    Also, is there a way you can add in functionality to make optional the prefix "CSS:" or "HTML:" for the block of code being hilited? I really hate that big, bold "CSS:" that automatically gets stuck before my code. I mean, if I'm talking about CSS, it's obviously going to be CSS in the code block - no need to reiterate.

  14. Anonymous
    Unregistered
    Posted 9 years ago #

    Yeah, I just added a little conditional jiggery-pokery along with an additional constant & we're it's all better w/ the prefix text. Any word as to the next update?

  15. Amit Gupta
    Member
    Posted 9 years ago #

    well, as I've been a bit busy for the past week, the work on next version has really slowed down. :(
    But I'll try to release it ASAP.

  16. Amit Gupta
    Member
    Posted 9 years ago #

    I've just released iG:Syntax Hiliter v2.0 Preview. It has new GeSHi core(v1.0.1) & has line numbering by using Ordered Lists & it prevents formatting of your code by WordPress. More info & download link at http://blog.igeek.info/still-fresh/2004/09/21/igsyntax-hiliter-2-preview/.

  17. Amit Gupta
    Member
    Posted 9 years ago #

    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. :)

  18. dkusleika
    Member
    Posted 9 years ago #

    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?
    Thanks

  19. dkusleika
    Member
    Posted 9 years ago #

    Me again: Could you look at
    http://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.

  20. dkusleika
    Member
    Posted 9 years ago #

    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.

  21. Amit Gupta
    Member
    Posted 9 years ago #

    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.
    http://blog.igeek.info/still-fresh/2004/11/22/igsyntax-hiliter-2-final/

  22. dkusleika
    Member
    Posted 9 years ago #

    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
    http://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.

  23. Amit Gupta
    Member
    Posted 9 years ago #

    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
    http://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?

  24. dkusleika
    Member
    Posted 9 years ago #

    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.

  25. dkusleika
    Member
    Posted 9 years ago #

    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 http://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.

  26. Amit Gupta
    Member
    Posted 9 years ago #

    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 http://qbnz.com/highlighter/

  27. swaroopch
    Member
    Posted 9 years ago #

    Hi, I am using 2.01 of the plugin but its not doing any colorizing :(
    http://www.swaroopch.info/archives/2005/01/17/snakes-and-stones/

    Can somebody help me figure out the problem?

    Thanks

  28. swaroopch
    Member
    Posted 9 years ago #

    Upgrading to the latest version solved the problem.

    Thanks

  29. nontoxic
    Member
    Posted 9 years ago #

    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?

  30. nontoxic
    Member
    Posted 9 years ago #

    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 stuff

124

Topic Closed

This topic has been closed to new replies.

About this Topic