Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Wraps Google Prettify into a nice little bow for easy inclusion into any website or blog
JavaScript
tree: 4718347dc8

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
images
javascripts
stylesheets
themes
README.md
index.html
params.json

README.md

google-code-prettify wrapper

This repository serves up google prettify. It allows you to add code highlighting to any page without hosting any files. It has no external dependencies--just pure javascript.

Directions

ONE: copy the code in reference.html into your web page, at the end of the file right before </body> The end of your html template should look like this:

<!-- ======================= Begin Prettify ============================-->
  <link rel="stylesheet" type="text/css" rel="stylesheet"
    href="http://mnewt.github.com/prettify-wrapper/tomorrow-mnewt.css">
  <script type="text/javascript"
    src="https://raw.github.com/mnewt/prettify-wrapper/master/google-code-prettify/src/prettify.js">
    </script>
  <script type="text/javascript" src="https://raw.github.com/mnewt/prettify-wrapper/master/styleCode.js">
    </script>
<!-- ======================== End Prettify =============================-->
</body>
</html>

TWO: (optional): customize the theme by pointing the first line to a different CSS file, such as this one: https://raw.github.com/mnewt/prettify-wrapper/master/tomorrow-night-mnewt.css

Themes

There are a few themes included in the package itself: http://google-code-prettify.googlecode.com/svn/trunk/styles/index.html

jmblog maintains some nice themes: http://jmblog.github.com/color-themes-for-google-code-prettify/

Lastly, here are some themes I'm hosting. They are slightly modified versions of the ones found above.

Something went wrong with that request. Please try again.