Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

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[]){        

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

migrated from Apr 27 '10 at 7:35

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

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

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
@harigm, look at the test page:… – rsp Apr 23 '10 at 13:20

You must log in to answer this question.

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