3

I have tried this and this , both previous solutions from stack overflow but both of these solutions are not working with Dynamic Views Template of Blogger. Can you please help to get this working.

Community
  • 1
  • 1
MoveFast
  • 3,011
  • 2
  • 27
  • 53
  • http://stackoverflow.com/questions/7110694/can-i-google-code-prettify-only-a-portion-of-the-page-run-a-javascript-functio – jpillora Sep 17 '12 at 11:43
  • just read your question properly, sorry! posting a real answer now... – jpillora Sep 18 '12 at 13:07
  • 1
    try this one http://stackoverflow.com/questions/14540009/prettyprint-doesnt-get-called-on-page-load/14659603#14659603 – Artur A Jan 29 '14 at 20:03

2 Answers2

3

Wrote a blog post on Easy Syntax Highlighting for Blogs

http://blog.jpillora.com/2012/06/easy-syntax-highlighting-for-blogs.html

Currently running on blogger, though I haven't tested it on all browsers though I can't see why it wouldn't work. Let me know how it goes.

jpillora
  • 5,194
  • 2
  • 44
  • 56
  • where should I include following line `` in the post or in the template – MoveFast Sep 18 '12 at 15:56
  • Just added it to my dynamic views template and removed it from my posts and it works fine. Though both the blog and js file are on sub-domains of mine, not sure if that affects what google allows. – jpillora Sep 23 '12 at 15:28
0

Please refer this below stackoverflow answers, to add that Google code pretifier to blogger..

Adding google prettifier synatx highlighter is very easy..

https://stackoverflow.com/a/27579776

also refer this following documentation.

how to add Syntax Highlighter For Blogger Using Google Prettify

add below code just before tag...

<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>

add your code between

<pre class="prettyprint">...</pre> 
Community
  • 1
  • 1
muni
  • 1,362
  • 2
  • 19
  • 21