You can try SyntaxHighlighter . This does not literally translate C # to the HTML source, but uses javascript instead. All you have to do is link to JS files. For example:
<html> <head></head> <body> <pre class="brush: csharp;"> //put all your code here public class Hello1 { public static void Main() { System.Console.WriteLine("Hello, World!"); } } </pre> <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCore.css"></link> <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemeDefault.css"></link> <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushCSharp.js"></script> <script type="text/javascript"> SyntaxHighlighter.all(); </script> </body> </html>
The result is very good.
It would be very easy to write a script that uses the above template and simply exposes the source code in the right place.
dogbane
source share