Prabir's Blog

where the tech matters...

Syntax Highlighter 2.0 and Blog Engine.Net

July 07
by prabir 7. July 2009 21:47

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) [Downloads: 107]

Windows Live Writer Plugin (Setup recommended):
Prabir.wlw.Syntaxhiglighter.dll.zip (38.40 kb) [Downloads: 149]
Prabir.wlw.SyntaxHiglighter.msi (Setup) (360.00 kb) [Downloads: 205] 

Get from Windows Live Gallery


Share/Save/Bookmark Subscribe

Tags: , ,

Blog | BlogEngine.NET | snippets

Comments

7/7/2009 9:54:47 PM #

trackback

Syntax Highlighter 2.0 and Blog Engine.Net

You've been kicked (a good thing) - Trackback from DotNetKicks.com

DotNetKicks.com

7/7/2009 9:56:45 PM #

trackback

Prabir's Blog | Syntax Highlighter 2.0 and Blog Engine.Net

Thank you for submitting this cool story - Trackback from DotNetShoutout

DotNetShoutout

7/12/2009 4:59:01 AM #

Antoine Gemis

Hi Prabir,
Check this extension: sh2forbe.codeplex.com/.../ProjectReleases.aspx
I'm quite happy with it.

Regards

Antoine Gemis France

7/12/2009 7:21:13 PM #

prabir

hi Antonie,
I had seen it before, but never tried it out. Anyways after your recommendation I thought of giving it a try. It was quite simple to just copy and paste. But I ran into some errors when using it. After doing the traditional try..catch..Response.Write(ex.Message).. I figured out that it actually needs read/write permission to access the scripts folder. So after enabling it, the Admin page of the extension was working fine. Now, I'm using this extension.
Thanks for the recomendation.

prabir Nepal

8/4/2009 10:58:21 AM #

Conveyancing Solicitor Quotes

Thanks for providing valuable information on the topic. Keep posting

Conveyancing Solicitor Quotes United Kingdom

9/12/2009 8:45:56 PM #

Si @ Kitchen Installer in Bicester

A great follow-up article - thanks for expanding upon this article. Should help my own intergration I'm working on.

Si @ Kitchen Installer in Bicester United Kingdom

11/1/2009 2:13:49 PM #

pacquiao vs cotto live stream

nice well written article

pacquiao vs cotto live stream United States

12/16/2009 11:06:40 PM #

anonymous proxy

Great insights. I loved to read your article. You must be putting a lot of time into your blog!

anonymous proxy Thailand

12/17/2009 2:32:36 PM #

Bikes

Nice post.

Bikes Thailand

blog comments powered by Disqus