# Monday, 08 November 2004

I've had this installed for some time, but haven't used it enough. I tend to be very particular about the formatting of code on my site and CopySourceAsHtml written by Colin Coller makes it easy!

Just highlight the code in Visual Studio, choose “Copy as HTML...” from the right-click menu, and paste into the blog entry.

You'll get options for line numbering, word wrap, etc. You can also add additional CSS rules that will be applied to the whole copy, a line, or a block. Just look at these results:

    1 using System;

    2 using System.Xml.Serialization;

    3  

    4 namespace CardCatalog {

    5     [XmlRootAttribute( "catalog", Namespace="", IsNullable=false )]

    6     public class Catalog {

    7         private Book[] items;

    8  

    9         [XmlElementAttribute( "book" )]

   10         public Book[] Items {

   11             get { return this.items; }

   12             set { this.items = value; }

   13         }

   14     }

   15  

   16     public class Book ...

   67 }

Monday, 08 November 2004 15:35:57 (Pacific Standard Time, UTC-08:00)  #    Comments [0]
Comments are closed.