CCW homepage (exit CCW Forum)

Computer-Chess Wiki Forum

Back to the forum index
Open in thread

Syntax-coloring for programming languages added (General)

by Ron @, Sunday, April 05, 2009, 20:47 @ Ron

For programmers, I added language syntax-coloring
(using Geshi: http://sourceforge.net/projects/geshi/ )

Example:

 
 
// yet another 'Hello World' program
#include <stdio.h>
 
int main(int argc, char **argv)
{
    int i;
 
    for (i = 0; i < 10; i++)
    { 
        printf ("Hello World!\n");
    }
    return 0;
}
 

The CCW Forum supports the following languages:
c, cpp, csharp, css, delphi, html, html4strict, java, java5, javascript, lisp, perl, php, sql, and xml.


To syntax-color C++ code, do this:

[code=cpp]
...

[/code]


For C# highlighting use:

[code=csharp]
...

[/code]


If you prefer your code with no coloring use 'monospace' or:

[code=none]
...

[/code]


If you want me to add another language, just ask for it. (Geshi syntax-colors more than 100 languages so all I have to do is upload the appropriate language file.) If you want to experiment posting various code snippets, add them to this thread and I will periodically delete old posts if the thread gets too big.

My TODO list:
- add a button for 'code' with a drop-down of supported languages
- allow posting of FEN diagrams

If anyone wants a particular feature, just ask, and I will work on it next. Be advised that it might take a month or more...

Ron

  9132 views

Complete thread:

 RSS Feed of thread

3212 Postings in 2138 Threads, 142 registered users, 58 users online (0 registered, 58 guests)
RSS Postings  RSS Threads | Contact
powered by my little forum