Bill Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

May 2004
Sun Mon Tue Wed Thu Fri Sat
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Apr  Jun

HTMLize CL code with Hyperspec Links

Friday, May 7, 2004

Lispmeister, Play with the Machine, and Notes from my terminal all mentioned the Lisp site bknr in various posts. I had a look at their site and was pretty impressed by some of the things they're doing. So, I decided to check out some of their Lisp code and had a play with their htmlize utility. It's similar to the Emacs htmlize.el utility that converts font-lock colorizing in an Emacs buffer to HTML. I've used htmlize.el in the past to colorize Lisp code snippets that I've posted on this blog. However, the bknr version of htmlize is designed specifically for CL and it has a nice unique feature - it automatically puts in hyperlinks to the CL Hyperspec for all CL symbols. For example, here's a snippet of the htmlize.lisp code after it's been run through itself:

(defun htmlize (input output)
  (let ((*standard-output* output))
    (write-string "<pre class="htmlize">")
    (loop for form = (bknr-read input nil 'eof)
	  until (eq form 'eof)
	  do (to-html form))
    (write-string "</pre>")))

Click on any of the highlighted Lisp symbols in the above code snippet to be taken to the relevant page in the CL Hyperspec - very cool!

emacs Copyright © 2004 by Bill Clementson