Skip to main content

Code Syntax Highlighting on Blogger using Prismjs

Prismjs is developed by Lea Verou. It is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s used in thousands of websites, including some of those you visit daily.Today, we will see how to use the prismjs on blogger to highlight our codes. It very easy and step by step process to follow:


  1. Goto to this link and get the personalized links for prismjs or simply copy the links given below:

    <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/themes/prism-coy.min.css" rel="stylesheet"></link>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.0/prism.min.js"></script>
    
  2. Goto Theme > Edit HTML and paste the links before the closing </head> section as shown below:
  3. Default prism.min.js file contain the functionality to highlight the code for only HTML, CSS and JS code. If you wish to use other language to highlight, you have to paste the link for that language support. Link for other language are also available at this link. For example if you wish to highlight the code for C language, you have tho paste the link before the closing head section and after default prism.min.js link. See the image below:

Comments

  1. Thanks for all those examples, very appreciated! I think it would be very greate if we could have an example with the html5Mode(true) for the pushState feature and FoodMe would be a good app for that.
    angularjs training in chennai
    devops training in chennai

    ReplyDelete
  2. I have gone through your blog, It was very much useful for me and because of your blog, Also I gained many unknown information, kindly post more like this , Thank You.
    Angularjs Training in Chennai
    Angularjs Training

    ReplyDelete
  3. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area. We are providing AngularJS training in Velachery.

    For more details: AngularJs training in velachery

    ReplyDelete
  4. Marvelous and fascinating article. Incredible things you've generally imparted to us. Much obliged. Simply keep making this kind out of the post.

    angularjs training in chennai

    ReplyDelete
  5. Really very nice blog information for this one and more technical skills are improve,i like that kind of post.

    Education
    Technology

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Great blog.thanks for sharing such a useful information
    Salesforce CRM Training in Chennai

    ReplyDelete
  9. Great blog. Thanks for sharing such a useful information. Share more.
    Pytest Online Course
    Pytest Online Training

    ReplyDelete
  10. This post is so helpfull and informative.keep updating with more information...
    Angular JS Framework
    AngularJS Concepts

    ReplyDelete

Post a Comment

Popular posts from this blog

Automatic Slashing the Date Input using Angularjs

We define a directive that will automatically slash the input field as user typein the date. The directive have following capabiltiy: The directive will append slash '/' when input field has 2 or 5 characters. The input will accept only 10 characters (dd/mm/yyyy). Validity of date provide will not be checked. When the backspace is pressed it will remove the last two character if last character is slash. Otherwise it will remove last character from the input field. The input will not accept characters other than numbers (0 to 9). Let's jump into the code. We will use bootstrap for awesome look: HTML Code: <div class="container" ng-app="myApp" ng-controller="myAppCtrl"> <div class="row"> <div class="col-sm-8 col-sm-offset-2"> <form class="form-horizontal"> <h4 class="bg-primary">Auto Slashing Date using Angularjs Directive</h4> <div class=...

$parsers and $formatters in Angularjs

$parsers and $formatters are array of function defined on ngModelController . When there is change in values (view or model), the value is passed through the $parsers or $formatters pipeline to convert it according to the needs. $parsers (View to Model): $parsers is an array of function which executes when there is change in view  value ( $veiwValue ), usually via user input. $parsers cause the conversion of view value into the form desirable to assign in model value. The value is passed through each $parsers function and the return value of one function is passed to next function. Last return value is passed to $validators and after validation the value is assigned to model. These $parsers functions are called array order (i.e. index 0 to n). $parsers are not called when there is change in model value programmatically. $parsers function must return some value. If it not, causes parse error and model value is set to undefined . Let's see the simple ...