diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss index b416864c56..1f1a0c77b9 100644 --- a/collects/scribble/html-render.ss +++ b/collects/scribble/html-render.ss @@ -355,13 +355,13 @@ null) (define/public (render-toc-view d ri) + (define has-sub-parts? + (pair? (part-parts d))) (define sub-parts-on-other-page? (and (pair? (part-parts d)) (part-whole-page? (car (part-parts d)) ri))) (define toc-chain - (let loop ([d d] [r (if sub-parts-on-other-page? - (list d) - '())]) + (let loop ([d d] [r (if has-sub-parts? (list d) '())]) (cond [(collected-info-parent (part-collected-info d ri)) => (lambda (p) (loop p (cons p r)))] [(pair? r) r] @@ -389,9 +389,18 @@ (define children (part-parts t)) ; note: might be empty (define id (format "tocview_~a" i)) (define last? (eq? t (last toc-chain))) - (define expand? (and last? - (or (collected-info-parent (part-collected-info d ri)) ;; => last isn't this page - sub-parts-on-other-page?))) ;; => last is this page, and it's useful to list subs + (define expand? (or (and last? + (or (not has-sub-parts?) + sub-parts-on-other-page?)) + (and has-sub-parts? + (not sub-parts-on-other-page?) + ;; next-to-last? + (let loop ([l toc-chain]) + (cond + [(null? l) #f] + [(eq? t (car l)) + (and (pair? (cdr l)) (null? (cddr l)))] + [else (loop (cdr l))]))))) (define top? (eq? t top)) (define header `(table ([cellspacing "0"] [cellpadding "0"]) diff --git a/collects/scribblings/reference/bytes.scrbl b/collects/scribblings/reference/bytes.scrbl index 2c8af4b3a3..7e76676f08 100644 --- a/collects/scribblings/reference/bytes.scrbl +++ b/collects/scribblings/reference/bytes.scrbl @@ -5,8 +5,6 @@ @guideintro["bytestrings"]{byte strings} -@local-table-of-contents[] - A @deftech{byte string} is a fixed-length array of bytes. A @pidefterm{byte} is an exact integer between @scheme[0] and @scheme[255] inclusive. diff --git a/collects/scribblings/reference/chars.scrbl b/collects/scribblings/reference/chars.scrbl index ad24b501f7..af6341ed57 100644 --- a/collects/scribblings/reference/chars.scrbl +++ b/collects/scribblings/reference/chars.scrbl @@ -7,8 +7,6 @@ @guideintro["characters"]{characters} -@local-table-of-contents[] - MzScheme characters range over Unicode scalar values, which includes characters whose values range from @schemevalfont{#x0} to @schemevalfont{#x10FFFF}, but not including @schemevalfont{#xD800} to diff --git a/collects/scribblings/reference/numbers.scrbl b/collects/scribblings/reference/numbers.scrbl index e8ff2b2743..67844e97f5 100644 --- a/collects/scribblings/reference/numbers.scrbl +++ b/collects/scribblings/reference/numbers.scrbl @@ -9,8 +9,6 @@ @guideintro["numbers"]{numbers} -@local-table-of-contents[] - All numbers are @deftech{complex numbers}. Some of them are @deftech{real numbers}, and all of the real numbers that can be represented are also @deftech{rational numbers}, except for diff --git a/collects/scribblings/reference/strings.scrbl b/collects/scribblings/reference/strings.scrbl index 0b83db4a46..8f1175362f 100644 --- a/collects/scribblings/reference/strings.scrbl +++ b/collects/scribblings/reference/strings.scrbl @@ -5,8 +5,6 @@ @guideintro["strings"]{strings} -@local-table-of-contents[] - A @deftech{string} is a fixed-length array of @seclink["characters"]{characters}.