change HTML toc formatting

svn: r6261

original commit: 127dd66e308a9e504650ed2c6c4a413be20090d9
This commit is contained in:
Matthew Flatt 2007-05-24 09:56:09 +00:00
parent 9567880910
commit bed598457d
2 changed files with 32 additions and 16 deletions

View File

@ -243,13 +243,15 @@
(define/private (render-toc part) (define/private (render-toc part)
(let ([number (collected-info-number (part-collected-info part))]) (let ([number (collected-info-number (part-collected-info part))])
(cons (let ([l (cons
(list (make-flow (list (make-flow
(list (list
(make-paragraph (make-paragraph
(list (list
(make-element 'hspace (list (make-string (* 2 (length number)) #\space))) (make-element 'hspace (list (make-string (* 2 (length number)) #\space)))
(make-link-element "toclink" (make-link-element (if (= 1 (length number))
"toptoclink"
"toclink")
(append (append
(format-number number (format-number number
(list (list
@ -258,7 +260,14 @@
`(part ,(part-tag part)))))))) `(part ,(part-tag part))))))))
(apply (apply
append append
(map (lambda (p) (render-toc p)) (part-parts part)))))) (map (lambda (p) (render-toc p)) (part-parts part))))])
(if (and (= 1 (length number))
(or (not (car number))
((car number) . > . 1)))
(cons (list (make-flow (list (make-paragraph (list
(make-element 'hspace (list " ")))))))
l)
l))))
;; ---------------------------------------- ;; ----------------------------------------

View File

@ -18,6 +18,13 @@
.toclink { .toclink {
text-decoration: none; text-decoration: none;
color: blue; color: blue;
font-size: 85%;
}
.toptoclink {
text-decoration: none;
color: blue;
font-weight: bold;
} }
.title { .title {