How to: Change settings in CopySourceAsHtml for use with Community Server
I've been using CopySourceAsHTML for some time now to add source code to my blog posts. Until recently, you could find it on GotDotNet.Com. But that site has now shut-down. Fortunately, the author sent me the new link for a download of this excellent tool.
I know a lot of you have trouble setting it up when using it to copy source code to your Community Server blog. I therefor updated this blog post with the correct URL's and moved it back to the top of my blog posts. This blogpost describes the settings I currently have and that allow me to quickly paste code into my blog.
After installing CopySourceAsHTML, you get the option "Copy as HTML.." when you right-click on a selection in your code. When you choose that option, you get the following window:
Here you see my current default settings. When you change your settings to match these you can use my CSS code. In the File Style Tab, add the following css overrides:
border-top: windowtext 1pt solid;
border-left: windowtext 1pt solid;
border-right: windowtext 1pt solid;
border-bottom: windowtext 1pt solid;
Click OK and you're ready. You have the HTML for the code you selected in your clipboard and you can paste it directly in your blog post.That's all. Your code looks great, as you can see in this example, you get scroll bars when it doesn't fit the browser window width and, of course, syntax highlighting.
These settings work for both VS 2003 and VS 2005. Since it relies completely on the CSS information above, it will not interfere with other stuff.
If you want to limit the height of your <div> section, then this is of course no problem. Simply change the HTML for the blogpost and do something like this:
<div style="HEIGHT: 150px">