Skip to content

Instantly share code, notes, and snippets.

@plechazunga
Created July 28, 2012 19:03
Show Gist options
  • Save plechazunga/3194436 to your computer and use it in GitHub Desktop.
Save plechazunga/3194436 to your computer and use it in GitHub Desktop.
Highlight Codeblocks w/ Prettify
$(document).ready(function() {
// add prettyprint class to all <pre><code></code></pre> blocks
var prettify = false;
$("pre code").parent().each(function() {
$(this).addClass('prettyprint');
prettify = true;
});
// if code blocks were found, bring in the prettifier ...
if ( prettify ) {
$.getScript("/js/prettify.js", function() { prettyPrint() });
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment