[plt-scheme] Ideas for PLaneT

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Thu Jan 19 18:22:41 EST 2006

Jens Axel Søgaard wrote:
>> Noel Welsh wrote:

> My wish is much humbler. I simply want the individual 
> *source files* to be browsable. 

I'll try to whip up some code for this, using Anton's
port of Sitaram's source highlighter.

The first step is to fetch all the PLaneT packages.
The following fetches them, but is there a smarter
way (that avoids compiling them)?

/Jens Axel Søgaard

;;; fetch all PLaneT packages

(require (planet "htmlprag.ss" ("neil" "htmlprag.plt"))
          (lib "url.ss" "net")
          (lib "match.ss"))

; url->sxml : url-string -> sxml
;  fetch the page with the url url, parse it and return the parse tree
(define (url->sxml url)
   (html->sxml (get-pure-port (string->url url))))

(define (sxml->requires sxml)
   (match sxml
     [('tt text)
      (list (read-from-string text))]
     [(item ...)
      (apply append
             (map sxml->requires sxml))]
     [else '()]))

(define (robust-eval sexpr)
   (display sexpr)
       ([(lambda (o) #t) (lambda (o) 'ignore)])
     (eval sexpr)))

(map robust-eval
      (sxml->requires (url->sxml "http://planet.plt-scheme.org/300/")))

Posted on the users mailing list.