Another Syntax Highlighter

03
Jul
2008

Another Syntax Highlighter

Thanks to Alexander Groß for pointing me to syntaxhighlighter.  I still think Leo Vildosola's Code Snippet plugin and highlighter for Windows Live Writer is amazing. They're both good choices - but I thought I'd give syntaxhighlighter a try. It produces less markup than Leo's plugin, although it is dependant on a JavaScript lib on the site for the actual highlighting.

PreCodePlugin_Full_2.0.2 The only challenge in using syntaxhighlighter- is that unlike Leo's all-in-one solution - you need to work out a way to format and encode your snippets first, placing them in either a <pre> or <textarea> element. There are a couple of plugins out there that do this - but I wasn't thrilled with the results, and I've wanted to take a quick look at the WLW plugin API for a while now. Seems like everyone is having a go at this - including Rick Strahl.  So here is my attempt - a code snippet plugin for Windows Live Writer...

Scott also directed me to the Past As plugin on Codeplex - which I'll be trying out as well.

The result - using my plugin - and syntaxhighlighter on the site...

 

public override void CleanUp()
{
    //Remve the Async event listener
    AsyncTaskManager.ItemProcessComplete -= AsyncTaskManager_PreviewItemProcessed;
    this.Logger = null;
}
:-)
Category: