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. Hi admin,
    This is what I have looked for. Your blog gives lots of information to me.
    ReactJS Training center in Chennai | Learn React

    ReplyDelete
  3. 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
  4. 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
  5. 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
  6. Really very nice blog information for this one and more technical skills are improve,i like that kind of post.

    Education
    Technology

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

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

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

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

    ReplyDelete
  11. 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=...

Conversion between Date String and Timestamp using Angularjs Directive

Let me ask you one question. Can a veiwValue and modelValue have same value into a different format? The answer is YES . Here we will see how it can be possible. We will see it through a simple example that converts date string (viewValue) into timestamp (modelValue). We will use a text box to enter a date string (dd/mm/yyyy) and convert it into timestamp that will be stored into model value. The trick is that we will use $parsers to convert the date string into the timestamp and $formatters to change the timestamp stored in modelValue to date string that will be shown on text input. Let's see the codes first: HTML Code: <h4>Date to Timestamp</h4> <div class="form-group"> <label for="date1" class="col-sm-3 control-label">Date1 VeiwValue:</label> <div class="col-sm-3"> <input type="text" id="date1" class="form-control" name="date1" ng-model="ob...