Riaan Lehmkuhl's Blog

Subversion, Progamming, Tips & Tricks and whatever else springs to mind.
27Jul

Updated SyntaxHighlighter Extension for BlogEngine.NET

27 July 2008 12:52 by Riaan Lehmkuhl

Looking for ways to add syntax highlighting to my blog I came accross Scott Dougherty's article for Adding SyntaxHighlighter to BlogEngine.NET and then Chris Blankenship's SyntaxHighlighter Extension for BlogEngine.NET.

I really like his extension, but I wanted the installation path and loaded language scripts to be configurable so I've updated his extension to use the BlogEngine Extension Manager.

  1. Download SyntaxHighlighter
  2. Extract and upload the SyntaxHighlighter code to your blog (I renamed the dp.SyntaxHighlighter directory to just SyntaxHighlighter)
    eg. ~/extensions/SyntaxHighlighter
  3. Download, extract and upload the SyntaxHighlighter.cs file into the ~/App_Code/Extensions directory

    NOTE:
    If you already had the SyntaxHighlighter Extension from Chris Blankenship installed, you might have to delete the "~/App_Data/datastore/extensions/SyntaxHighlighter.xml" file before the new extension settings will be loaded.

  4. Login to your blog and go to "Extensions" under the "Control panel"
  5. Click on "Edit" next to the "SyntaxHighlighter" extension and configure as required (see preview below)

SyntaxHighlighter Extension Manager

For a list of supported languages see the syntaxhighlighter wiki

For Windows Live Writer support:

  1. Download and install Windows Live Writer and the SyntaxHighlighter for Windows Live Writer plugin (Requires .Net 3.5 framework)
  2. Update the blog style (In Live Writer under the "Weblog" menu then "Edit Weblog Settings..." and click on the "Editing" tab)

NOTE:
If you have custom ordered list item styles in your theme, you might have to make a small change to the SyntaxHighlighter CSS. In my case I've got a custom list-style-image so I had to make the following change in the "SyntaxHighlighter\Styles\SyntaxHighlighter.css" file:
in the following bit, I added list-style-image: none;:

/* clear styles */
.dp-highlighter ol,
.dp-highlighter ol li,
.dp-highlighter ol li span 
{
margin: 0;
padding: 0;
border: none;
list-style-image: none;
}
Here's the diff:
Index: /BlogEngine/BlogEngine.Web/extensions/SyntaxHighlighter/Styles/SyntaxHighlighter.css 
=================================================================== 
--- /BlogEngine/BlogEngine.Web/extensions/SyntaxHighlighter/Styles/SyntaxHighlighter.css 
+++ /BlogEngine/BlogEngine.Web/extensions/SyntaxHighlighter/Styles/SyntaxHighlighter.css 
@@ -17,6 +17,7 @@
margin: 0;
padding: 0;
border: none;
+	list-style-image: none;
}
.dp-highlighter a,

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

7/29/2008 2:29:57 PM #

Janko

Wow, there is a lot of languages supported. Very nice!

Janko sp

2/10/2009 11:42:53 AM #

Watch UFC 95 Live Stream

You have a nice domain. thanks for the post

Watch UFC 95 Live Stream United States

3/13/2009 7:09:10 AM #

Home of Natures

thanks for the codes and yes you have a nice domain.thanks for sharing.

Home of Natures United States

3/21/2009 3:03:33 PM #

short life quotes





Your blog came up when I searched for help. This was actually what I was looking for, and I am glad that I finally came here! Thks for sharing and keep up the good work

short life quotes United States

3/23/2009 12:21:56 PM #

Gadgets in Future

glad to have the SyntaxHighlighter Extension for BlogEngine.NET

Gadgets in Future United States

3/24/2009 4:09:12 AM #

home of natures

Hellow, a pleasant day to all, i am enjoy reading your website or blog, and i got many ideas for my blg. Thanks for the information about this topic . I want to see the many development of this site.

home of natures United States

3/24/2009 5:09:52 AM #

articlecycle

SyntaxHighlighter is here to help a developer/coder to post code snippets online with ease and have it look pretty. It's 100% Java Script based and it doesn't care what you have on your server.

articlecycle United States

3/24/2009 6:13:49 AM #

seo alaminos

thanks for the all new SyntaxHighlighter Extension for BlogEngine.NET

seo alaminos United States

3/26/2009 7:40:21 AM #

teen pinoy bigbrother

Hi, thanks for the information. I got many ideas for my blog or website. I visit again to this site if there a new improvement.

teen pinoy bigbrother United States

3/27/2009 4:36:50 AM #

kampanye damai pemilu

thanks for this usefull informations.. now i find what iwant to know.. thank you..

kampanye damai pemilu United States

3/28/2009 8:10:26 AM #

RF Outsource

this is im looking for great thanks a lot for this wonderful topic you have thanks for sharing i appreciate it
and i learn something new here,

RF Outsource United States

4/24/2009 12:27:44 PM #

side effects of kamagra

Nice extension, thanks

side effects of kamagra United States

4/30/2009 4:58:48 AM #

ka-blogs

Thank you for sharing with us some steps in updating SyntaxHighlighter Extension for BlogEngine.NET to BlogEngine.

ka-blogs United States

5/2/2009 1:39:26 PM #

Leadership

What a great story that really shows how the blogengine community can work together to create great extensions!

Leadership United Kingdom

5/15/2009 6:53:03 PM #

Best Diet Pills

im glad the new one isnt full of errors

Best Diet Pills United States

Comments are closed

Riaan Lehmkuhl


Me, a disorder of the brain that results in a disruption in a person's thinking, mood, and ability to relate to others.

Recent comments

Comment RSS

Thingies

Calendar And Month List

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Disclaimer & Privacy

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Privacy:
We use third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

Most comments

Kevin Kevin
1 comments
gb United Kingdom
Moneymaker Moneymaker
1 comments
Indonesia Java International Destination Indonesia Java International Destination
1 comments
us United States

Cool Quote

I know that you believe that you understood what you think I said, but I am not sure you realize that what you heard is not what I meant. - Robert McCloskey