tweak appearance of main doc page

svn: r9951

original commit: a41f8e8e382c2a81f5e0d407327cbaec065e5dae
This commit is contained in:
Matthew Flatt 2008-05-25 15:16:03 +00:00
parent fa38d02dae
commit 8ec48bb3bb
3 changed files with 40 additions and 19 deletions

View File

@ -376,7 +376,9 @@
(cdr l))))] (cdr l))))]
[else (cons (car l) (loop (cdr l)))]))))) [else (cons (car l) (loop (cdr l)))])))))
`((div ([class "tocset"]) `((div ([class "tocset"])
,@(let* ([content (render-content ,@(if (part-style? d 'no-toc)
null
(let* ([content (render-content
(or (part-title-content top) '("???")) (or (part-title-content top) '("???"))
d ri)] d ri)]
[content (if (null? toc-content) [content (if (null? toc-content)
@ -390,8 +392,10 @@
'() '()
(toc-wrap (toc-wrap
`(table ([class "tocviewlist"] [cellspacing "0"]) `(table ([class "tocviewlist"] [cellspacing "0"])
,@toc-content)))))) ,@toc-content)))))))
,@(render-onthispage-contents d ri top) ,@(render-onthispage-contents d ri top (if (part-style? d 'no-toc)
"tocview"
"tocsub"))
,@(parameterize ([extra-breaking? #t]) ,@(parameterize ([extra-breaking? #t])
(append-map (lambda (t) (append-map (lambda (t)
(let loop ([t t]) (let loop ([t t])
@ -412,7 +416,7 @@
(define/public (nearly-top? d ri top) (define/public (nearly-top? d ri top)
#f) #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)) (if (ormap (lambda (p) (part-whole-page? p ri))
(part-parts d)) (part-parts d))
null null
@ -474,7 +478,7 @@
[any-parts? (ormap part? ps)]) [any-parts? (ormap part? ps)])
(if (null? ps) (if (null? ps)
null null
`((div ([class "tocsub"]) `((div ([class ,box-class])
,@(get-onthispage-label) ,@(get-onthispage-label)
(table ([class "tocsublist"] (table ([class "tocsublist"]
[cellspacing "0"]) [cellspacing "0"])

View File

@ -209,7 +209,7 @@ font-weight: bold;
.inherited { .inherited {
width: 100%; width: 100%;
margin-top: 1em; margin-top: 0.5em;
text-align: left; text-align: left;
background-color: #ECF5F5; background-color: #ECF5F5;
} }

View File

@ -257,6 +257,14 @@ are as follows:
@item{@scheme['hidden] --- the part title is not shown in rendered output.} @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 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?])]{ @defstruct[(link-element element) ([tag tag?])]{
Hyperlinks the content to @scheme[tag]. Hyperlinks the content to @scheme[tag].