Route-querying helpers shared between server and render.
Pure functions for looking up route metadata by name, resolving titles/head content, and reading the current routes (supporting live-reloading via Var indirection).
Route-querying helpers shared between server and render. Pure functions for looking up route metadata by name, resolving titles/head content, and reading the current routes (supporting live-reloading via Var indirection).
(find-render-fn route-index route-name)Find the :get handler for a named route.
Find the :get handler for a named route.
(find-route-title route-index route-name)Find the :title metadata for a named route. Returns the title value (string or fn) or nil.
Find the :title metadata for a named route. Returns the title value (string or fn) or nil.
(find-route-watches route-index global-watches route-name)Collect all Watchable sources for a named route. Returns a vector of sources built from:
Collect all Watchable sources for a named route. Returns a vector of sources built from: - global-watches supplied to create-handler (applied to every route) - The route's :watches vector (explicit per-route external sources) - The route's :get value, if it's a Var (auto-watch for live reloading) Returns nil if there are no watches.
(index-routes routes)Build a {route-name → route-data} map from a routes vector for O(1) lookups. Handles both flat and arbitrarily-nested reitit-style route trees by compiling a temporary router and reading back the flattened routes.
Build a {route-name → route-data} map from a routes vector for O(1) lookups.
Handles both flat and arbitrarily-nested reitit-style route trees by compiling
a temporary router and reading back the flattened routes.(live-route-index app-state*)Get an indexed map of the current routes for O(1) lookups by name.
Get an indexed map of the current routes for O(1) lookups by name.
(live-routes app-state*)Get the current routes vector, resolving through :routes-source if it's a Var.
Get the current routes vector, resolving through :routes-source if it's a Var.
(resolve-head head req)Resolve extra <head> content.
Intended for injecting stylesheets/scripts (e.g. Tailwind output CSS) without Hyper needing to know anything about build tooling.
Resolve extra <head> content. - If :head is a function, it is called with the Ring request (already enriched with Hyper context) and should return hiccup nodes. - If :head is a Var, dereferences and calls the resulting function with req. - Otherwise, :head is treated as hiccup and used as-is. Intended for injecting stylesheets/scripts (e.g. Tailwind output CSS) without Hyper needing to know anything about build tooling.
(resolve-title title req)Resolve a title value. If it's a fn, call it with the request. Returns the resolved string, or nil.
Resolve a title value. If it's a fn, call it with the request. Returns the resolved string, or nil.
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 |