Sunday, August 10, 2008

Prettify code on blogger

Just a quick post on getting pretty code on blogger using prettify

I first followed the instructions on sunday-lab but when trying to save the template after pasting the css and js into the "Edit HTML" in layout settings of blogger, I kept getting the following:

We were unable to save your template

Please correct the error below, and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.

and before someone posts a comment stating the obvious, closing tags were in place. I then continued my pursuit and found some slightly alternate instructions on HyveUp that did the same so here's what I finally had to do to get this to work:
  1. Copy the prettify.css and paste right above the]]></b:skin>]]> closing tag
  2. Insert


    <script src='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js' type='text/javascript'/>

    right above the closing </head> tag
  3. Save Template

No comments: