Encode HTML with Ruby
Writing documentation for Javascript and HTML means code samples. These code samples need escaping so that they can be displayed on the web page. Instead of doing it over the web, why not do it in Ruby?
Here are a couple of simple scripts that I did (encode method straight out of the h method in rails):