add some missing docs
This commit is contained in:
parent
a115076fe4
commit
bda7409367
|
@ -51,3 +51,11 @@ up an image.
|
|||
to short-circuit the full check. (The full check draws the two images
|
||||
and then compares the resulting bitmaps.)
|
||||
}
|
||||
|
||||
|
||||
@defthing[snip-class (is-a?/c snip-class%)]{
|
||||
The snipclass used by images (which are @racket[snip%]s) created by this library.
|
||||
|
||||
Not all @racket[image?] values are @racket[snip%]s, but those that are use this as
|
||||
their @racket[snip-class%].
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
@include-section["image-core.scrbl"]
|
||||
@include-section["matrix-snip.scrbl"]
|
||||
@include-section["snip-canvas.scrbl"]
|
||||
@include-section["syntax-browser.scrbl"]
|
||||
@include-section["tex-table.scrbl"]
|
||||
@include-section["terminal.scrbl"]
|
||||
|
||||
|
|
20
gui-doc/mrlib/scribblings/syntax-browser.scrbl
Normal file
20
gui-doc/mrlib/scribblings/syntax-browser.scrbl
Normal file
|
@ -0,0 +1,20 @@
|
|||
#lang scribble/doc
|
||||
@(require "common.rkt" (for-label mrlib/image-core))
|
||||
|
||||
@title{Syntax Browser}
|
||||
|
||||
@defmodule[mrlib/syntax-browser]
|
||||
|
||||
@defproc[(render-syntax/snip [stx syntax?]) (is-a?/c snip%)]{
|
||||
Constructs a @racket[snip%] object that displays information
|
||||
about @racket[stx].
|
||||
}
|
||||
|
||||
@defproc[(render-syntax/window [stx syntax?]) void?]{ Uses
|
||||
@racket[render-syntax/snip]'s result, together with a frame
|
||||
and editor-canvas to show @racket[stx].
|
||||
}
|
||||
|
||||
@defthing[snip-class (is-a?/c snip-class%)]{
|
||||
The snipclass used by the result of @racket[render-syntax/snip].
|
||||
}
|
|
@ -11,13 +11,20 @@ needed to really make this work:
|
|||
racket/class
|
||||
racket/gui/base
|
||||
racket/match
|
||||
(prefix-in - racket/base)
|
||||
racket/contract
|
||||
(prefix-in : racket/base)
|
||||
"include-bitmap.rkt")
|
||||
|
||||
(define orig-output-port (current-output-port))
|
||||
(define (oprintf . args) (apply fprintf orig-output-port args))
|
||||
|
||||
(provide render-syntax/snip render-syntax/window snip-class)
|
||||
(provide
|
||||
(contract-out
|
||||
[render-syntax/snip
|
||||
(-> syntax? (is-a?/c snip%))]
|
||||
[render-syntax/window
|
||||
(-> syntax? void?)])
|
||||
snip-class)
|
||||
|
||||
;; this is doing the same thing as the class in
|
||||
;; the framework by the same name, but we don't
|
||||
|
@ -47,7 +54,7 @@ needed to really make this work:
|
|||
(class snip-class%
|
||||
(define/override (read stream)
|
||||
(make-object syntax-snip%
|
||||
(unmarshall-syntax (-read (open-input-bytes (send stream get-bytes))))))
|
||||
(unmarshall-syntax (:read (open-input-bytes (send stream get-bytes))))))
|
||||
(super-new)))
|
||||
|
||||
(define snip-class (new syntax-snipclass%))
|
||||
|
|
Loading…
Reference in New Issue
Block a user