diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss index 5a291f85..a1021b88 100644 --- a/collects/scribble/html-render.ss +++ b/collects/scribble/html-render.ss @@ -376,22 +376,26 @@ (cdr l))))] [else (cons (car l) (loop (cdr l)))]))))) `((div ([class "tocset"]) - ,@(let* ([content (render-content - (or (part-title-content top) '("???")) - d ri)] - [content (if (null? toc-content) - content - `((a ([href "index.html"] [class "tocviewlink"]) - ,@content)))]) - `((div ([class "tocview"]) - (div ([class "tocviewtitle"]) ,@content) - (div nbsp) - ,@(if (null? toc-content) - '() - (toc-wrap - `(table ([class "tocviewlist"] [cellspacing "0"]) - ,@toc-content)))))) - ,@(render-onthispage-contents d ri top) + ,@(if (part-style? d 'no-toc) + null + (let* ([content (render-content + (or (part-title-content top) '("???")) + d ri)] + [content (if (null? toc-content) + content + `((a ([href "index.html"] [class "tocviewlink"]) + ,@content)))]) + `((div ([class "tocview"]) + (div ([class "tocviewtitle"]) ,@content) + (div nbsp) + ,@(if (null? toc-content) + '() + (toc-wrap + `(table ([class "tocviewlist"] [cellspacing "0"]) + ,@toc-content))))))) + ,@(render-onthispage-contents d ri top (if (part-style? d 'no-toc) + "tocview" + "tocsub")) ,@(parameterize ([extra-breaking? #t]) (append-map (lambda (t) (let loop ([t t]) @@ -412,7 +416,7 @@ (define/public (nearly-top? d ri top) #f) - (define/private (render-onthispage-contents d ri top) + (define/private (render-onthispage-contents d ri top box-class) (if (ormap (lambda (p) (part-whole-page? p ri)) (part-parts d)) null @@ -474,7 +478,7 @@ [any-parts? (ormap part? ps)]) (if (null? ps) null - `((div ([class "tocsub"]) + `((div ([class ,box-class]) ,@(get-onthispage-label) (table ([class "tocsublist"] [cellspacing "0"]) diff --git a/collects/scribble/scribble.css b/collects/scribble/scribble.css index a43c55f5..7aa9fec2 100644 --- a/collects/scribble/scribble.css +++ b/collects/scribble/scribble.css @@ -209,7 +209,7 @@ font-weight: bold; .inherited { width: 100%; - margin-top: 1em; + margin-top: 0.5em; text-align: left; background-color: #ECF5F5; } diff --git a/collects/scribblings/scribble/struct.scrbl b/collects/scribblings/scribble/struct.scrbl index c5017737..78adb0ac 100644 --- a/collects/scribblings/scribble/struct.scrbl +++ b/collects/scribblings/scribble/struct.scrbl @@ -257,6 +257,14 @@ are as follows: @item{@scheme['hidden] --- the part title is not shown in rendered output.} + @item{@scheme['no-toc] --- as a style for the main part of a + document, causes the HTML output to not include a margin box + for the main table of contents; the ``on this page'' box that + contains @scheme[toc-element] and @scheme[toc-target-element] + links (and that only includes an ``on this page'' label for + multi-page documents) takes on the location and color of the + main table of contents, instead.} + } The @scheme[to-collect] field contains @techlink{content} that is @@ -400,6 +408,15 @@ label to be shown in the ``on this page'' table for HTML output. } +@defstruct[(toc-element element) ([toc-content list?])]{ + +Similar to @scheme[toc-target-element], but with specific content for +the ``on this page'' table specified in the @scheme[toc-content] +field. + +} + + @defstruct[(link-element element) ([tag tag?])]{ Hyperlinks the content to @scheme[tag].