improve layout of proc defns by using tables less

svn: r6624

original commit: 6b5c0ed0d90ef355755d280b8740bdfffe20ea7c
This commit is contained in:
Matthew Flatt 2007-06-13 03:35:47 +00:00
parent 7c05bbb8ea
commit 8d484595ef
3 changed files with 73 additions and 62 deletions

View File

@ -294,7 +294,13 @@
(syntax-rules () (syntax-rules ()
[(_ id) (*var 'id)])) [(_ id) (*var 'id)]))
(define (make-table-if-necessary style content)
(if (= 1 (length content))
(let ([paras (apply append (map flow-paragraphs (car content)))])
(if (andmap paragraph? paras)
(list (make-paragraph (apply append (map paragraph-content paras))))
(list (make-table style content))))
(list (make-table style content))))
(define (*defproc prototypes arg-contractss result-contracts content-thunk) (define (*defproc prototypes arg-contractss result-contracts content-thunk)
(let ([spacer (hspace 1)] (let ([spacer (hspace 1)]
@ -336,8 +342,7 @@
(append (append
(list (list
(list (make-flow (list (make-flow
(list (make-table-if-necessary
(make-table
"prototype" "prototype"
(list (list
(list (list
@ -373,7 +378,7 @@
(to-flow spacer) (to-flow spacer)
(to-flow 'rarr) (to-flow 'rarr)
(to-flow spacer) (to-flow spacer)
(make-flow (list (result-contract)))))))))) (make-flow (list (result-contract)))))))))
(apply append (apply append
(map (lambda (v arg-contract) (map (lambda (v arg-contract)
(cond (cond
@ -381,8 +386,7 @@
(list (list
(list (list
(make-flow (make-flow
(list (make-table-if-necessary
(make-table
"argcontract" "argcontract"
(list (list
(let ([v (if (keyword? (car v)) (let ([v (if (keyword? (car v))
@ -401,7 +405,7 @@
(to-flow "=") (to-flow "=")
(to-flow spacer) (to-flow spacer)
(to-flow (to-element (caddr v)))) (to-flow (to-element (caddr v))))
null)))))))))] null))))))))]
[else null])) [else null]))
(cdr prototype) (cdr prototype)
arg-contracts)))) arg-contracts))))

View File

@ -405,7 +405,9 @@
(unless (null? content) (unless (null? content)
(finish-line!)) (finish-line!))
(if multi-line? (if multi-line?
(make-table "schemeblock" (map list (reverse docs))) (if (= 1 (length docs))
(car (flow-paragraphs (car docs)))
(make-table "schemeblock" (map list (reverse docs))))
(make-sized-element #f (reverse content) dest-col)))) (make-sized-element #f (reverse content) dest-col))))
(define (to-element c) (define (to-element c)

View File

@ -9,6 +9,11 @@
margin-right: auto; margin-right: auto;
} }
table td {
padding-left: 0;
padding-right: 0;
}
.main { .main {
width: 35em; width: 35em;
text-align: left; text-align: left;
@ -147,7 +152,7 @@
} }
.prototype td { .prototype td {
vertical-align: baseline; vertical-align: top;
} }
.schemeblock td { .schemeblock td {
@ -155,7 +160,7 @@
} }
.argcontract td { .argcontract td {
vertical-align: baseline; vertical-align: top;
} }
.centered { .centered {