• entries
44
101
• views
44530

# Source syntax highlighting

426 views

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")

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

Python (lang="python")

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

Sample here.

## 1 Comment

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
[/source]

versus

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

## Create an account

Register a new account