{"id":199,"date":"2006-06-25T22:29:30","date_gmt":"2006-06-26T04:29:30","guid":{"rendered":"http:\/\/jameskovacs.com\/2006\/06\/26\/CopySourceAsHtml+For+VS2005+Released"},"modified":"2006-06-25T22:29:30","modified_gmt":"2006-06-26T04:29:30","slug":"copysourceashtml-for-vs2005-released","status":"publish","type":"post","link":"https:\/\/www.jameskovacs.com\/index.php\/2006\/06\/25\/copysourceashtml-for-vs2005-released\/","title":{"rendered":"CopySourceAsHtml for VS2005 Released"},"content":{"rendered":"<p><a href=\"http:\/\/www.jtleigh.com\/people\/colin\/software\/CopySourceAsHtml\/\">CopySourceAsHtml<\/a> is a godsend for those developers who need to display source code in HTML format. (Blogs, online documentation, and developer forums all come to mind as reasons you need to display code as well-formated HTML.) A version compatible with VS 2005 was just released. To understand why you need this VS add-in, take a look at Hello World as copied and pasted using Edit&#8230; Copy&#8230; Paste&#8230;<\/p>\n<p>using System;<\/p>\n<p>namespace JamesKovacs.Examples {<br \/>&nbsp;&nbsp;&nbsp; \/\/\/ &lt;summary&gt;<br \/>&nbsp;&nbsp;&nbsp; \/\/\/ Summary description for HelloWorld<br \/>&nbsp;&nbsp;&nbsp; \/\/\/ &lt;\/summary&gt;<br \/>&nbsp;&nbsp;&nbsp; static class HelloWorld {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static void Main() {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine(&#8220;Hello, World!&#8221;);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp; }<br \/>}<\/p>\n<p>With CSAH, you get:<\/p>\n<div style=\"background: white none repeat scroll 0% 50%; font-family: Consolas,Courier,sans-serif; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;\">\n<p style=\"margin: 0px;\"><span style=\"color: blue;\">using<\/span> System;<\/p>\n<p style=\"margin: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px;\"><span style=\"color: blue;\">namespace<\/span> JamesKovacs.Examples {<\/p>\n<p style=\"margin: 0px;\">&nbsp;&nbsp;&nbsp; <span style=\"color: gray;\">\/\/\/<\/span><span style=\"color: green;\"> <\/span><span style=\"color: gray;\">&lt;summary&gt;<\/span><\/p>\n<p style=\"margin: 0px;\">&nbsp;&nbsp;&nbsp; <span style=\"color: gray;\">\/\/\/<\/span><span style=\"color: green;\"> Summary description for HelloWorld<\/span><\/p>\n<p style=\"margin: 0px;\">&nbsp;&nbsp;&nbsp; <span style=\"color: gray;\">\/\/\/<\/span><span style=\"color: green;\"> <\/span><span style=\"color: gray;\">&lt;\/summary&gt;<\/span><\/p>\n<p style=\"margin: 0px;\">&nbsp;&nbsp;&nbsp; <span style=\"color: blue;\">static<\/span> <span style=\"color: blue;\">class<\/span> HelloWorld {<\/p>\n<p style=\"margin: 0px;\">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style=\"color: blue;\">public<\/span> <span style=\"color: blue;\">static<\/span> <span style=\"color: blue;\">void<\/span> Main() {<\/p>\n<p style=\"margin: 0px;\">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style=\"color: teal;\">Console<\/span>.WriteLine(<span style=\"color: maroon;\">&#8220;Hello, World!&#8221;<\/span>);<\/p>\n<p style=\"margin: 0px;\">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin: 0px;\">&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin: 0px;\">}<\/p>\n<\/div>\n<p>CSAH is highly configurable with options to display line numbers, change fonts, override tab size, etc. If you have <a href=\"2006\/05\/04\/Consolas-Available-For-VS2005\">Consolas<\/a> installed on your system, the above code snippet will be displayed in it. Otherwise, I configured a fallback to Courier then sans-serif by overriding the font list. (If you don&#8217;t override it, it uses whatever your current editor font is set to.) Awesome VS add-in!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CopySourceAsHtml is a godsend for those developers who need to display source code in HTML format. (Blogs, online documentation, and developer forums all come to mind as reasons you need to display code as well-formated HTML.) A version compatible with VS 2005 was just released. To understand why you need this VS add-in, take a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","category-dotnettools"],"_links":{"self":[{"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":0,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameskovacs.com\/index.php\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}