Skip to main content

Syntax Highlighter for Blogger

Update: Here is the simple two steps which will add "Syntax Highlighter" widget for blogger hosted blogs

1. Go to : http://fazibear.googlepages.com/blogger.html
2. And click to :
---------------------------------------------------------------------------------------
Today, one of my JR mate asked me about How did I add that syntax highlighter code in blogger ? OK, I knew I installed it from some blog, but not remembering the name of that site, so I googled it and all the hits shows me the way to install it using CSS defined and uploaded at googlepages site.
Here is the code project site for same from Google:
http://code.google.com/p/syntaxhighlighter/

I tried this too, but with little success. Its not that easy.

But, finally I found that blog and thus that post where author created the Blogger widget for syntax highlighter. Just add it and you can add code snippet in you blog.

Here is that useful link:
http://fazibear.blogspot.com/2007/09/blogger-syntax-higlighter.html

Comments

Arfeen said…
Hi Sagar,

Nice link u have given. Thanks.

Well i tried to use it with my blog but didn't get look like your code have. Can you please tell me the prcedure.
you can send me the code snippet at arfeen.you@gmail.comThanks.
techmythoughts said…
Hi Arfeen,
Go to this page:
http://fazibear.googlepages.com/blogger.html
And there you will find "Add to Blogger" button, clicking the same will redirect you to 'blogger.com' asking for your blogger blog. Once you follow the steps there, you can see the "Syntax Highliter" widget was added to your blog.
Arfeen said…
Hi sagar,

Thanks for the reply.
What did u say, i already did.
But the problem is this whenever i am going to post any java code it should look like yours one.

I went through this link--
http://code.google.com/p/syntaxhighlighter/wiki/Usage
but unable to do that.

what i am doing is --
1. under "pre name="code" class="java"
... my java code ...
/pre"
(removed angle breaket becasuse of problem when posting)
2. using css definition given at above link under "Making it work
".

Please tell me what am i missing?
techmythoughts said…
Hi Arfeen,
OK, the link you had given has a classic approach of 'Syntax Highlighter' using JS and CSS hosted at googlepages.com. But what the original author did was, he created "Blogger Widget", which can be incorporated into your blog, just by adding it. The link is here:
http://fazibear.googlepages.com/blogger.html

This is the repetition of my previous reply !!
Thanks Sagar! It works!! How can I add support for other languages e.g. Haskell
techmythoughts said…
@TheMachineCharmer,
Either you have to request the original author of this widget for which I given out the link in the blog OR check this page from the original maker.

Sorry, I can't help you much :)

Popular posts from this blog

Installing i3lock-color on Ubuntu

i3lock is fancy lock screen for Linux. There is i3lock dep available on Ubuntu but its not what I was looking for; I was more interested in i3lock-color . Lets see how we can install the same on ubuntu. PS: I'm using Ubuntu 16.04 Get source code for i3lock-color $ git clone https://github.com/PandorasFox/i3lock-color.git  $ cd i3lock-color Install required packages to build i3lock  $ apt install libev-dev $ apt install libxcb-composite0 libxcb-composite0-dev libxcb-xinerama0 libxcb-randr0  $ apt install libxcb-xinerama0-dev  $ apt install libxcb-xkb-dev  $ apt install libxcb-image0-dev  $ apt install libxcb-util-dev $ apt install libxkbcommon-x11-dev $ apt install libjpeg-turbo8-dev  $ apt install libpam0g-dev Build  $ autoreconf -i && ./configure && make Execute $ ./lock.sh Assign Shortcut In order to assign shortcut, install compizconfig $ sudo apt-get install compizconfig-settings-manager compiz-plugins-extra and then go

GlassFish V3 admin console taking too much time to load.

If you have installed Glassfish V3 and trying to load admin console, but after signing in, is it taking too much time to get to the main page ? Do you have server.log entry like this: admin console: initSessionAttributes() Cannot refresh Catalog : Connection timed out then its time to tweak some files. Here its how: 1. Update the %GLASSFISH_HOME/glassfish/domains/domain1/domain.xml -Dcom.sun.enterprise.tools.admingui.NO_NETWORK=true This will block up the News item, the registration item, etc 2. Remove update tool jar (Backup and remove this JAR) %GLASSFISH_HOME/glassfish/modules/console-updatecenter-plugin.jar Delete this dir: %GLASSFISH_HOME/glassfish/domains/domain1/osgi-cache %GLASSFISH_HOME/glassfish/domains/domain1/generated Now start the server (bin/asadmin start-domain) and you will see the admin console won't be hang up and take you directly to main page.

Java Generics: Why I get "name clash" exception when I override methods with different "type" parameter ?

import java.util.*; class Parent { void foo(List<String> list) { System.out.println("parent"); } } class Child extends Parent { void foo(List<Integer> list) { System.out.println("child"); } } When you compile this code you will get an error like Parent.java:7: name clash: foo(java.util.List<java.lang.Integer>) in Child and foo(java.util.List<java.lang.String>) in Parent have the same erasure, yet neither overrides the other class Child extends Parent { ^ 1 error This "name clash" error thrown because of "type erasure" thing when "generics" code gets complied. Let’s see how, When we complied any generics code, the compiler removes the type from the code and treat it as a simple pre Java 1.5 code, like, in our case, compiler saw something like this, import java.util.*; class Parent { void foo(List list) { // oops, <String> get erased. System.out.println("parent"); } } class Child extend