Wednesday 27 May 2009

Is there any C++ syntax highlighter that outputs data suitable for pasting into a HTML document?

Anyone know of some tool that given a .cpp or .h file outputs data suitable for pasting into a HTML document?

What I want is something like this:

Input:

//My class
class A
{
};


Output:

<span class="cplusplus-comment">//My class</span>
<span class="cplusplus-keyword">class</span> A
{
};

By having spans marking up the keywords, comments and other parts of the code, it's all about adding some CSS code to the stylesheet to have the c++ code highlighted.

1 comment:

  1. Have you tried google it? ;)

    http://codecentrix.blogspot.com/2007/05/blogs-and-c-syntax-highlighting.html

    Havent tried the app myself, but I think it's what you are looking for.

    ReplyDelete