I wanted a syntax or code highlighter solution for my site (BlogEngine) but have no lady luck in getting it up on the first 3 attempts and spent quite a good amount of time troubleshooting :(
The Syntax Highlighter solution by Chris Blankenship that I feel is the best so far is:
Well, the mistake I’ve made is that in order for this to work, you MUST use Windows Live Writer with the plugin to post. This is the caveat.
$j = jQuery.noConflict();
$j(document).ready(function() {
var shBasePath = 'dp.SyntaxHighlighter/';
var shScriptPath = '/js.axd?path=' + shBasePath + 'Scripts/';
$j.getScript(shScriptPath + 'shCore.js', function(){
dp.SyntaxHighlighter.ClipboardSwf = shScriptPath + 'clipboard.swf';
$j('head').append('<link href="/css.axd?name=' + shBasePath + 'Styles/SyntaxHighlighter.css" rel="stylesheet" type="text/css" />');
...
};
})
Yes!!! It’s finally working! :) Thanks to Chris. I didn’t know that I must use it with Windows Live Writer.
PS: I’m now using the jQuery method. The cool thing is that it helps to save your bandwidth by downloading only the necessary scripts.