Syntax Highlighted Code in Your Blog
I sometimes get questions about how to paste syntax highlighted code from Visual Studio into your blog so that it looks purdy, even when using code from a beta product:
var pred = Expression.Lambda<Func<Customer, bool>>(
Expression.Equal(Expression.Property(c1, City),
Expression.Constant("Seattle")), c1);
You should first install Live Writer:
https://get.live.com/WL/config_all
Then go to the Live Gallery:
https://gallery.live.com/?mkt=en-us
Look at all the Live Writer Add ins:
https://gallery.live.com/results.aspx?bt=9&pl=8&st=3
Select the Paste from Visual Studio add in:
https://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9&bt=9&pl=8
Comments
Anonymous
November 13, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/11/13/syntax-highlighted-code-in-your-blog/Anonymous
November 13, 2007
Alternative : http://manoli.net/csharpformat/Anonymous
November 14, 2007
Ben, Yes, the Manoli tools are great. I've used them a lot. Recently I've used Paste from VS because that will capture the cases where the team has added some new feature, usually in a beta, that is not available yet in the manoli tools. There is a manoli add in for LiveWriter.
- Charlie