Syntax Highlighting For Code Examples in Web Pages

The google-code-prettify project makes it possible to apply syntax highlighting to code examples in web pages. These notes are based on the Getting Started guide and README.

  1. Include the run_prettify.js script in your page.
  2. Put your code example inside one of the supported elements and give the element the class prettyprint. The script supports the code, pre, and xmp elements.
Unknown's avatar

About Jennifer Phillips Campbell

Software Developer and Medieval Historian
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment