JavaScript HTML CSS Other
Switch branches/tags
Latest commit 5e0b27b Aug 11, 2016 @spencewood committed on GitHub Merge pull request #12 from priley86/master
update to 1.0.5

Google Code Prettify

Direct port of svn into git from


via Bower

bower install google-code-prettify

or Yeoman

yeoman install google-code-prettify


The prettify script is AMD compatible and can be used modularly. Here is an example of it in an AMD module:

define(['jquery', 'prettify'], function($, prettify){
	var code = null;
	$('pre').addClass('prettyprint').each(function(idx, el){
			code = el.firstChild;
			code.innerHTML = prettify.prettyPrintOne(code.innerHTML);

This version of google-code-prettify defines an anonymous module, which is more flexible. To allow your AMD loader to find google-code-prettify with a more convenient name, map a path to it as follows:

// using RequireJS
	prettify: 'bower_components/google-code-prettify/prettify'

// using curl.js
	prettify: 'bower_components/google-code-prettify/prettify'

Or it may just be used in a global context like the following:


More information can be found in the original README.html