Coloured Source Code

July 31, 2007 at 1:29 am | In Fun Stuff, Java, Programming | Leave a Comment

 Coloured Source Code for blogs 

If you noticed my previous blogs, Log4j source codes are a plain text with no highlighting of reserved words or like the way it is shown in any of your beloved IDE.

The way I did it previously is to directly use html.

Create a table with the grey coloured background and just paste the source codes in.

I tried to make it looked similar as any Sun’s java sample code. Black text on a grey background.

Something like this :

http://weblogs.java.net/blog/aim/archive/2007/07/embedding_swing.html

Ultimately I still prefer the coloured way of IDE-like this:

public class ColourCoderSample {
    /** Creates a new instance of ColourCoderSample */
    public ColourCoderSample() {
    }
    public static void main(String[] args) {
        System.out.println("Test message");
    }
}

It’s done through a webpage by shinder lin with a modified tool from Jasper Bedaux.

http://www.riarock.com/as2html/as2html.htm

The colour is for C++ but it can be modified to suit your liking.

   Links: 

http://adamflater.blogspot.com/2007/02/on-source-code.html

http://www.riarock.com/as2html/as2html.htm

No Comments Yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.