Forum Syntax Highlighting

Hi everyone,

So about a month ago when the whole Syntax Highlighting requests came up in the new forum thread I figured it wouldn’t be that hard to just make a Chrome extension to do the same thing. :smiley:

So go and get it on the Chrome Store.

It uses this plugin for highlighting, and for now it assumes every code tag is C (or C++) code because there’s nothing to really tell them apart, but for this forum that should be a fair enough assumption. :stuck_out_tongue:

Who knows when the new Forum will come, and if it’ll have native syntax highlighting, or if I’ll have to update the extension if it doesn’t. But for now, hopefully it comes in handy for some people.

Wow this is legitimately awesome, thanks so much!

So can you post an example of what it would look like? You can use the famous Cory Omnidrive code since it has some nesting and lots of keywords.

(ie convince me to load Chrome and your plugin)

Foster, here is an example from the forums. I personally like it and it makes reading code here easier.

This is awesome, thanks so much for sharing!!!

I’m not sure what the plan is with the forum update, I noticed that the post is still up but has been removed from the homepage.

     printf("Pretty spiffy!");
     // This will make reading code lots easier!
     // Thanks for taking the time to make it work,  now about IE 6 .....

This is a good idea; I’ll put one together for Firefox (the superior browser ;))

That’s cute, I didn’t realize people still used Firefox. Do you still use Netscape Communicator as well? :stuck_out_tongue:

Haha, lol, and all that :slight_smile:

Actually, yes, I do. It’s definitely my favorite program for communicating on the net! I love it’s gray user interface :stuck_out_tongue:

Firefox here. And I only loaded Chrome for this forum to see the code. Once the Firefox port is done Chrome will become a distant memory. I also run Safari on the iPad.

And for what it’s worth I also run a text only browser which is useful for sites that are wildly out of control with little video boxes and other dancing sausages running around the page (cough Slashdot cough Daily Local News cough).

And here it is!

VEXForum Syntax Highlighter for Firefox

The add-on hasn’t been reviewed by Mozilla yet so you’ll get a warning when you click the Add to Firefox button, but don’t worry. I’ve been running it for over a day now on both my desktop and phone and haven’t noticed any problems.

It uses a different plugin than Nathan’s (this one to be specific), so I’m not sure how different it is as I never installed chrome to check.

If you find any problems or just don’t like the color coding for some reason, feel free to let me know.

It is also compatible with Firefox for Android.

Screenshot from Cody’s holonomic tutorial
2015-07-02 17_33_52-Holonomic drives 2.0_ A video tutorial by Cody - VEX Forum.jpg

I like this trend! :slight_smile:

If they don’t fix it / listen, we’ll just fix it for them.

I guess ConVEX / PROS falls under this too, never really thought of it that way before.

Awesomesauce guys!

This is all awesome stuff you guys but it would be super cool if someone could fix this up for safari. I’m hopeless at programming but i would love anyone who would take the time to do Mac users this favor.

I believe you can install Chrome or Firefox on OSX. I’m not sure how developing add-ons for safari is, but other apple development tends to be a bit of a pain and expensive.

I think I have a general solution to this…


My idea didn’t really work.

Too messy, I’m trying to essentially write some PHP that requests the VF HTML and modifies it, then outputs the result.

Problem has everything to do with relative links. Going to my site screws up ALL the relative links. Breaking images, CSS, JS, HREFS, etc.

Replacing them is non-trivial as some of these links need to be rewritten to point back to the “viewing” site, and the HTML of the VF is a mess, some links are absolute, others are relative, etc.

The chrome plugins have the advantage of not having to do this.

So another idea that someone else can chomp on might be to make a page with a fullscreen iframe, then use jQuery to mess with the markup inside the iframe.

IDK. Plugin works for me. Kind of just wish things like the broken Skype logo and the syntax highlighting would just be fixed natively.

This sounds like it could work. I can make and test it tonight (NZ Time) if nobody does before then.

I’m buried in physics HW. Go for it. I believe it should work.

It works, I’m using it right, I’ll try to post some screenshots along with some refined code later on Github.

The iframe plan doesn’t work… trying to access the HTML of an iframe from another domain results in a SecurityError (it is a pretty major security issue if it didn’t).

The only option that I can think of that could potentially work is a server-side script like Cody started to look into that would act as an intermediary… But then you’d need to do some extra cookie handling for authentication, change every URL, etc.
It also introduces the extra issue of authentication information travelling through a third party server, which isn’t exactly desirable.