Skip to content
Wraps Google Prettify into a nice little bow for easy inclusion into any website or blog
JavaScript Perl
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
google-code-prettify-min
google-code-prettify
images
javascripts
stylesheets
themes
README.md
_config.yml
demo.html
index.html
params.json
styleCode.js

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"
<<<<<<< HEAD
    href="http://mnewt.github.com/prettify-wrapper/prettify.css">
=======
    href="http://mnewt.github.com/prettify-wrapper/tomorrow-mnewt.css">
>>>>>>> gh-pages
  <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 hosted here. They are slightly modified versions of the ones found above.

Something went wrong with that request. Please try again.