Profile

Click to view full profile
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time. Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more...

Saturday, October 30, 2010

How to add code post in Blogger

First we have to put this under <head> tag in the Edit HTML of Blogger.

<script language="javascript" src="http://google-
code-prettify.googlecode.com/svn/trunk/src/prettify.js" 
type="text/javascript">
</script>
<link href="http://google-code-prettify.googlecode.com/svn/trunk
/src/prettify.css" rel="stylesheet" 
type="text/css">
</link>

Second, search for <body> tag and put
onload="prettyPrint()"
as attribute.

Finally, when you want to add code post you can write.
<pre class="prettyprint">
......... your code .........
</pre>

p.s. js,stylesheet can be downloaded and upload to somewhere ex. google-site and then change the link to your site.

No comments:

Post a Comment