MVP Asaf Shelly suffered a problem which is common to many developers. How do you display you own code on the web? Code tends to look bad as a plain text file, and colouring becomes a problem whenever updates are made to the code and republished to blogs. Therefore, he decided to solve this problem by authoring a handy tool and is making the source code open to the community!
In Asif’s own words:
“Bottom line is that I decided to finally do it. It took me less than 12 hours of work to produce a text parser that produces HTML files for C/++/# files. It is only appropriate (and simple :) to share the source code of this generator as the first project that I share”. The project publisher tool has three basic elements:
A C# library with ProjectPublisher.cs which is the engine, a C# WebService that uses the library with the source file ProjectPublisherWSvc.asmx.cs, and a simple web page demonstrating the use of the WebService called Default use of ProjectPublisherWS.aspx.cs”.
He has also made available a web service where you can post snipped code and get well formed HTML back for you web page.
Click here to learn more about the Web Service. Download the code here, and read Asif’s community contributions by reading his blog.