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.
(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.
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.
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.
(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 |