I was playing around with Live Writer's (WLW) PlugIn API and am really impressed.  It's clean, hassle-free, and very easy to write an PlugIn, and WLW appears to export a good set of services for plugins to consume.  (Check out the WLW PlugIn gallery for plugins).

 

The basic gist is you just need to write a single class that derives from WindowsLive.Writer.Api.ContentSource (which is included in the LiveWriter download), and then copy it into the Plugins subdirectory under Live Writer's install.

There are more complete instructions on MSDN at http://msdn2.microsoft.com/en-us/library/aa702851.aspx.

But it gets better! The instructions there conclude with:

"7. Build your plugin and then run Windows Live Writer to test and debug."

But you can do the debugging under Visual Studio and fully leverage the VS debugger, including Edit-and-Continue. Just specify Live Writer as the startup project to launch.

Specifically, under "Solution Properties : Debug : Start Action", choose "Start External program" and select WindowsLiveWriter.exe (probably "C:\Program Files\Windows Live Writer\WindowsLiveWriter.exe").

Now if you F5, LiveWriter spins up and loads your extension.

And then you can debug your extension once WLW invokes it, and you can even use Edit-and-Continue to develop and debug your PlugIn.

 

Note this is the same technique that I mentioned for debugging PowerShell cmdlets under the VS IDE. (see that entry for a screenshot of where the "Start External Program" option is.)

 

An example:

You can literally write a 20 line plug-in. Here's a really lame example that converts all URLs to uppercase when you paste them into WLW.  

using System;
using WindowsLive.Writer.Api;

namespace MyLiveWriterExt
{
    // Plugin to take all URLs and convert them to all uppercase.
    [WriterPluginAttribute("{5dc7327d-6a8e-4609-aec0-719cb5db79e8}", "Dummy Plugin", PublisherUrl="http://blogs.msdn.com/jmstall")]
    [UrlContentSource("http://*")]
    public class MyExt : ContentSource
    {
        
        public override void  CreateContentFromUrl(string url, ref string title, ref string newContent)
        {
            newContent = url.ToUpper();
        }
    }
}

 

This also makes me think about Mdbg's (C# command line debugger) plug-in model, and WLW's is definitely cleaner.