Created
July 28, 2012 19:03
-
-
Save plechazunga/3194436 to your computer and use it in GitHub Desktop.
Highlight Codeblocks w/ Prettify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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