Setting up WordPress and LiveWriter for code

It seems that the last several blog posts, I’ve fought with LiveWriter as it would butcher any code that I tried to paste in. The frustrating part is the code looks formatted in LiveWriter, but when it posted, it would be all-kinds of messed up. If I Open the blog post back into LiveWriter, it continues to format correctly in Live Writer, but looks messed up on the web page. Very frustrating.

I decided to get to the bottom of this, as it frustrated me every time!

In Live Writer, under the “Insert” ribbon, there is a “Add plug-in” option:

image

I clicked “Add plug-in” and first tried the “Insert code” plug-in. That did not work. It rendered out the CSS to format the code, as in-line text.

I next tried the Code Snippet one. That too butchered the format. However, this one had more options. I realized that if I “embed” the styles, that seems to work (actual example below):

/// <summary>
/// Example XML code comments.
/// </summary>
/// <param name="someArgument">An important argument.</param>
public void TestMethod(String someArgument)
{
Int32 value = 123;
}

I even have some additional options (actual example below):

   1: /// <summary>

   2: /// Example XML code comments.

   3: /// </summary>

   4: /// <param name="someArgument">An important argument.</param>

   5: public void TestMethod(String someArgument)

   6: {

   7:     Int32 value = 123;

   8: }

So the bottom line is, if you’ve been fighting with Live Writer and formatting Visual Studio code, check out this add-in for Live Writer:

http://plugins.live.com/writer/detail/code-snippet-plugin-for-windows-live-writer

Then, make sure to at least set the “Embed Styles” option:

image

Posted in Organization will set you free, Professional Development, Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 9 other followers

%d bloggers like this: