Prabir's Blog

where the tech matters...

Syntax Highlighter for Windows Live Writer v0.2 released

December 06
by prabir 6. December 2009 23:08

Syntax Highlighter v0.2 has been released along with source code at Codeplex. This is an update to my original Windows Live Writer plugin which can be found at http://blog.prabir.me/post/Windows-Live-Writer-Syntax-Highlighter.aspx.

As you might have noticed some of the features such as auto link detection, collapse, gutter (line numbering), toolbar, wrap lines and starting line number have been added.

image

To download the files please visit http://codehighlighter.codeplex.com

or download from windows live gallery.

More features coming soon. If you want to help develop this plug-in please leave a comment below or contact me at http://blog.prabir.me/contact.aspx.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

BlogEngine.NET

Windows Liver Writer Syntax Highlighter Source Code Released

September 13
by prabir 13. September 2009 00:22

In one of my old post http://blog.prabir.me/post/Windows-Live-Writer-Syntax-Highlighter.aspx, I had release the binary of Syntax Higlighter plugin that I had created. This plugin contained the basic functionalities of the Syntax Higlighter plugin, which would more than suffice for an ordinary code.

But due to my hectic schedule and other different projects, I haven’t been able to develop this plugin further. So, I have decided to release the full source  code (at first I was planning to release the source code when the plugin is complete). You can download the code which is hosted by codeplex.com at http://synatxhiglighter.codeplex.com. The code is written in C#.

I have been searching for some developers who would like to contribute to this project. If you are interested please leave a comment below or us the contact page to contact me.

To download the source code please visit http://synatxhiglighter.codeplex.com

You can download the binaries from http://blog.prabir.me/post/Windows-Live-Writer-Syntax-Highlighter.aspx, or directly from one of the below links

Prabir.wlw.Syntaxhiglighter.dll.zip (38.40 kb) [Downloads: 263]
Prabir.wlw.SyntaxHiglighter.msi (Setup) (360.00 kb) [Downloads: 315]

Get from Windows Live Gallery

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

BlogEngine.NET

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: 210]

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

Get from Windows Live Gallery

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , ,

BlogEngine.NET

Windows Live Writer Syntax Highlighter

July 05
by prabir 5. July 2009 21:52

Syntax highlighting technique provides the readers with more attractive and easy to read code snippets. It is one of the must have for a blog (at least for mine). In my previous article I had mentioned about how to integrate Syntax Highlighter 1.5.1 to Blog Engine .NET with help of Windows Live Writer.

Well, this article is about integrating Syntax Higlighter 2.0 Windows Live Writer Plugin(I will be posting another article soon on integrating Syntax Higlighter 2.0 with Blog Engine You can find the article on integrating with blog engine out here). I actually went up searching for syntax highlighter 2.0 plugin support for Windows Live Writer but couldn’t a suitable one. I landed up writing my own plugin. This plugin is based on the modification of a plugin written in VB which can be found at http://wlwsyntaxhighlighter.codeplex.com. (My version of the plugin is written in C#).

You can either download the setup file and install or do it manually. For manual installation you will need to download the zip file at the end of this post and extract the .dll file to C:\Program Files\Windows Live\Writer\Plugins folder. (Please you appropriate destination where your Windows Live Writer is installed.) Next time when you start Windows Live Writer the plugin will automatically be loaded. Click on Syntax Higlighter… to insert you code. To uninstall the plugin make sure Windows Live Writer is not running and delete Prabir.wlw.Syntaxhiglighter.dll from Plugins folder.

image

A new dialog will open where you can choose your language and type the code. In the Language drop down box you can type your custom language even if it is not in the drop down box but make sure you also upload appropriate js scripts to your website to support the language.

image Since it makes use of Smart Content Editor you can later on edit your code using the menu at the right. Since this plugin is still under development. Most of the features are disabled. As of now some of the features that were disabled have been enabled.

 

image

I would also recommend you to read my article on integrating Syntax Higlighter 2.0 with Blog Engine.NET.

You can download the source code along with the latest setup from the codeplex website at http://codehighlighter.codeplex.com/

Prabir.wlw.Syntaxhiglighter.dll.zip (38.40 kb) [Downloads: 263]
Prabir.wlw.SyntaxHiglighter.msi (Setup) (360.00 kb) [Downloads: 315]

Get from Windows Live Gallery

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

BlogEngine.NET

Syntax Highlighter

May 20
by prabir 20. May 2009 18:40

You might have seen a few code snippets that I have been posting in my blog which is powered by BlogEngine.NET. In this article I am going to guide you through installation of Syntax Highlighter 1.5.1 in blog engine. (For Syntax Higlighter 2.0 click here)

First of all you need to download the syntax highlighter from its official site (version 1.5.1) from here and would also require you to install the installer from http://wlwsyntaxhighlighter.codeplex.com (tested with version 2.1.1).

Then you will need to upload the syntax highlighter files (Scripts and Style folder only) to your blog. Then login to your blog as a administrator and go to the settings tab in the control panel of blog engine. In your html head section paste the following code

<LINK rel=stylesheet type=text/css href="Styles/SyntaxHighlighter.css"></LINK>
<SCRIPT language=javascript src="Scripts/shCore.js">
</SCRIPT>
<SCRIPT language=javascript src="Scripts/shBrushCSharp.js">
</SCRIPT>
<SCRIPT language=javascript>
window.onload = function() {
 dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
 dp.SyntaxHighlighter.HighlightAll('code');
};
</SCRIPT>

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

<SCRIPT language=javascript src="Scripts/shBrushCpp.js">
</SCRIPT>

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

SyntaxHighlighter.msi (368.00 kb) [Downloads: 186]
SyntaxHighlighter_1.5.1.zip (41.16 kb) [Downloads: 173]

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , ,

BlogEngine.NET