From bfd881ce7fd319fe2ca41c130661f07ae9a86aa1 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 19 Aug 2007 02:43:51 +0000 Subject: [PATCH] in GUI docs, show inherited methods svn: r7119 original commit: 44d1c03d685aefced364362cc0fe28ca6cf34148 --- collects/scribble/base-render.ss | 7 ++++- collects/scribble/html-render.ss | 6 +++- collects/scribble/manual.ss | 51 +++++++++++++++++++++++++++++++- collects/scribble/scribble.css | 17 +++++++++++ collects/scribble/struct.ss | 1 + 5 files changed, 79 insertions(+), 3 deletions(-) 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 . flow-element?)])] [itemization ([flows (listof flow?)])] [blockquote ([style any/c]