Syntax Highlighter 2.0 and Blog Engine.Net

This post is a continuation of my previous article on integrating Syntax Highlighter 2.0 with Windows Live Writer. I would recommend you to read it also. This article will take it one step further by learning how to integrate it with Blog Engine.Net 1.5. For Syntax Highlighter 1.5 with Blog Engine and Windows Live Writer you can find my article here.

You will need to download the Syntax Highlighter 2.0 files from http://alexgorbatchev.com/wiki/SyntaxHighlighter or at the end of this post.

You will need to upload the necessary files and folders (scripts and styles folder are only required). Then login to your blog as administration and go to the settings tab of the BlogEngine. In your html head section paste the following code and click save settings.

<link type="text/css" rel="stylesheet" href="/styles/shCore.css" />
<link type="text/css" rel="stylesheet" href="/styles/shThemeDefault.css" />
<script type="text/javascript" src="/scripts/shCore.js"></script>
<script type="text/javascript" src="/scripts/shBrushCSharp.js"></script>
<script type="text/javascript" src="/scripts/shBrushCpp.js"></script>
<script type="text/javascript">
  SyntaxHighlighter.config.clipboardSwf = '/scripts/clipboard.swf';
  SyntaxHighlighter.all();
</script>

At the moment only C# and C++ syntax highlighting is available. If you would like to support more languages please add the appropriate javascript file as shown below

<script type="text/javascript" src="/scripts/shBrushXml.js"></script>

The list of available languages can be seen from Scripts folder that you just uploaded.

syntaxhighlighter_2.0.320.zip (81.54 kb)

Windows Live Writer Plugin (Setup recommended):

Prabir.wlw.Syntaxhiglighter.dll.zip (38.40 kb) Prabir.wlw.SyntaxHiglighter.msi (Setup) (360.00 kb)

Get from Windows Live Gallery