svn: r7125
This commit is contained in:
Eli Barzilay 2007-08-20 03:08:07 +00:00
parent 2e636a54f1
commit 1135ca5140

View File

@ -356,25 +356,27 @@
(build-path "index.htm")] (build-path "index.htm")]
[(file-exists? (build-path doc-dir "index.html")) [(file-exists? (build-path doc-dir "index.html"))
(build-path "index.html")] (build-path "index.html")]
[(tex2page-detected doc-dir) [(tex2page-detected doc-dir) => values]
=>
(lambda (x) x)]
[else #f])) [else #f]))
;; tex2page-detected : string -> (union #f string) ;; tex2page-detected : string -> (union #f string)
(define (tex2page-detected dir) (define (tex2page-detected dir)
(let loop ([contents (directory-list dir)]) (and (directory-exists? dir)
(cond (let loop ([contents (directory-list dir)])
[(null? contents) #f] (cond
[else (let* ([file (car contents)] [(null? contents) #f]
[m (regexp-match #rx#"(.*)-Z-H-1.html" (path->bytes file))]) [else (let* ([file (car contents)]
(or (and m [m (regexp-match #rx#"(.*)-Z-H-1.html"
(file-exists? (build-path dir file)) (path->bytes file))])
(let ([index-file (bytes->path (bytes-append (cadr m) #".html"))]) (or (and m
(if (file-exists? (build-path dir index-file)) (file-exists? (build-path dir file))
index-file (let ([index-file
#f))) (bytes->path
(loop (cdr contents))))]))) (bytes-append (cadr m) #".html"))])
(if (file-exists? (build-path dir index-file))
index-file
#f)))
(loop (cdr contents))))]))))
(provide main-manual-page) (provide main-manual-page)