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

Lifecyle hooks in Angular

Each Angular component goes through a lifecycle. This is managed by the Angular itself. Angular creates a component, renders it, creates and renders its children, looks for the changes in its data-bound properties and destroys it. Angular has lifecycle hooks for each such key moment and provide a way to act accordingly when such moment happens. Directive and component have a lifecycle. For each lifecycle moment, Angular provides a lifecycle hook . The developer can hook into such moment by implementing the one or more specific lifecycle interfaces from the Angular core. Angular provide following lifecycle hooks as under: ngOnChanges ngOnInit ngDoCheck ngAfterContentInit ngAfterContentChecked ngAfterContentInit ngAfterContentChecked ngOnDestroy   Sequence of execution of the lifecycle hooks During the creation of component: Constructor ngOnChanges ngOnInit ngDoCheck ngAfterContentInit ngAfterContentChecked ngAfterContentInit ngAfterContentChecked During chang...