How can I copy/paste jQuery API examples and retain indentation?

How can I copy/paste jQuery API examples and retain indentation?

I've found the jQuery API code examples on the site to be very informative. I want to copy and paste so that I can adapt them for my own use. When I past the text into an HTML file, I lose all of the nice indenting displayed in the example on the site--code is all on a single line. Are these examples available somewhere else in text rather than html format? Or maybe there is a web app to do auto indenting?
 
Thanks