Saturday, February 11, 2012

How to enable syntax highlight for code blocks in blogger

With SyntaxHighlighter, we can easily include a block of code in blogger (blogspot).
  1. First install the javascript code in your blogger.In the Design->Layout->Add a Gadget->HTML/JavaScript, enter the following code
    
     
    
    
    
    
    
    
     
    
    
    
     
    
    
    
    
    In the above example, I've chosen to use the free hosted version. You can also download and host the javascripts yourself, as described in the author's website . In the above example, I included the following brushes: Bash, JavaScript, C++, Python and LaTeX. More supported languages can be found in here.
  2. Next, to write new posts with code blocks. You can use either the <pre> tag or the <script> tag as described here .

6 comments:

Sayan Guharoy said...

Nice example.I have similar example in my blog also..have a look Syntax Highlighter

Ankit Verma said...
This comment has been removed by the author.
Unknown said...

Easton Bell Electrical are your Melbourne based electricians, and it is our priority that
we provide you with a friendly and courteous service while being professional and well presented.
We pride ourselves on being on time and discussing with you what work suits you best. And best of all,

We Clean Up!Hampton Electrician

Unknown said...

This is nice blog to solve each and every router technical problems. Excellent work.. Please visit this link--------- Linksys Router Technical Support .

bitcoin to bank account said...

Transfer, exchange and convert cryptocurrency withdraw bitcoin to bank account in United States of America USA
any bank like Jp morgan chase wells fargo.

Alina Williamson said...

The anti-theft is very easy to be configured on Bullguard antivirus software for that the user should open the anti-theft application on the device after that the user should open the drop-down menu and from the options should choose the quarantine option, for knowing more regarding the configuration the user should get in touch with the experts at +44-800-368-9065 lines are open for the users always.
Bullguard Support Number UK
Bullguard Contact Number UK

Visitors