Easy Way to Formate Code in WordPress using Windows Live Writer
I’m using CodeColorer for my WordPress, it is the plug in which allows you to insert code snippets into the post with nice syntax highlighting. It uses [ cc lang="matlab"] MatlabCode [ /cc ] syntax. I found a plug in available in Windows Live Writer, I am now be able to just highlight a line of code and using the plug in to simply formate the code with the syntax I pre-configured automatically.
Edit the template
What I want to achieve here is to high light a line of code, and use the plug in to warp it with <code lang=”matlab”>The highlighted text here</code> Since this template just adds HTML around a selection and doesn’t require that I ask for user
input, I don’t need to create a variable.

And now I can just select some text, click on Insert Template… and double click Code. Nice!
Another useful template
Another useful template is one that Joe calls Htmlize.

As you can see, you can call some functions from within a template. This one is useful for converting something like blah
into blah while in the Web Layout or Normal mode.
Further Reading & Reference
- Watch Joe’s Screencast for a demo of a template that takes in user input as part of the template.
- There’s also some documentation located here. This is a pretty handy plugin that’ll be great for automating a variety of html snippets I use often.
- 45-second screencast and see for yourself; find out more; then go download.

