Jump to content
  • Advertisement
  • entries
  • comments
  • views

Source syntax highlighting

Sign in to follow this  
Michael Tanczos


Man.. haven't posted in a while. I finally threw out the old "new" syntax highlighter in favor of one I wrote myself. The other one was XML-based for each language and rendered code using XSL.. great for small pieces of code.. but it gets *extremely* slow as the amount of code gets bigger.

Anyway, the new one works in a similar manner. I was a bit ambitious since it went pretty well.

You can now utilize the regular [ source lang = "???" ] tags for the following languages:

Visual Basic / VBScript (lang="vb" or lang="vbscript")
Java (lang="java")
C/C++ (lang="c" or lang="cpp") .. default
X86 Assembly (lang="asm")

Update! Added:

C# (lang="c#" or lang="csharp")
javascript/JScript (lang="javascript" or lang="jscript")

Update! Added:

Python (lang="python")

.. I think I'm done for now. =P

Sample here.
Sign in to follow this  

1 Comment

Recommended Comments

There's always actionscript, but since it's 99% the same as javascript/jscript, the javascript/jscript handler should work fine with it. Just nitpicking.

Oh, and your tag above doesn't work as you wrote it. If you put a space in the "lang =" part, it doesn't work. Case in point.

[source lang = "c"]
//this is some C code


//this is some C code

I do need to go back and re-code the listings in my old entries. Putting stuff in the code-tags looks much nicer.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!