- Download SyntaxHighlighter from http://code.google.com/p/syntaxhighlighter/downloads/list.
- Add this to your Edit HTML code in Layout:
- Put the code you want to highlight inside a <pre> tag like this:
- Make sure you replace the url and also '<' with < if you are using HTML code
- Add this to the top of your post:
- Replace the script name with the one used for your language.
<script language='javascript' src='http://www.url.com/Scripts/shCore.js'></script>
<script language='javascript'>
window.onload = function() {
dp.SyntaxHighlighter.ClipboardSwf = 'http://www.url.com/Scripts/clipboard.swf';
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
}
</script>
<link href='http://www.url.com/Styles/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<pre name='code' class='language'>
code;
</pre>
<script language='javascript' src='http://www.url.com/Scripts/shBrushXml.js'></script>
For more information and language list visit http://code.google.com/p/syntaxhighlighter/w/list.
1 comment:
Nice blog. Can this code work with asp as well. I have to make a project in .net and i want to do this operation in .net so i am going to hire .net programmer for this purpose.
Post a Comment