Marko Apfel - Afghanistan/Belgium/Germany

Management, Architecture, Programming, QA, Coach, GIS, EAI

  Home  |   Contact  |   Syndication    |   Login
  187 Posts | 2 Stories | 201 Comments | 4 Trackbacks

News



Twitter | LinkedIn | Xing

Article Categories

Archives

Post Categories

BizTalk

C#

Enterprise Library

SAP

SQL Server

Technologie

Monday, December 8, 2014 #

After a longer period of blogging abstinence I had again to search the right plugin for Windows Live Writer (WLW) to get a pretty printed source code.

I remembered ones in the past which made me really happy. That one I couldn’t find anymore. So I write this article to have a guideline in the future and maybe to collect some advices from you reader, helping me to find that one I initially searched for...

btw: I really appreciate, if somebody could advice me a good blogging software for Mac. Currently WLW is the unbeaten champ, but also with Bootcamp and Parallels it is often not that fluent as I would wish.

Syntax-Highlighter

That DLL (WindowsLiveWriter.SourceCode.dll) I found on an old hard disc. According the timestamp it is from 01. APR 2009. By copying it to the plugin folder (“C:\Program Files (x86)\Windows Live\Writer\Plugins”) it will be available with the next start of WLW as “Source code plug-in”.

Dialog

Straight forward, focusing the necessary things.

image2

Displaying in WLW

There is no hint, that this is specifically rendered content.

image8

Displaying on blog

// A Hello World! program in C#.
using System;
namespace HelloWorld
{
    class Hello 
    {
        static void Main() 
        {
            Console.WriteLine("Hello World!");

            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}

PreCode Snippet

This plugin is available from http://precode.codeplex.com/ and the newest version is from 07. MAR 2010. It comes as an msi and after installation you can find the resources under “C:\Program Files (x86)\FiftyEightBits\PreCode”.

Dialog

The UI goes its own way.

image11[1]

Displaying in WLW

Okay – clearly, this a something special ..

image14

Displaying on blog

// A Hello World! program in C#. using System; namespace HelloWorld { class Hello { static void Main() { Console.WriteLine("Hello World!"); // Keep the console window open in debug mode. Console.WriteLine("Press any key to exit."); Console.ReadKey(); } } }

Syntax Highlighter

For the moment it is the oldest plugin in my test. You can download it on http://wlwsyntaxhighlighter.codeplex.com/ as an msi. After the installation it appears as SyntaxHighlighter in the plugin list.

According the web page there should be an option dialog available – but I couldn’t find it.

Dialog

Condensed to the minimum ..

image17

Displaying in WLW

You cannot click inside that code fragment. It appears as a complete object and so you see this frame around – with the additional links on top.

image20

Additionally on the right a side bar pops up where you can modify the code and set some properties

image6

Displaying on blog

  1. // A Hello World! program in C#.  
  2. using System;  
  3. namespace HelloWorld  
  4. {  
  5.     class Hello   
  6.     {  
  7.         static void Main()   
  8.         {  
  9.             Console.WriteLine("Hello World!");  
  10.  
  11.             // Keep the console window open in debug mode.  
  12.             Console.WriteLine("Press any key to exit.");  
  13.             Console.ReadKey();  
  14.         }  
  15.     }  

Code Highlighter

This plugin is based upon the the code of “Syntax Highlighter”. But instead of forking the original VB code base the author decided to rewrite in C#. Its on you to download an installer or the plain DLL and save that in the plugin folder as described earlier. The second option was sufficient for me. After a restart of WLW a new plugin named “Syntax highlighter”. I don’t know what the official name is – “Code Highlighter” or “Syntax highlighter”. One term appears in the URL and the other one in the plugin themselves.

This file is from 06. DEC 2009.

Dialog

It is pretty much the same as its parent.

image3

Displaying in WLW

Also similar to the parent only other default values for the properties, which you can again modify in the sidebar.

image61

Displaying on blog

// A Hello World! program in C#.
using System;
namespace HelloWorld
{
    class Hello 
    {
        static void Main() 
        {
            Console.WriteLine("Hello World!");

            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}

Code Formatter Plugin for WLW

This plugin you can find here http://code.google.com/p/codeformatterpluginforwindowslivewriter/. You can download an exe or msi, but because the exe calls the msi, you are fine with msi only.

Dialog

It comes with a confusing UI. But you can choose another rendering engine and also the type of insert (as text or png). My first try under Parallels’ coherence mode completely ruined the interface. I was not able to use it at all. This is a test which I also have to make later with the other ones.

The UI is split in two parts – on the left side some options and on the right side more or less as an extension the code window.

image31

Displaying in WLW

Again it is a plugin which freezes the code and shows a frame.

image91

And similar to the others with this behavior it displays then a sidebar for adjustments.

image12

Displaying in WLW

// A Hello World! program in C#.
using System;
namespace HelloWorld
{
    class Hello 
    {
        static void Main() 
        {
            Console.WriteLine("Hello World!");

            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}

Syntax Highlighter from Arnold Matusz

With finishing that article I found my old favorite. It is this plugin you get here http://blog.dreamlabsolutions.com/post/2009/02/19/Syntax-Highlighter-for-Windows-Live-Writer-2009.aspx. Save the dll into the plugin folder and after a restart you can use it.

Dialog

Everything we need and like wrapped in a clear straightforward UI

image[3]

Displaying in WLW

It inserts the code with some formatting options in the back. So there is no frame or the opportunity to modify the appearance later with a sidebar. But of course you can edit the code themselves.

image[6]

Displaying on blog

// A Hello World! program in C#.
using System;
namespace HelloWorld
{
    class Hello 
    {
        static void Main() 
        {
            Console.WriteLine("Hello World!");

            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}

 

 

.