But tonight, I discovered Alex Gorbatchev's SyntaxHighligher which seems to be what I was looking for. I googled a bit more and found this HOWTO: post code (thanks gPowered.net). A few minutes later, the SyntaxHighlighter library was uploaded and my blogger template updated to enable it.
Let's try it now with a classical HelloWorld sample :
So, how does it looks like ?
/**
* The HelloWorld class is an application that
* displays "Hello World!" to the standard output.
*/
public class HelloWorld {
// Display "Hello World!"
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
Oh, by the way, Thomas Walloschke created a neat extension for Apache configuration files. Nice. I might use his "brush" too.
my webspace changed to http://homepage.hamburg.de/bandara/shBrush
ReplyDeleteThe old provider didn't allow a redirect.
Thomas Walloschke
Thanks Thomas, the post has been updated accordingly.
ReplyDeleteThank you for this information. I implemented it on my .NET blog.
ReplyDeletehttp://mctscertification.blogspot.com/
I had a little bit of trouble and found some information that helped here:
http://morten.lyhr.dk/2007/12/how-to-get-syntax-highlighting-in.html
Alex's site also helped:
http://code.google.com/p/syntaxhighlighter/wiki/BloggerMode
HOw do you upload the SyntaxHighlighter library?
ReplyDeleteskrymer,
ReplyDeleteI didn't explain it but the whole thing is only possible if you use your own domain. If you do, you need to set a missing files host in the Advanced Settings of the Publishing tab in the Settings of your blog. It has to be a subdomain in the same domain as the blog. Blogger will then use this host if a file can't be served by the regular domain. This subdomain is where you have to upload the files.
Pascal
See Smart way to publish code without downloading and uploading js and css files
ReplyDeletehere.
Don't forget to say thanks If it helps. :)
Dude, are you saying that I'm not smart ? Just kidding :)
ReplyDeleteThank you anyway, it's in deed more simple if we don't have to upload anything.
But, to be honest, I don't like the idea of using files from the trunk. I'll update my template to use a tagged version and, if it works, I'll repost an updated version of this blog entry.
BTW, SyntaxHighlighter 2.0 is out. Yeah baby !
Following is infact the much simpler method.
ReplyDeletehttp://www.blogpandit.com/2009/05/add-code-snippet-to-blogger-mystery.html
After a very, very long time here is an update of my apache brush...
ReplyDeleteSEE
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConf.js.html
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConfV13.html
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConfV22.html - NEW
The apache config files now will be highlighted (v1.5 at this moment - but migration to v.2x follows asap) at:
* strings
* comments
* directives, tags
* arguments
* numbers
* variables
* handlers
* verbs (HTTP methods, RFC compliant)
* urls (expertimental=RFC non-compliant)
* adresses, ip:port
* email (RFC compliant)
* modules
Todo:
* supporting of paths (recently there is a collision with url/uri regexp - see uri support)
* fixing uri support (tbd: shorter/weaker rfc compliant uri regex; rfc includes paths)
* supporting of mime-types (validity checked, not as a path...)
* migration to SyntaxHighlighter v2.x
Hope it is helpful - thomas walloschke
After a very, very long time here is an update of my apache brush...
ReplyDeleteSEE
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConf.js.html
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConfV13.html
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConfV22.html - NEW
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConfEx.html - NEW
The apache config files now will be highlighted (v1.5 at this moment - but migration to v.2x follows asap) at:
* strings
* comments
* directives, tags
* arguments
* numbers
* variables
* handlers
* verbs (HTTP methods, RFC compliant)
* urls (expertimental=not RFC compliant)
* adresses, ip:port
* email (RFC compliant)
* modules
* media-types (IANA and RFC compliant)
Todo:
* supporting of paths (recently there is a collision with url/uri regexp - see uri support)
* fixing uri support (tbd: shorter/weaker rfc compliant uri regex; rfc includes paths)
* migration to SyntaxHighlighter v2.x
Remark:
* some browser use very lousy js-machines
* best js-performer is Safari at this moment
Hope it is helpful - thomas walloschke
After a very, very long time here is an update of my apache brush...
ReplyDeleteSEE
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConf.js.html
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConfV13.html
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConfV22.html - NEW
http://homepage.hamburg.de/bandara/shBrush/HttpdApacheConfEx.html - NEW
The apache config files now will be highlighted (v1.5 at this moment - but migration to v.2x follows asap) at:
* strings
* comments
* directives, tags
* arguments
* numbers
* variables
* handlers
* verbs (HTTP methods, RFC compliant)
* urls (expertimental=not RFC compliant)
* adresses, ip:port
* email (RFC compliant)
* modules
* media-types (IANA and RFC compliant)
Todo:
* supporting of paths (recently there is a collision with url/uri regexp - see uri support)
* fixing uri support (tbd: shorter/weaker rfc compliant uri regex; rfc includes paths)
* migration to SyntaxHighlighter v2.x
Remark:
* some browser use very lousy js-machines
* best js-performer is Safari at this moment
Hope it is helpful - thomas walloschke
HOw do you upload the SyntaxHighlighter library?
ReplyDeleteI put this to my blog and it work great.
ReplyDeletethanks.
Donaire vs Narvaez | United Gold Direct
Hi tҺere, I enjoy reading all of your ρost. I wanted to write a lіttle commеent to
ReplyDeletesupport ʏou.
My ԝeb-site Spanish subjunctive quizas
Hi! I just wanted to ask if you ever have any trouble with hackers?
ReplyDeleteMy last blog (wordpress) was hacked and I ended up
losing many months of hard work due to no back up. Do you have any solutions to stop
hackers?
- videtesboules
- videtesboules
- videtesboules
- videtesboules
- videtesboules
- videtesboules
my webpage ... videtesboules
One can minecraft pocket edition cheats search unlimited mobile
ReplyDeletegames. To get scores, it gives you an answer. Devil's badvocateThe package's high point is
where mobile games downloading that has been minecraft pocket edition cheats designed for womens to make
the choice pretty wisely. The birds should be played after release for testing,
references are king! Mobile phones are not only source of the
game of real buttons instead, restart your PC.