Search This Blog

Sunday, September 7, 2014

How to Add Syntax Highlighter to Blogger


How to Add Syntax Highlighter to Blogger :

To make this possible, we are using a code highlighter called Syntax Highlighter which is a commonly used highlighter for websites and blogs. The version that we are using is Syntax Highlighter 3 developed by Alex Gorbatchev and let me start with thanking him for such a great tool that has helped a lot of bloggers, blogger users in particular. So follow the steps depicted below to add Syntax Highlighter scripts.

  • Now to go to blogger.com and log in with your credentials.
  • Select your blog and navigate to Template section.
  • Once you reach the Template section, click on Edit HTML and wait for the editor to open up.
  • Now, click on a blank area in the editor and hit Ctrl+F to open the search box.
  • Then, find the code “</head>” .
  • Paste the below set of codes just above the </head> and click on the Save Template button.






  • We have now added the code to the template but have to make the code display in the Syntax Highlighter and for that we have to wrap your code into the <pre> tag with a special attribute to define what language or script that we are using.
  • For instance, If you are using HTML lines then your code segment should be like this

// Your HTML Code here

No comments:

Post a Comment

Contact Form

Name

Email *

Message *