MySQL documentation has much improved code examples now: There's syntax highlighting in place, and code snippets can easily be copied to the clipboard. Highlighting is language-aware (including "languages" like the shell/command line). See, for example, this page from the X DevAPI documentation that contains a number of code examples for different programming languages.
Syntax highlighting is a project we planned a year ago, but it turned out to be more complex than we thought it would be. One of the major challenges was performance -- we didn't want the new function to slow down page loading, which is what many highlighting plugins do. Eventually, our striving Web team gave prism.js a try, which works like a charm and doesn't impact performance at all. The Web team also created a little …
[Read more]