improve code organization
svn: r8292
This commit is contained in:
parent
db3e05e4df
commit
eee5f7c0fc
|
@ -8,25 +8,11 @@
|
|||
|
||||
(define cached-xref #f)
|
||||
|
||||
(define (load-collections-xref [report-loading void])
|
||||
(or cached-xref
|
||||
(begin
|
||||
(report-loading)
|
||||
(let* ([dirs (find-relevant-directories '(scribblings))]
|
||||
[infos (map get-info/full dirs)]
|
||||
[dests (filter
|
||||
values
|
||||
(apply append
|
||||
(map (lambda (i dir)
|
||||
(let ([s (i 'scribblings)])
|
||||
(define (get-dests dir)
|
||||
(map (lambda (d)
|
||||
(if (pair? d)
|
||||
(let ([flags (if (pair? (cdr d))
|
||||
(cadr d)
|
||||
null)])
|
||||
(let ([name (if (and (pair? (cdr d))
|
||||
(pair? (cddr d))
|
||||
(caddr d))
|
||||
(let* ([flags (if (pair? (cdr d)) (cadr d) null)]
|
||||
[name (if (and (pair? (cdr d)) (pair? (cddr d)) (caddr d))
|
||||
(cadr d)
|
||||
(let-values ([(base name dir?) (split-path (car d))])
|
||||
(path-replace-suffix name #"")))])
|
||||
|
@ -34,14 +20,21 @@
|
|||
(if (memq 'main-doc flags)
|
||||
(build-path (find-doc-dir) name)
|
||||
(build-path dir "compiled" "doc" name))
|
||||
"out.sxref")))
|
||||
"out.sxref"))
|
||||
#f))
|
||||
s)))
|
||||
infos
|
||||
dirs)))])
|
||||
(set! cached-xref (load-xref (map (lambda (dest)
|
||||
((get-info/full dir) 'scribblings)))
|
||||
|
||||
(define (load-collections-xref [report-loading void])
|
||||
(or cached-xref
|
||||
(begin
|
||||
(report-loading)
|
||||
(let* ([dests (map get-dests (find-relevant-directories '(scribblings)))]
|
||||
[dests (filter values (apply append dests))])
|
||||
(set! cached-xref
|
||||
(load-xref (map (lambda (dest)
|
||||
(lambda ()
|
||||
(with-handlers ([exn:fail? (lambda (exn)
|
||||
(with-handlers ([exn:fail?
|
||||
(lambda (exn)
|
||||
(fprintf (current-error-port)
|
||||
"WARNING: ~a\n"
|
||||
(if (exn? exn)
|
||||
|
|
Loading…
Reference in New Issue
Block a user