Created
November 11, 2012 07:39
-
-
Save hexorx/4054088 to your computer and use it in GitHub Desktop.
prettify-blogger.js
This file contains 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
// based on http://blog.jpillora.com/2012/06/easy-syntax-highlighting-for-blogs.html | |
(function() { | |
function jQueryExists() { return typeof jQuery !== 'undefined'; } | |
//get jquery | |
if(jQueryExists()) | |
$(window.prettyPrint); | |
else { | |
var interval = setInterval(function() { | |
if (jQueryExists()) { | |
clearInterval(interval); | |
$(window.prettyPrint); | |
} | |
}, 100); | |
} | |
})(); |
This file contains 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
/* Pretty printing styles. Used with prettify.js. | |
* | |
* This version is slight modified based on the original version. | |
* | |
* Name: Stanley Ng | |
* Email: [email protected] | |
* | |
* Reference: | |
* http://code.google.com/p/google-code-prettify/source/browse/trunk/src/prettify.css | |
*/ | |
.pln { | |
color: #bd3613; } | |
.str { | |
color: #269186; } | |
.kwd { | |
color: #859900; } | |
.com { | |
color: #586175; | |
font-style: italic; } | |
.typ { | |
color: #b58900; } | |
.lit { | |
color: #2aa198; } | |
.pun { | |
color: #839496; } | |
.opn { | |
color: #839496; } | |
.clo { | |
color: #839496; } | |
.tag { | |
color: #268bd2; } | |
.atn { | |
color: #586175; } | |
.atv { | |
color: #2aa198; } | |
.dec { | |
color: #268bd2; } | |
.var { | |
color: #268bd2; } | |
.fun { | |
color: #FF0000; } | |
/* Put a border around prettyprinted code snippets. */ | |
pre.prettyprint { | |
background-color: #042029; | |
padding: 10px; | |
border: 1px solid #E1E1E8; } | |
/* Specify class=linenums on a pre to get line numbering */ | |
ol.linenums { | |
color: #4c666c; | |
margin: 0 0 0 40px; } | |
ol.linenums li { | |
line-height: 18px; | |
padding-left: 12px; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment