Code highlighter

First step is to get a good code syntax highlighter for the blog, to make excerpts easily readable. After looking at a few I’ve settled on Syntax Highlighter ComPress for now, which uses Alex Gorbatchev’s Syntax Highlighter script, supporting a variety of languages, and includes a WordPress control for the editor (if you’re into that sort of thing). An example of C# highlighted code:

public string Foo(int bar) {
    return bar.ToString();

Only issue I had was that the code snippet seemed to get a scrollbar when it didn’t require it, which made for messy scrolling of the page. Easily fixed with some custom CSS:

.syntaxhighlighter {
    overflow: hidden !important;

Something to add?

This site uses Akismet to reduce spam. Learn how your comment data is processed.