cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : Lounge : Script for posting C++ code
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Articles
Lounge
Jobs

-

post  Script for posting C++ code

graciano (15)
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
zachlr (17)
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.
|
Zaita (1151)
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
|
graciano (15)
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
zachlr (17)
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.
|
dwk (15)
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.
|
Zaita (1151)
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.
|

This topic is archived - New replies not allowed.
Home page | Privacy policy
© cplusplus.com, 2000-2008 - All rights reserved - v2.2
Spotted an error? contact us