Android Century
  • Home
  • Android Zone
    • Android Apps
    • Android Games
    • Apps APk Files
    • Games Apk Files
    • Apps Hack Tricks
  • Reviews
  • Fantasy Zone
    • Entertainment
    • Quotes and Status
    • Life Style
    • Home Made Tips
    • Hair Care
    • Skin Care
    • Fantasy Tips
  • Tricks
    • Free Recharge
    • Free Internet
    • shopping Cashback
    • Recharge Cashback
  • Tech
  • Mobiles
  • Gadgets
  • News
  • How To's
  • Software
Breaking
Loading...

Featured post

How to Take Great Photos With Apple's iPhone X

Recent Posts

Labels

  • Android Apk Files
  • Android Apps
  • Android Games
  • Apps Apk Files
  • Entertainment
  • Fantasy Tips
  • Gadgets
  • Hair Care
  • HomeMade Tips
  • How To's
  • News
  • Quotes
  • Quotes & Status
  • Recharge Cashback
  • Recharge Promo Codes
  • Shopping Cashback
  • Technology
  • skin care
Home / How To's / How to Add Prism Syntax Highlighter in Blogger blog

How to Add Prism Syntax Highlighter in Blogger blog

Latest Govt. Jobs 10:38:00 How To's Edit
Highlighting code is quite necessary for me since I always add some reference to my codes I provide. This highlighter helps me to explain my code to my readers much effectively, since they highlight the keywords in the code.

I have already posted the article were I have discuss different syntax highlighter and the features they provide. In that article I have highlighted to use prettify and why I had considered to using it because of its ability to highlighter any codes and no extra plugin is required. Since it can highlight any piece of code, therefore the size of code increases, which was around 18KB to 22KB for me including the CSS code. Because it indirectly increases the page size which is bad for Search engine optimization.

Since webpage doesn’t load faster therefore our blogs bounce rate increases and this leads to decrease in page views. I have to use different syntax highlighter which could solve my problem. And then I find this syntax highlighter called Prism.

I have seen many renowned blogger using this plugin to highlight their code. Prism syntax is very different from any other syntax highlighter out there because of it features it provide. I need to highlight code which includes HTML, CSS and JavaScript mainly. If I need any other code to highlight I could simply download that plugin and add to the core code that is already present in that particular page.

That means my plugin by default will only highlight HTML CSS and JavaScript codes. If required some other code language to highlight I can simply add that plugin in that particular page. This methods lead decrease in the size code which is for me 8KB to 9KB including CSS code which is quite low compared to prettify.

So if you are using prettify or any other syntax highlighter I would highly recommend you to shift to Prism right now and decrease your page view.

 How to integrate Prism Syntax Highlighter in your website or blogger?


Make sure to take a backup of your template before proceeding.
Case A: Use this only if you’re main language is other language that of HTML, CSS and JavaScript or you host on Wordpress.

Steps:
  1. Go to this download page and select which themes you want.
  2. Now select which language you want highlight and select which feature you want to add example like line number and line highlighter plugin.
  3. Download JavaScript and CSS code. Add CSS code in your CSS file and add Script in your Head.
  4. Add your code snippets as below.
<pre><code class="language-markup">

</code>
</pre>

Change “markup” to “css” or “javascript” if required.

Case B: If you use HTML, CSS or JavaScript as your main language in web articles or using Blogger Blogs
Steps:
  1. Add this JavaScript just before </body> so that it load last and give more bandwidth for content to load.
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
    <script src='https://blogeutectics.googlecode.com/svn/trunk/prism-eutectics.js'/>
    </b:if>
    
  2. Now you can download any CSS style from this download page.
  3. Add your code snippets as shown below.
<pre><code class="language-markup">

</code>
</pre>
Change “markup” to “css” or “javascript” if required.

 More from Author :


If you are using my prism JavaScript code to install prism them I have included some JavaScript in that script which is quite helpful for your readers. What does this JavaScript do is that it selects the complete code whenever the code snippet that has been highlighted is double clicked. This helps them to copy the complete code very easily. And what does this CSS do that it includes that notification over your code snippets to “Double click” the code to copy. For information check the below image.



If you want add this code manually if you not using my prism code then add this CSS code before ]]></b:skin>
pre{overflow: auto;
padding: 10px;
color: #000;
background: #FCFCFC;
font: 12px/1.5 Monaco,"Courier New",Courier,monospace !important;
white-space: pre-wrap;
width: 90%;
margin: 10px auto;
border-left: 3px solid #6CE083;
padding-left: 13px;}
pre {
    position: relative;
}
pre::after {
content: 'Double click';
padding: 2px 5px;
width: auto;
height: auto;
font-family: monospace;
position: absolute;
right: 8px;
top: 8px;
color: #FFFFFF;
background-color: #A5A5A5;
transition: all 0.3s ease-in-out;
}

pre:hover::after {
    opacity: 0;
    top: -8px;
    visibility: visible;
}
And add this below script above </body> 
<script type='text/javascript'>
//<![CDATA[
for(var pres=document.getElementsByTagName("pre"),i=0;i<pres.length;i++)pres[i].addEventListener("dblclick",function(){var a=getSelection(),b=document.createRange();b.selectNodeContents(this);a.removeAllRanges();a.addRange(b)},!1);
//]]>
</script>
I you face any problem do comment and feel free to ask any doubt.
Thanks for reading.
Share on Facebook Share on Twitter Share on Google Plus

RELATED POSTS


How to delete your Google search hi...

How to Get Free Internet on Idea An...

How to Use DroidVPN App For Free In...
How to Add Prism Syntax Highlighter in Blogger blog How to Add Prism Syntax Highlighter in Blogger blog Reviewed by Latest Govt. Jobs on 10:38:00 Rating: 5

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments ( Atom )

Search This Blog

TEST BOOK FOR GOVT ENTRANCE TEST

TEST BOOK FOR GOVT ENTRANCE TEST
Find All Latest book for preparation of SSC,RAILWAYBANK PO,RBI,BANK CLERK,GATE ME,GATE CE are available here in less prices, to check out the books click here

Translate

  • Popular Post
  • Random posts
  • Category

Popular Posts

  • Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Refer & Earn Offer:  Hey Guys! Today I make an article about Teen Patti Referral ...
  • Taotronics TT-BH22 Headphones Review
    We make it a addiction to now not look up pricing of a product sooner than reviewing and if ...
  • Reliance Jio to offer sharp tariff discounts for customers signing up by March-end
    Reliance Industries' Jio unit will charge a tariff for its services from April, but will offer ...
  • Pentagon strongly condemns North Korea missile test
    The Pentagon on Monday strongly condemned North Korea’s latest missile test, adding that the ...
  • Fitbit Zip 2017 review
    Fitbit PROS: Clever, accurate tracking Expandable online service Integration with 3rd ...
  • Bank wallets growing faster than e-wallets
    In the  bank  versus  e-wallets  sweepstakes,  lenders  have now gained lost ground. As of ...

Random Posts

  • Nest adds two-step authentication to make your smart home more secure
    Nest adds two-step authentication to make your smart home more secure
    09.03.2017 - 0 Comments
    Smart home devices can take some of the busywork out of your life, but  security for the so-called…
  • Top Android apps of the April last week -2016
    Top Android apps of the April last week -2016
    04.05.2016 - 0 Comments
    Google’s Play Store is growing at a rapid pace, and the company is trying to make it as user-friendly as…
  • Sony MDR-ZX770BT Review
    Sony MDR-ZX770BT Review
    03.02.2018 - 0 Comments
    It Is a difficult task to stand out in the headphone market nowadays. Having a killer function helps, be it…
  • How to encrypt your Facebook messages with Secret Conversations
    How to encrypt your Facebook messages with Secret Conversations
    12.02.2017 - 0 Comments
    Good news, privacy enthusiasts: Facebook’s one-on-one encrypted messaging feature called Secret…
  • All the Samsung Galaxy S8 specs just leaked... well, almost all
    All the Samsung Galaxy S8 specs just leaked... well, almost all
    24.02.2017 - 0 Comments
    Yesterday a specs list for the Samsung Galaxy S8 Plus leaked , and now the…

Labels

Android Apk Files Android Apps Android Games Apps Apk Files Apps Hack Tricks Entertainment Free Internet Freecharge Gadgets Games Apk Files How To's Laptops Guide Mobiles Reviews Technology Viral's android zone free recharge

Entertainment

Tricks

Popular Posts

  • Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Refer & ...
  • Taotronics TT-BH22 Headphones Review
    We make it a ...
  • Bank wallets growing faster than e-wallets
    In the  bank ...
  • Reliance Jio to offer sharp tariff discounts for customers signing up by March-end
    Reliance Industries' Jio unit will charge a tariff for its services from April, but will offer ...
  • Hands-on with the home windows 10 Creators update for the Xbox One: Beam recreation streaming arrives
    The Windows ...
  • Pentagon strongly condemns North Korea missile test
    The Pentagon on ...
  • Fitbit Zip 2017 review
    Fitbit PROS ...

Random Posts

  • How to Remove an Image’s Background Using Preview on macOS
    How to Remove an Image’s Background Using Preview on macOS
    14.02.2017 - 0 Comments
    If you need to remove an image’s background on your Mac—so that the background is transparent—you…
  • How to Transfer Any Wallet Cashback Amount to Bank
    How to Transfer Any Wallet Cashback Amount to Bank
    17.02.2018 - 0 Comments
    Mobikwik - Update your E-KYC for mobikwik wallet and you will get Rs. 100 Supercash instantly. Valid…
  • Latest LG G6 launched  2017 with Google Assistant: Specs, features and more
    Latest LG G6 launched 2017 with Google Assistant: Specs, features and more
    26.02.2017 - 0 Comments
    LG has launched the G6 smartphone with Google Assistant baked-in. ( Source: AP) LG unveiled its new G6…
  • Sony PS4 (Slim) Review
    Sony PS4 (Slim) Review
    05.02.2017 - 0 Comments
    Sony VERDICT An excellent console with a great catalogue of AAA games, the slimmer, smaller PS4 is…
  • Secure your new Nintendo online user ID now
    Secure your new Nintendo online user ID now
    21.02.2017 - 0 Comments
    The official launch of Nintendo’s latest console is just around the corner ,…

Most Popular

  • Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Refer & ...
  • SAMSUNG GALAXY J7 (2016) REVIEWS
    SAMSUNG GALAXY J7 (2016) REVIEWS
    SAMSUNG GALAXY J ...
  • Top 5 Best SmartPhones under 7000 Rs (March 2017)
    Looking for the ...
  • Apple, IBM, Cisco are huge because of Indians, do not deny them H-1B visa: RBI Governor Urjit Patel
    ...
  • SAMSUNG GALAXY J7 (2016) Specifications
    SAMSUNG GALAXY J ...
  • BlackBerry Teases Marshmallow Beta Testing for Priv by Next Week
    Blackberry ...
  • LG Q6 Review
    LG Q6 Review
    2017 is ...

Contact Form

Name

Email *

Message *

Offers Zone

Created By Android Century Distributed by Android Century
  • Home
  • About us
  • Contact us
  • Privacy policy
  • Terms of use
  • Advertise here
Subscribe Via Email Subscribe To Android Century By Email And Get Free Updates. ;-)


Your email address is safe with us!