- Login to blogger, "Template" -> "Edit HTML" -> "Proceed"
- Copy the following code, and paste them right before </head> in the template html:
<link href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" language="javascript" src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script> <script type="text/javascript" language="javascript" src="http://google-code-prettify.googlecode.com/svn/trunk/src/lang-css.js"></script>
- Replace <body> with <body onload="prettyPrint()">
- Now you can format your code use prettify, for example:
<code class="prettyprint lang-js"> <!-- your code here--> </code>
or
<pre class="prettyprint lang-js"> <!-- your code here--> </pre>
Search This Blog
Use google code prettify in blogger
Subscribe to:
Post Comments (Atom)
Thanks,
ReplyDeletefast and easy