Fix fix sort_by example, and remove trailing whitespace.

This updates the docs.  My editor automatically strips whitespace, so this is a larger than intended diff.  However, the only semantic change is around line 244 where more sort_by examples are shown.