1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[xxsY] XenXero Syntax Highlighter

Discussion in 'Add-on Releases [Archive]' started by EQnoble, Jun 27, 2011.

  1. EQnoble

    EQnoble Well-Known Member

    XenXero Syntax Highlighter

    powered by Google Prettify


    Requirements: King Kovifors BBCM ( BBcode Manager ) , xxsY_bbcode

    Simple explanation: A js based syntax highlighter addon​

    Long winded: Another quick addon I finally got around to making possible without template edits being required for the end users of this mod. This basically colorizes code based on language which it auto detects. The addon package includes a bbcode which must be imported into BBCM which is what allows the end user to print out beautiful looking code snippets of many languages.​

    To test it register@... http://xenxero.com/threads/xxsy-demo-thread.12/

    Thanks very much to Jake Bunce who basically took the foul attempts I made at stripping the url tags and showed me the right way to apply it.

    Usage: [syntax]paste code here[/syntax]​

    1. Extract the contents of the xxsY.v.1.1.0.zip file.
    2. Upload the contents of the UPLOAD directory to the folder you have xenforo installed in.
    3. Install/import the addon-xxsY.xml
    4. Import the bbcode_syntax.xml into the custom BBcode manager
    1. Extract the contents of the xxsY.v.1.1.0.zip file.
    2. Upgrade addon with the addon-xxsY.xml file from the zip file.
    3. Delete the old bbcode and re-import the new one.
    updated 10.11.11

    Attached Files:

  2. James

    James Well-Known Member

    IDEA: Create the custom BB Codes in the syntax highlighting code to avoid having to use the BBCM if you don't have it installed (installing 2 mods for a syntax highlighter seems a little excessive)

    Nice mod though, did you fix the problem with the BB Codes embedding inside the syntax?
    EQnoble likes this.
  3. EQnoble

    EQnoble Well-Known Member

    I just did right now :) ...forgot about that bro...good memory there.

    package updated...if you already installed it just delete the bbcode and re-import the new one.

    Now if you could explain how I would start even going about that...lol This does not use php at all unlike GeSHi so I don't even know how I would include it (bbcodes) in the script which is all js.

    I figured most people looking to use this would probably also be using bbcm but that was just a guess.
  4. Andy.N

    Andy.N Well-Known Member

    What happens to indentation?
  5. lasertits

    lasertits Active Member

    This is nice, but it increased the page load times by quite a bit, disabled and the site sped right back up, enabled and it slowed right back down, even on pages with no syntax highlighting embedded. :confused:
  6. EQnoble

    EQnoble Well-Known Member

    I haven't figured out just yet how to preserve the formatting of pasted text. Ok I lied after starting to write this post instead of wasting time I looked at what I can do to fix this. I have I think and am just testing it now...will update shortly.

    It runs on all pages waiting for a class to convert into a syntax highlighted code box and automatically guesses the language. I can't really do anything about that. Again this is why I am moving on to GeSHi. Sorry I can't help you there...if the experience is that bad with it I recommend uninstalling it and deleting the files uploaded with the package.
  7. EQnoble

    EQnoble Well-Known Member

    Fixed: Updated OP
  8. TazDevilLooney

    TazDevilLooney Active Member

    Very nice app, Love it.

    I would like this to work on the existing links. ;)

    Anything i can do?
  9. Andy.N

    Andy.N Well-Known Member

    The column for line number is too small. For line X00+, you can hardly see the X number.
  10. EQnoble

    EQnoble Well-Known Member

    Thanks! I already was planning on doing this tonight. :) (assuming that I can that is)
    I thought I fixed that...ok maybe I forgot to upload the updated package. (it really is just a few pixels of padding on the left) I am going to eat an early dinner then I will get back to work...I got all caried away with some css for another mod so I kinda got sidetracked today lol. I'll update here tonight.
    Andy.N and TazDevilLooney like this.
  11. Andy.N

    Andy.N Well-Known Member

    Sounds good.
    So what happens to the default bb [code| tag? Can we hook it to use this instead of asking people to use a new bbcode?

    My forum default code syntax is C++ so if it's an option, it would be nice.[/code]
  12. EQnoble

    EQnoble Well-Known Member

    I was going to look into extending that...which is why I released this as a final release sort of. I want to move to GeSHi which would be a better choice to use if one was to try and extend xf's default code tag. The first step is going to be integrating GeSHi then I will try to refactor it into the default code tag. no eta though on that. Could have a miracle and be tomorrow...or I may just croak and bequeath this job as a debt to my closet kin of coders :) Hard to tell lol
  13. TazDevilLooney

    TazDevilLooney Active Member

    Any news on the links EQnoble. :whistle:
  14. EQnoble

    EQnoble Well-Known Member

    I have not even gotten to that yet actually.
  15. TazDevilLooney

    TazDevilLooney Active Member

    This would be a grate addition if it's possible. Keep up the good work EQnoble and i will egally await any further updates. :)
  16. Andy.N

    Andy.N Well-Known Member

    Finally got around to this and would love to hear if you have done much on this since then? Is it embedded elsewhere or this is the only syntax highlight code on XF.
  17. Andy.N

    Andy.N Well-Known Member

    Not sure why it got dull looking, no color and line numbering. Did I miss any configuration?
  18. EQnoble

    EQnoble Well-Known Member

    Gimme a link to a post on your site with the bbcode in use and I'll take a look.
  19. Andy.N

    Andy.N Well-Known Member

    Oh wait, I see what happens. When you first use the [syntax] code, and save the post, the editor will not show the color and line number. Only after a bit or a page refresh it starts to show.
    Is there anyway we can get the editor to show the effect right away?

    I reread what was posted on #5 and #6 and I see I have to wait for the page load to activate this changes.
    I guess I will have to wait till you or someone gets around to do geshi on XF.
    Thanks again for your time.
  20. EQnoble

    EQnoble Well-Known Member


    now strips url tags out of the highlighted code.

Share This Page