[Wolves] Syntax Highlighting of code examples?

Alan Pope alan.pope at gmail.com
Mon May 16 10:22:21 BST 2005


On 16/05/05, Katherine Goodwin <kat at codepoets.co.uk> wrote:
> The next thing I want is to be able to link to my code examples.  In an ideal world I'd
> like to get them launching in a new broswer window, all syntax highlighted and everything.  I can
> see that may well not be easy, so I'd be happy with it just to pop up and keep my
> spacing...  I don't want to have to put anything else in the code to mess it up...
> 

The lure of free beer compells me to attempt to answer this question.

You mean like what www.pastebin.com does? e.g.
http://pastebin.com/285012 and http://pastebin.com/285016 (just to
take two of the most recent posts there.

I guess you'll have to write (or reuse) some code that reads in your
code (you don't mention the language, but it doesn't matter) from a db
or file then inserts the necessary style elements to pick up the
colours (and as you see from pastebin) possibly links to the manual
for specific commands.

The good news is that by googling for words like "pastebin" and "GPL"
I was able to find a few projects. For example the first one I clicked
on was http://developer.berlios.de/projects/rebbin/ which is written
in Ruby on Rails.

Hope that helps.

Cheers,
Al.



More information about the Wolves mailing list