When I first started posting code to the site, it took me a while to format it correctly, until I realized there are many plugins available for automatically doing this. When I was using a self hosted WordPress site, I could install plugins or insert a custom css to format the code block like I want, but I soon found out that was not the case for WordPress.com sites as there is no control to install new plugins or change the CSS.
However WordPress.com supports a short code for highlighting sourcecode.
A quick search for Windows Live Writer plugins that support this short code turned up many. I tried a few of the code highlighters and finally settled on the one posted by Rich Hewlett called WLW Code Plugin.
A C# code would look like below:
1 2 3 4 5 6 7 8 |
public void OnPropertyChanged(string propertyName) { if (this.PropertyChanged != null) { PropertyChangedEventArgs args = new PropertyChangedEventArgs(propertyName); this.PropertyChanged(this, args); } } |
UPDATE: I have now stopped using this plugin as I prefer the plugins that use the ‘<pre>’ tag which is more standard and backward compatible.