Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Syntax Highlighter that outputs HTML

I'm looking for a C# syntax highlighter that will take my C# code and turn it into standalone HTML that is neatly tagged. I have found some websites that offer this but only output HTML that is coupled with a CSS stylesheet. If anyone knows if what I'm describing exists please gimme a link!

like image 256
j00b Avatar asked Oct 14 '22 01:10

j00b


2 Answers

I'm using Copy Code in HTML format with Visual Studio 2010 as part of Visual Studio 2010 Productivity Power Tools

like image 133
Sergey Teplyakov Avatar answered Oct 20 '22 18:10

Sergey Teplyakov


The Python tool Pygments looks like it can do what you want and much more besides. I believe it supports many languages, including C#.

  • a wide range of common languages and markup formats is supported
  • special attention is paid to details that increase highlighting quality
  • support for new languages and formats are added easily; most languages use a simple regex-based lexing mechanism
  • a number of output formats is available, among them HTML, RTF, LaTeX and ANSI sequences
  • it is usable as a command-line tool and as a library
like image 40
Andrew Matthews Avatar answered Oct 20 '22 19:10

Andrew Matthews