1: Add the java script file to the blog template.
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js" type="text/javascript">
The complete java script src file path : http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js
2: Link the css file to the blog template.
<link rel="stylesheet" type="text/css" ref="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css"/>
The complete css src file path : http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css
3: Update the blog template to call the prettyPrint() function when loaded.
In the blog template file add the call to the prettyPrint() function to the body onload tag.
<body onload="prettyPrint();">
4: Use the prettyprint command in your blog post.
<pre class="prettyprint" id="xml">
your code
<pre>
Links
Duffblog 2.0: Google Code Prettify
No comments:
Post a Comment