documentation
This commit is contained in:
@@ -24,6 +24,10 @@ windows. It owns the underlying webview context, provides the base URL used by
|
||||
those windows, and gives access to persistent settings through
|
||||
@racketmodname[wv-settings].
|
||||
|
||||
A context stores both JavaScript and CSS boilerplate. The JavaScript boilerplate
|
||||
is passed to the native runtime, while the CSS boilerplate is injected into HTML
|
||||
documents served by the local HTTPS server.
|
||||
|
||||
This module exports the @racket[wv-context%] class.
|
||||
|
||||
@defclass[wv-context% object% ()]{
|
||||
@@ -40,10 +44,17 @@ to access that value, its base URL, and a settings object.
|
||||
(webview-standard-file-getter base-path)]
|
||||
[context-js procedure?
|
||||
(λ () "")]
|
||||
[context-css procedure?
|
||||
(λ () "")]
|
||||
[boilerplate-js string?
|
||||
(webview-default-boilerplate-js context-js)]
|
||||
[boilerplate-css string?
|
||||
(webview-default-boilerplate-css context-css)]
|
||||
[ini any/c
|
||||
(error "You need to provide a 'ini' file settings interface for settings, e.g. simple-ini/class")])]{
|
||||
(error
|
||||
(string-append "You need to provide a 'ini' "
|
||||
"file settings interface for "
|
||||
"settings, e.g. simple-ini/class"))])]{
|
||||
|
||||
Creates a new context object.
|
||||
|
||||
@@ -56,9 +67,14 @@ The constructor accepts the following initialization fields.
|
||||
@racket[(webview-standard-file-getter base-path)].}
|
||||
@item{@racket[context-js] is a procedure producing additional JavaScript for
|
||||
the context. Its default value is @racket[(λ () "")].}
|
||||
@item{@racket[context-css] is a procedure producing additional CSS for the
|
||||
context. Its default value is @racket[(λ () "")].}
|
||||
@item{@racket[boilerplate-js] is the JavaScript boilerplate installed into the
|
||||
underlying webview context. Its default value is
|
||||
@racket[(webview-default-boilerplate-js context-js)].}
|
||||
@item{@racket[boilerplate-css] is the CSS boilerplate stored in the context
|
||||
and injected into HTML documents. Its default value is
|
||||
@racket[(webview-default-boilerplate-css context-css)].}
|
||||
@item{@racket[ini] is the settings backend used to construct the associated
|
||||
@racket[wv-settings%] object. No default backend is provided; omitting it
|
||||
raises an error.}]
|
||||
|
||||
Reference in New Issue
Block a user