Saturday, January 19, 2008

Syntax Hightlighter

I just discovered SyntaxHighlighter . It's a javascript library to do syntax highlighting for lots of languages. It seems to work very well, I've changed all the code examples in this blog to use it. I've only found one minor annoyance that I have to use < and > in java code that uses generics, but a bug report has been filed on the issue.
import java.util.List;
import java.util.ArrayList;

public class MyClass {
    
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        list.add("SyntaxHightlighter is nice!");
        System.out.println(list.get(0));
    }
}




No comments: