CopySourceAsHtml

| | TrackBacks (1)

Colin Coller has created a very nice plugin for VS.Net called CopySourceAsHtml that lets you create colorized text by copying source from VS.Net. It produces pure HTML code (not the stuff spat out by Word) using embedded stylesheets:

<style type="text/css">
.csharpcode
{
	font-size: 10pt;
	color: black;
	font-family: Courier New , Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0px; }
.rem { color: #008000; }
.kwrd { color: #0000ff; }
.str { color: #006080; }
.op { color: #0000c0; }
.preproc { color: #cc6633; }
.asp { background-color: #ffff00; }
.html { color: #800000; }
.attr { color: #ff0000; }
.alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0px;
}
.lnum { color: #606060; }
</style>
<div class="csharpcode">
<pre><span class="lnum">   167: </span>    <span class="rem">/// <summary></span></pre>
<pre><span class="lnum">   168: </span>    <span class="rem">/// Creates a new socket server object and optionally starts it listening.</span></pre>
<pre><span class="lnum">   169: </span>    <span class="rem">/// </summary></span></pre>
<pre><span class="lnum">   170: </span>    <span class="rem">/// <param name="name">The friendly name for this socket server.</param></span></pre>
<pre><span class="lnum">   171: </span>    <span class="rem">/// <param name="port">The port to listen on.</param></span></pre>
<pre><span class="lnum">   172: </span>    <span class="rem">/// <param name="startListening">Whether to immediately start listening, or wait for a <see cref="StartListening"/> call.</param></span></pre>
<pre><span class="lnum">   173: </span>    <span class="kwrd">public</span> SocketServer(<span class="kwrd">string</span> name, <span class="kwrd">int</span> port, <span class="kwrd">bool</span> startListening)</pre>
<pre><span class="lnum">   174: </span>    {</pre>
</div>

Which turns out looking like this:

   167:     /// <summary>
   168:     /// Creates a new socket server object and optionally starts it listening.
   169:     /// </summary>
   170:     /// <param name="name">The friendly name for this socket server.</param>
   171:     /// <param name="port">The port to listen on.</param>
   172:     /// <param name="startListening">Whether to immediately start listening, or wait for a <see cref="StartListening"/> call.</param>
   173:     public SocketServer(string name, int port, bool startListening)
   174:     {

It's highly configurable and very cool, so if you intend to post code on the web, check it out!

1 TrackBacks

Listed below are links to blogs that reference this entry: CopySourceAsHtml.

TrackBack URL for this entry: http://www.randomtree.org/cgi-bin/mt-trackbacks.cgi/107

TITLE: Evaluating Free Desktop Search Options: Copernic URL: http://haacked.com/archive/0001/01/01/1404.aspx IP: 66.102.135.210 BLOG NAME: you've been HAACKED DATE: 10/19/2004 12:46:10 PM Read More

About this Entry

This page contains a single entry by Eric published on October 18, 2004 8:43 AM.

Multithreading is hard. was the previous entry in this blog.

Defensive Event Publishing for Remoting is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.01