PDA

View Full Version : Code-Coloring



Vber
01-08-2003, 03:31 PM
Guys, what about a code-coloring script to the forum?
This will be very nice for posting source-code, and it's not difficult to build something like that. What you guys think about this idea?

Hmm, the script could be Client-side or server-side no matter...

Look an example:


#include <stdio.h>
#define FOO 10

int main(void)
{
char foo;
int foo2;

printf("This is green");

for (foo2 = 0; foo2 <= 10; ++foo2)
printf("%d\n",foo2);

return 0; //comment here, return ok

}

-KEN-
01-08-2003, 03:38 PM
You mean like the PHP tag? :rolleyes:


#include <stdio.h>
#define FOO 10

int main(void)
{
char foo;
int foo2;

printf("This is red");

for (foo2 = 0; foo2 <= 10; ++foo2)
printf("%d\n",foo2);

return 0; //comment here, return ok

}


I think that the PHP tag is insanely ugly, though. I want to shoot anyone who uses it.

Vber
01-08-2003, 03:42 PM
but specially designed to C/C++ source code.
the php tag is so ugllyyyyyyyyyyyy :D

RoD
01-08-2003, 07:37 PM
Actually i wouldn't mind it, my compiler window is color customized so i can better read it.

MethodMan
01-08-2003, 08:06 PM
I agree, it would really help for readability, although the PHP one doesnt seem too bad to me.

I dont always use it, but had it setup for Java, and and HTML editor, comes in handy sometimes :D.

RoD
01-08-2003, 08:30 PM
The PHP tag tends to be very wide....

Eibro
01-08-2003, 09:08 PM
I started work on one last week, it's fairly complete. Between it and another project i'm working on, it should be done sometime soon... I'll post it.

Sunlight made one, you can get it on his website (www.sunlightd.com)

Vber
01-08-2003, 11:29 PM
Maybe I can help you. You're building one server-side or user-side?

Hmm, Once I did a nice code-coloring to DCForum's, in JS and PHP.