fixing doc
This commit is contained in:
parent
62061b56f3
commit
12a4fca495
|
@ -413,9 +413,8 @@ executes the program in a web browser.
|
||||||
|
|
||||||
The @filepath{.xhtml} should be self-contained, with an exception: if
|
The @filepath{.xhtml} should be self-contained, with an exception: if
|
||||||
the file uses any external resources by using
|
the file uses any external resources by using
|
||||||
@racket[define-resource], those resources are written into a
|
@racket[define-resource], those resources are written into the current
|
||||||
subdirectory called @filepath{res} under the current working
|
working directory, if they do not already exist there.
|
||||||
directory.
|
|
||||||
|
|
||||||
|
|
||||||
@subsection{@tt{get-javascript}}
|
@subsection{@tt{get-javascript}}
|
||||||
|
@ -461,7 +460,7 @@ external resources. When Whalesong compiles a program into a package,
|
||||||
these resources will be bundled alongside the JavaScript-compiled
|
these resources will be bundled alongside the JavaScript-compiled
|
||||||
output.
|
output.
|
||||||
|
|
||||||
@defform[(define-resource id path-string)]{
|
@defform[(define-resource id [path-string])]{
|
||||||
Defines a resource with the given path name.
|
Defines a resource with the given path name.
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
|
@ -471,6 +470,15 @@ For example,
|
||||||
(define-resource my-whale-image-resource "humpback.png")
|
(define-resource my-whale-image-resource "humpback.png")
|
||||||
}|
|
}|
|
||||||
}
|
}
|
||||||
|
As a convenience, you can also write
|
||||||
|
@codeblock|{
|
||||||
|
#lang planet dyoo/whalesong
|
||||||
|
(require (planet dyoo/whalesong/resource))
|
||||||
|
(define-resource humpback.png)
|
||||||
|
}|
|
||||||
|
which defines a variable named @racket[humpback.png] whose
|
||||||
|
resource is @filepath{humpback.png}.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@defproc[(resource->url [a-resource resource?]) string?]{
|
@defproc[(resource->url [a-resource resource?]) string?]{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user