6

I have a blog about programming hosted on WordPress.com. To post code snippets I use the SyntaxHighlighter plugin that is installed on that platform, and I'm very happy with it.

Now, I'd like to use Windows Live Writer to write my articles, because it's much more convenient than the web-based editor. I found many WLW plugins to post code snippets, but it would take ages to try them all... also, most of them seem to do their own formatting, or need custom CSS (which I'd prefer to avoid because it's not free). Ideally, I'd like to be able to continue using the SyntaxHighlighter WP plugin mentioned above, which allows me to simply paste code between [sourcecode] tags, like so:

[sourcecode language="csharp"]
public class SimpleGrid : Grid
{
    public IList<GridLength> Rows { get; set; }
    public IList<GridLength> Columns { get; set; }
}
[/sourcecode]

Which WLW plugins would you recommend ? Is there one that can produce the markup shown in the snippet above ?


EDIT: This one does exactly what I want, thanks to jjeaton for the link !

1
  • Thanks for asking this! I have been editing my posts in the html view for some time, adding the <pre class="brush:csharp"> by hand. Oct 9, 2010 at 15:47

1 Answer 1

5

Here is a WLW plugin that seems to do what you want, made specically for WordPress.com hosted blogs.

4
  • OK, just tried it. It's really nice, but not exactly what I was hoping... It doesn't use the [sourcecode] tags described above, instead it uses lots of Javascript and CSS. But still, it's pretty good, so I think I'll keep it. Thanks ! Oct 8, 2010 at 12:31
  • That's interesting... it says specifically on that page "It inserts the correct ‘Wordpress shortcode’ entry around your code snippet to ensure it is displayed correctly in your WordPress.com blog."
    – jjeaton
    Oct 9, 2010 at 0:05
  • See this comment on the post the JavaScript and CSS only shows up within Live Writer, it sends the actual shortcode to WordPress.
    – jjeaton
    Oct 9, 2010 at 0:09
  • Indeed, I was mistaken... it does exactly what I want. Thanks again ! Oct 9, 2010 at 0:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.