Software development, .Net, SQL Server, TDD, Agile, Community and other Odds and Sods
Mitch Wheat has been working as a professional programmer since 1984, graduating with a honours degree in Mathematics from Warwick University, UK in 1986. He moved to Perth in 1995, having worked in software houses in London and Rotterdam. He has worked in the areas of mining, electronics, research, defence, financial, GIS, telecommunications, engineering, and information management. Mitch has worked mainly with Microsoft technologies (since Windows version 3.0) but has also used UNIX. He holds the following Microsoft certifications: MCPD (Web and Windows) using C# and SQL Server MCITP (Admin and Developer). His preferred development environment is C#, .Net Framework and SQL Server. Mitch has worked as an independent consultant for the last 10 years, and is currently involved with helping teams improve their Software Development Life Cycle. His areas of special interest lie in performance tuning
Thursday, March 22, 2007
Source Code Highlighting for Blogger Posts: CopySourceAsHTML
If you have read any of my blog posts that contain C# source code, you will have no doubt noticed the varied, or lack of indentation! It wasn't intentional. I've actually sat down and tried to post entries with lots of source code and then given up in frustration.
I've been using CopySourceAsHTML 2.0, a great little add-in for Visual Studio 2005, for some time but Blogger would lose the indentation when I swapped between the HTML and compose views. I played around with it for a bit today and found settings that seem to work:
I also tried turning off "Embed styles" and placing the small amount of required CSS into the blog template, but I had no luck getting this to work. Let's just say I'm not the world's greatest CSS wizard (Lvl 1, AC10, small kitten...).
CopySourceAsHTML made it into James Avery's must read MSDN article "Ten Essential Tools: Visual Studio Add-Ins Every Developer Should Download Now".
I also came across Jean-Claude Manoli's Code Format Tool which does the job nicely but misses out on the 'Teal' Type colouring that you get from CopySourceAsHTML. It's worth downloading his lean source code for a peek; a very nice piece of coding. Doug Rohm posted a syntax colouring round-up here.
MSN, Email: mitch døt wheat at gmail.com