[plt-scheme] Ideas for PLaneT
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)
(newline)
(with-handlers
([(lambda (o) #t) (lambda (o) 'ignore)])
(eval sexpr)))
(map robust-eval
(sxml->requires (url->sxml "http://planet.plt-scheme.org/300/")))