Is there a standard way to convert cpp code to HTML (for the purpose of publishing code samples on a website)? I am hoping there is a way to preserve the text coloring used in visual studio. Thanks.
Printable View
Is there a standard way to convert cpp code to HTML (for the purpose of publishing code samples on a website)? I am hoping there is a way to preserve the text coloring used in visual studio. Thanks.
I dont know what compiler you are using but I can do it in dev-c++
I'm using Visual Studio.Net...it's surprising that the option is not available (or at least I couldn't find it). Any other ideas?
Download a copy of Dev-CPP and use it's export feature ;)
Perhaps this page is something for you?
http://www.rafb.net/paste/
Highlight 2.2 is a nice utility that will convert your code into colored output in HTML, XHTML, RTF, TeX, LaTeX, XSL-FO and XML format.
I used to use this - http://www.sunlightd.com/Projects/CPPtoHTML/
i wrote my own little program to do this, pretty easy to do
As I was reading these posts, I was thinking of writing a program to do it...not because it's needed, but it just sounds kind of fun.
I was thinking of using the output of the www.rafb.net page as a starting place on what the HTML should look like.
BTW, thanks everyone for the info.
I just use the <pre> tag
that won't hold up colors or anything...Quote:
Originally Posted by B0bDole
I use this program for HTML and vB exporting of my C/C++ code. It's also capable of Visual Basic code, and since it's open source, you can learn alot from it.
I just finished my own version. Yes...the <pre> tag was useful.