style: consistent figure style (#3060)

Use a consistent style for the "good / bad" examples:

- start the code at the far left of each box
- keep a little space between the top of the box & the label
This commit is contained in:
Ben Greenman 2020-02-28 08:42:59 -05:00 committed by GitHub
parent 354dfbac04
commit 24cdc58951
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,21 +30,24 @@ your code.
(define (conversion f) (define (conversion f)
(* 5/9 (- f 32))) (* 5/9 (- f 32)))
] ]
@filebox[@tt{really bad} @racketmod[#:file
@codeblock{#lang racket @tt{really bad}
racket
(define (conversion f) (define (conversion f)
(* 5/9 (- f 32) (* 5/9 (- f 32)
) )
) )
}] ]
] ]
You are allowed to place all closing parenthesis on a line by itself at the You are allowed to place all closing parenthesis on a line by itself at the
end of long sequences, be those definitions or pieces of data. end of long sequences, be those definitions or pieces of data.
@compare[ @compare[
@filebox[@tt{acceptable} @racketmod[#:file
@codeblock{#lang racket @tt{acceptable}
racket
(define modes (define modes
'(edit '(edit
help help
@ -53,9 +56,10 @@ end of long sequences, be those definitions or pieces of data.
trace trace
step step
)) ))
}] ]
@filebox[@tt{also acceptable} @racketmod[#:file
@codeblock{#lang racket @tt{also acceptable}
racket
(define turn% (define turn%
(class object% (class object%
(init-field state) (init-field state)
@ -68,7 +72,7 @@ end of long sequences, be those definitions or pieces of data.
(define/public (is-placable? place) (define/public (is-placable? place)
(send state legal? place)) (send state legal? place))
)) ))
}] ]
] ]
Doing so is most useful when you expect to add, delete, or swap items in Doing so is most useful when you expect to add, delete, or swap items in
such sequences. such sequences.
@ -383,12 +387,13 @@ space between the two, even if theyre separated by parentheses.
(define (f x g) (define (f x g)
[(< x 3) (g (g 3))]) [(< x 3) (g (g 3))])
] ]
@filebox[@tt{bad} @racketmod[#:file
@codeblock{#lang racket @tt{bad}
racket
(define(f x g) (define(f x g)
[(< x 3)(g(g 3))]) [(< x 3)(g(g 3))])
}] ]
] ]