commit bed598457d6096761b2baad483e5559513afb8de parent 9567880910110bba8c7ba1a932f7f3e423ad2e83 Author: Matthew Flatt <mflatt@racket-lang.org> Date: Thu, 24 May 2007 09:56:09 +0000 change HTML toc formatting svn: r6261 original commit: 127dd66e308a9e504650ed2c6c4a413be20090d9 Diffstat:
| M | collects/scribble/base-render.ss | | | 41 | +++++++++++++++++++++++++---------------- |
| M | collects/scribble/scribble.css | | | 7 | +++++++ |
2 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/collects/scribble/base-render.ss b/collects/scribble/base-render.ss @@ -243,22 +243,31 @@ (define/private (render-toc part) (let ([number (collected-info-number (part-collected-info part))]) - (cons - (list (make-flow - (list - (make-paragraph - (list - (make-element 'hspace (list (make-string (* 2 (length number)) #\space))) - (make-link-element "toclink" - (append - (format-number number - (list - (make-element 'hspace '(" ")))) - (part-title-content part)) - `(part ,(part-tag part)))))))) - (apply - append - (map (lambda (p) (render-toc p)) (part-parts part)))))) + (let ([l (cons + (list (make-flow + (list + (make-paragraph + (list + (make-element 'hspace (list (make-string (* 2 (length number)) #\space))) + (make-link-element (if (= 1 (length number)) + "toptoclink" + "toclink") + (append + (format-number number + (list + (make-element 'hspace '(" ")))) + (part-title-content part)) + `(part ,(part-tag part)))))))) + (apply + append + (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)))) ;; ---------------------------------------- diff --git a/collects/scribble/scribble.css b/collects/scribble/scribble.css @@ -18,6 +18,13 @@ .toclink { text-decoration: none; color: blue; + font-size: 85%; + } + + .toptoclink { + text-decoration: none; + color: blue; + font-weight: bold; } .title {