0

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.

2
  • 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
    Commented Apr 27, 2010 at 14:05
  • 4
    Does this answer your question? Cannot understand how the Ctrl+K works in Stack Overflow
    – iammilind
    Commented Dec 29, 2019 at 15:51

1 Answer 1

3

I guest you are looking for Google Javascript code prettifier.

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

2

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