racket/collects/help/servlets/private/read-doc.ss
Jens Axel Soegaard 6d8b8a3390 Merged online HelpDesk into /collects/help
Most non-manual help desk pages are now in /help/servlets/home.ss
Servlets are now x-expr based instead of string based.
See instructions in /help/launch.ss if you want to try the online version.

svn: r7160
2007-08-25 19:08:33 +00:00

29 lines
915 B
Scheme

(module read-doc mzscheme
(require (lib "etc.ss")
(lib "getinfo.ss" "setup")
"util.ss"
"read-lines.ss"
"html.ss")
(provide read-doc)
;; extracts help desk message
(define (get-message coll)
(with-handlers ([void (lambda _ #f)]) ; collection may not exist
((get-info (list coll)) 'help-desk-message (lambda () #f))))
(define offset-format "file=~a&caption=~a&offset=~a#temp")
(define (build-page file caption coll offset)
(let ([msg (get-message coll)])
(html-page
#:title "PLT Help Desk"
#:bodies (if msg
`(,(format-collection-message msg)
(hr)
,(read-lines file caption offset))
`(,(read-lines file caption offset))))))
(define read-doc
(opt-lambda (file caption coll [offset #f])
(build-page file caption coll offset))))