Syntax highlighter is the best plugin that helps to show the code using in daily life.Showing code is better using syntax highlighter.One of the best plugin of syntax highlighter was developed by alexgorbatchev .He says that
SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript. To get an idea of what SyntaxHighlighter is capable of, have a look at the demo page.
If you want to use the syntax highlighter in a blog then its free.Just you need to integrate it in Blog like this.
Why to choose alexgorbatchev Syntax Highlighter.
- Selected theme
- Good Background
- Easy to Install
- Many Function like able to Print
- Numbering of sentence
- Many Brushes
- Supports many programming language as your choice
Adding Syntax Highlighter in Template.
In Blogger.
- Go to Blogger.com
- Click on design or Template.
- Go to Edit HTMl.
- Find </body> tag from there.
- Adding the following lines just above it.
<!--syntax highlighter --> <!-- http://bloggerrounder.blogspot.com --> <link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/> <script type='text/javascript'> SyntaxHighlighter.config.bloggerMode = true; SyntaxHighlighter.all(); </script> <!-- http://bloggerrounder.blogspot.com --> <!-- syntax highlighter -–>
- Where
- Line 4 is theme of syntax highlighter.(if you don’t like you can change theme for that go to here).Choose the theme which you like the replace shThemeDefault.css with the name of respective theme.
- Line 6,7 and 8 are the brushes.If you want to required only one brush then you can delete others.You may add the brushes.At least there should be one brushed.
- If you got any problem you are free to comments.
If you are using custom domain
- If you use Custom Domain in Blogger host your CSS and JavaScript files on Google Sites. Because . .css and .js files only work on blogspot domain.
To make .js work in custom domain you have to change the extension to .txt.
As for .css files, you have to host it somewhere else.
In Word Press.
- Download the Plugins from here .
- Extract the zip file.
- Upload the folder in /wp-content/plugins/ using ftp like filezille.
- Go to The Admin area and activate the Plugin.
- Just wrap your code in
[brush]
, such as[CSS]code here[/CSS]
or [xhtml] xml,html code here [xhtml] while posting
Showing code using it..
- Escape the code using HTML encoder.
- While posting wrap the code (Switching to HTML Mode) like this
<pre class="brush: js"> Escaped Code Here </pre>
If you use Window Live writer.
If you use window live writer then install this plugin as it escape and make compatible to work with syntax highlighter.
Image Credit : Word press plugin Store
Subscribe for free
Thanks for visiting Blogger Rounder.We can subscribe to Blogger Rounder's by RSS feed or email updates.
4 comments on "Showing Codes Using Syntax Highlighter Plugin.":
it doesnt works in my blog.
oh now i understood . thanks for that green bajgain.
Pleasure
Thanks for comment to everyone
Post a Comment
We Love To Hear Comments from You.Comments are Welcome.You can comment here regarding this Post.If it is not related with the post you can ask a question by Contacting Us.Before Comment Please Subscribe To our RSS or email updates.Publishing Spam Comment is Not allowed.If you want to Add Code then Please Encode it.
Simple Tags like <a> ,<strong>,<b>,<em> and <i> are allowed for preventing spam