Code syntax highlighting with Windows Live Writer

The two main reasons why I’m blogging is to share my findings with others and to find the solution to a problem I previously solved. Quite a few times already did I come to my own blog, because I know I had that working code snippet up here. Nothing is more frustrating than to see the solution of your problem in front of your nose and to find out it’s nicely encapsulated in a screenshot. It still happens too often that people aren’t using a plugin for placing code snippets on their blog.

Personally I’ve been a big fan of Alex Gorbatchev his SyntaxHighlighter for several years already. There’s also a module available for it on Orchard. This plugin uses <pre> tags to not only highlight the code according to the language’s keywords (with brushes for all the major languages), but also provides line numbering a great copy-paste experience which strips out the line numbering (which some plugins don’t do).

To write my blog posts, I’m still using Windows Live Writer (part of the Live Essentials suite) on Windows 8. Why? Because in my opinion it’s still the best writing tool! Add the PreCode plugin for your code snippets and you’re good to go.

WindowsLiveWriter PreCode plugin

Licensed under CC BY-NC-SA 4.0; code samples licensed under MIT.
comments powered by Disqus
Built with Hugo - Based on Theme Stack designed by Jimmy