Syntax highlighter is a best tool to show your HTML,CSS,JavaScript and other codes in multi colors.There are many great features which makes it more popular such as you can implement and use it very easily,9 beautiful themes,you can highlight the lines which you want and many other features.I am also using this tool on this look you wiil watch it in some of my posts :) Now lets see how to implement it in your blogger blog.
How To Add Syntax Highlighter To Blogger Blog?
Below I am providing a scripts generator which created by Nitin and modified by me,with using the scripts generator you can easily select the theme and brushes which you need.Just follow below instructions carefully,
- Select the theme of your highlighter,you can see demo of theme here.
- Then select the brushes which you want
- Click on the Get Code button
- Copy all the code from the text area
- Now go to your template
- Find for </head> tag in your template
- Add copied code just above it,
Now you have successfully implemented the syntax highlighter into your blogger blog,now lets see how to use it,
How To Use Syntax Highlighter Into Blogger Posts?
While creating a post go to Edit HTML section
Use below code yo use syntax highlighter
<pre class='brush:[brushname];'> ADD THE PARSED CODE HERE </pre>
- replace
[brushname]
with brushname which you want to use to highlight the code, - replace
ADD THE PARSED CODE HERE
with the encoded code,to encode the codes you can use our HTML Code Encoder tool
for an example,if you want to use or highlight CSS code then use the code below,
<pre class="brush:css;"> ADD YOUR CSS CODE HERE </pre>
if you want to use or highlight HTML code then use the code below,
<pre class="brush:html;"> ADD YOUR CSS CODE HERE </pre>
use same above trick to highlight any type of code
That's all about adding syntax highlighter into blogger blog,I hope you have liked this tutorial also if you are getting any single problem then feel free to share it via comments,I'll glad to help you :)
pEaCe aNd bLeSsInGs BuDdIeS :)
i like it but. i want your syntax highlighter color. Yours coding section is different with white and grey color and i need to change the line colors too. you can see my demo: http://lasssssssgdg.blogspot.in/2012/06/thats-all-about-adding-syntax.html
ReplyDeleteOk then fine below code in your template
Delete<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeRDark.css' rel='stylesheet' type='text/css'/>
replace it with below code
<link href='http://code.helperblogger.com/syntaxhighlighter/shCore.css' rel='stylesheet' type='text/css'/>
Note - If you have added different theme then above code may be different from your code then best way to find your theme URL is to find shTheme[THEME NAME HERE]
This is nice...
ReplyDeleteWhat is the use of selecting brushes?
JayRyan'sBlog was inviting you to be a Guest Post Author..
Thank you so much.
-jayryan09-
thanks rahul, you just made such a useful widget for bloggers
ReplyDeleteRegards
Blogs Daddy
rahul yr great post .............
ReplyDeleteaccording to my experience your blog contain almost all blogger articles . very usefull
An attention-grabbing dialogue is price comment. I believe that it truly is very best to write a lot far more on this matter, it may possibly not be a taboo subject but usually folks are not sufficient to speak on such topics. To the next.
ReplyDeleteCheers
The Beautiful Names 99
thanks alot x100 this post helped our blog
ReplyDeletereally nice article,,broder.....
ReplyDeleteBLOGGER HEROE,Tips and Tricks For Blogger,widgets,Templates
De mucha ayuda, ¡gracias!
ReplyDeleteCyberpsychology, Behavior, and social networking is the essential, peer-reviewed journal for understanding the social and psychological impact of today’s social networking practices
ReplyDeleteThanks. This would be an effective widget for my blog. These highlighters could be an additional feature.
ReplyDeleteawesome...
ReplyDeleteThank you rahul, you made this so easy.
ReplyDeletewhat language support in this syntax highlither??? please send the answer to mail lukkhakim@gmail.com . thanks before ;)
ReplyDelete