Script for posting C++ code

I need a script to convert C++ sourcecode into HTML.
The reason is that every time i trie to post some code into Moodle, Wordpres or other resource, it loses all configurations.
I tried this script but it does not work 100% for me.

http://www.simplebits.com/cgi-bin/simplecode.pl?mode=process

What I would really like to know is how this is done in this forum … if possible of course 
I really like the effect and efficiency of this look:

1
2
3
4
5
6
7
8
9
#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[]){
	QApplication app(argc, argv);
	QLabel *texto = new QLabel("Bom dia QT!");
	texto->show();
	return app.exec();
}


I would really apreciate some help on this subject.
Thanks

Last edited on
I'm not sure if C++ can be converted into HTML. C++ is more programming, while HTML is more coding. For example, C++ doesn't have clickable text links, HTML does. What would you write in C++ to get a link into HTML? They are so different, I'm not sure it is possible. Correct me if I'm wrong.
I think what he wants is a way to show code on his website. There is a nice little tool that can do this. I have used it on my own site. I will try and find it tonight and post the link :)

I think it was called Cpp to HTML. Simple enuff
Zaita gets the point, zachir is way too far :)))
I managed to find the soluction for "wordpress". See here: http://gracianotorrao.wordpress.com/2008/05/01/como-publicar-codigo-fonte/
What i was really interested was the code for the program that converts C++ code into HTML for web publishing ;)
Last edited on
Wow, I was way off. I feel like a retard now.

I had it right the first time, but then I second guessed myself because I expected to see "syntax highlighting" or "format" or something in the post somewhere.

Now that I reread the post a week later, it seems so obvious.
Maybe you can get something out of
http://www.gnu.org/software/global/

It creates "browseable" sourcecode. Not excatly what you want but maybe you can use some of the ideas.
http://bedaux.net/cpp2html/
http://www.codeproject.com/KB/cpp/cpphtml.aspx

2 solutions that work. I believe I use the 2nd one at home.

Z.
Topic archived. No new replies allowed.