What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 122 Stack Exchange communities.

I am very curious to know how to implement the Ctrl-K (code sample) feature against code.

For example:

public static void main(String args[]){        
    System.out.println.out("welcome");
}

Will that be nicely formatted?

  1. Do we require any package to implement this?
  2. Any ready made code available to do this?

I am planning to develop a site where this feature would be really helpful.

share|improve this question
6  
Why in the world did this get moved to meta? Sure--it's "about" Stack Overflow, but I'm kinda thinking that answers involving event handlers and cross-browser Javascript libraries belong exactly where the asker asked this, and not here... –  sblom Apr 27 '10 at 14:05
add comment

migrated from stackoverflow.com Apr 27 '10 at 7:35

This question came from our site for professional and enthusiast programmers.

1 Answer

I guest you are looking for Google Javascript code prettifier.

As rsp mentioned in comments it works for the following list of languages.

share|improve this answer
    
@Gierlik, does that work for all the languages –  harigm Apr 23 '10 at 13:13
1  
@harigm, look at the test page: google-code-prettify.googlecode.com/svn/trunk/tests/… –  rsp Apr 23 '10 at 13:20
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .