Adding Javascript Snippets to the docs