Turns a handler's Hiccup body into HTML, applying the route's layout stack from the height the request asks for (SPEC §12).
A layout is a function of one map of slots — :content, :request and
whatever the response put under :wb/slots — and nesting is composition:
the stack folds from the innermost layout outwards. Route data :wb/layouts
is a vector, outermost first; reitit concatenates a parent's vector with its
children's, so nested routes accumulate their stack and a child opts out with
^:replace. Height counts from the innermost layout, which is why adding an
outer layout later never invalidates a height a handler already names.
Turns a handler's Hiccup body into HTML, applying the route's layout stack from the height the request asks for (SPEC §12). A layout is a function of one map of slots — `:content`, `:request` and whatever the response put under `:wb/slots` — and nesting is composition: the stack folds from the innermost layout outwards. Route data `:wb/layouts` is a vector, outermost first; reitit concatenates a parent's vector with its children's, so nested routes accumulate their stack and a child opts out with `^:replace`. Height counts from the innermost layout, which is why adding an outer layout later never invalidates a height a handler already names.
(check-scripts! scripts config-key)Refuses scripts unless it is absent or a sequence of local-path? strings, naming
config-key.
Refuses `scripts` unless it is absent or a sequence of `local-path?` strings, naming `config-key`.
(html markup)Hiccup data → HTML string. :mode :html because hiccup 2 defaults to XHTML
self-closing tags. Correctness for runtime data rests on hiccup's HtmlRenderer
protocol, not on the macro's compile-time folding, which is inert here.
Hiccup data → HTML string. `:mode :html` because hiccup 2 defaults to XHTML self-closing tags. Correctness for runtime data rests on hiccup's HtmlRenderer protocol, not on the macro's compile-time folding, which is inert here.
(local-path? href)Whether href is a path on this origin, as a browser reads it: one /, then no
backslash, space or control character. A stylesheet or a script the shell links is
one, never another origin's: a script there would run under this page's nonce.
Whether `href` is a path on this origin, as a browser reads it: one `/`, then no backslash, space or control character. A stylesheet or a script the shell links is one, never another origin's: a script there would run under this page's nonce.
reitit middleware. Compiled per route so the layout stack is read from the
merged route data once; a route without :wb/layouts still renders, with an
empty stack. The route's :wb/scripts — local paths, a parent's before a child's —
go on the request as :wb/scripts, for the shell to load under the request's nonce
(since 0.22.0); malformed, they fail at router construction.
reitit middleware. Compiled per route so the layout stack is read from the merged route data once; a route without `:wb/layouts` still renders, with an empty stack. The route's `:wb/scripts` — local paths, a parent's before a child's — go on the request as `:wb/scripts`, for the shell to load under the request's nonce (since 0.22.0); malformed, they fail at router construction.
(response request response stack)Renders a Hiccup :body through stack; leaves any other body untouched.
A page request (not an htmx fragment) gets the whole stack unless the
response names :wb/height; a fragment gets :wb/height or nothing. The
doctype is added only when a page request rendered the whole stack.
Renders a Hiccup `:body` through `stack`; leaves any other body untouched. A page request (not an htmx fragment) gets the whole stack unless the response names `:wb/height`; a fragment gets `:wb/height` or nothing. The doctype is added only when a page request rendered the whole stack.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |