Liking cljdoc? Tell your friends :D

dev.arkaitz.web-base.render

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.
raw docstring

doctypeclj

source

htmlclj

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

middlewareclj

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.
sourceraw docstring

responseclj

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

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close