diff --git a/collects/scribble/base-render.ss b/collects/scribble/base-render.ss index 40ec68a6..397c8549 100644 --- a/collects/scribble/base-render.ss +++ b/collects/scribble/base-render.ss @@ -203,7 +203,9 @@ (define/public (render-flow-element p part ht) (cond - [(table? p) (render-table p part ht)] + [(table? p) (if (auxiliary-table? p) + (render-auxiliary-table p part ht) + (render-table p part ht))] [(itemization? p) (render-itemization p part ht)] [(blockquote? p) (render-blockquote p part ht)] [(delayed-flow-element? p) (render-flow-element @@ -211,6 +213,9 @@ part ht)] [else (render-paragraph p part ht)])) + (define/public (render-auxiliary-table i part ht) + null) + (define/public (render-table i part ht) (map (lambda (d) (if (flow? i) (render-flow d part ht) diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss index e0957f5c..1e04b7b4 100644 --- a/collects/scribble/html-render.ss +++ b/collects/scribble/html-render.ss @@ -212,7 +212,11 @@ ,@(if (part? p) (render-content (part-title-content p) d ht) (render-content (element-content p) d ht))))))) - ps))))))))))) + ps))))))) + ,@(apply append + (map (lambda (t) + (render-table t d ht)) + (filter auxiliary-table? (flow-paragraphs (part-flow d))))))))) (define/public (render-one-part d ht fn number) (parameterize ([current-output-file fn]) diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss index c54a71e2..2833ca2b 100644 --- a/collects/scribble/manual.ss +++ b/collects/scribble/manual.ss @@ -1265,6 +1265,49 @@ [(_ object%) #'#f] [(_ id) (class-id->class-doc-info-id #'id)])) + (define (collect-inherited supers ht) + (let* ([supers (let loop ([supers supers][accum null]) + (cond + [(null? supers) (reverse accum)] + [(memq (car supers) accum) + (loop (cdr supers) accum)] + [else + (let ([super (car supers)]) + (loop (append (reverse (decl-intfs super)) + (if (decl-super super) + (list (decl-super super)) + null) + (cdr supers)) + (cons super accum)))]))] + [inh (apply + append + (map (lambda (super) + (let ([inh (filter + values + (hash-table-map + (decl-methods super) + (lambda (k v) + (let ([v (hash-table-get ht k)]) + (and (eq? (car v) (decl-name super)) + (cons (symbol->string k) + (*method k (car v))))))))]) + (if (null? inh) + null + (cons + (make-element #f (list (make-element "inheritedlbl" '("from ")) + (to-element (decl-name super)))) + (map cdr (sort inh + (lambda (a b) + (string<? (car a) (car b))))))))) + supers))]) + (if (null? inh) + null + (list (make-auxiliary-table + "inherited" + (map (lambda (i) + (list (make-flow (list (make-paragraph (list i)))))) + (cons (make-element "inheritedlbl" '("Inherited methods:")) inh))))))) + (define (register-class name super intfs mk-head body) (let ([ht (make-hash-table)]) (when super @@ -1280,7 +1323,13 @@ (when (meth? i) (hash-table-put! ht (meth-name i) (cons name i)))) body) - (make-decl name super intfs mk-head body ht))) + (make-decl name super intfs mk-head + (append body + (collect-inherited (append + (if super (list super) null) + intfs) + ht)) + ht))) (define (*include-class decl) (make-splice diff --git a/collects/scribble/scribble.css b/collects/scribble/scribble.css index 1158437b..9e941fe4 100644 --- a/collects/scribble/scribble.css +++ b/collects/scribble/scribble.css @@ -118,6 +118,23 @@ font-weight: bold; } + .inherited { + margin-top: 1em; + text-align: left; + background-color: #ECF5F5; + } + + .inherited td { + padding-left: 1em; + text-indent: -0.8em; + padding-right: 0.2em; + } + + .inheritedlbl { + font-style: italic; + font-size: 85%; + } + .indexlink { text-decoration: none; } diff --git a/collects/scribble/struct.ss b/collects/scribble/struct.ss index 10adbd82..5c07eeca 100644 --- a/collects/scribble/struct.ss +++ b/collects/scribble/struct.ss @@ -65,6 +65,7 @@ [(styled-paragraph paragraph) ([style any/c])] [table ([style any/c] [flowss (listof (listof (or/c flow? (one-of/c 'cont))))])] + [(auxiliary-table table) ()] [delayed-flow-element ([render (any/c part? any/c . -> . flow-element?)])] [itemization ([flows (listof flow?)])] [blockquote ([style any/c]