I used prettyPrint to auto-format codes in my blogger. You don't need to download but link to it as follows:
Step 1:
Go to Customize -> Edit HTML, paste the following code inside tag <head> </head>
Step 2:
Change tag <body> to <body onload='prettyPrint()'>
Step 3: How to use:
Put your code inside the following tag:
Note that you can also change and upload your own css file and link to that address to format your code.
Step 1:
Go to Customize -> Edit HTML, paste the following code inside tag <head> </head>
<link href='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css' rel='stylesheet' type='text/css'/>
<script src='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js' type='text/javascript'/>
Step 2:
Change tag <body> to <body onload='prettyPrint()'>
Step 3: How to use:
Put your code inside the following tag:
<pre class="prettyprint">
<!-- your code here --> </pre>
Note that you can also change and upload your own css file and link to that address to format your code.
Comments
Post a Comment