Liking cljdoc? Tell your friends :D

hyper.routes

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

find-render-fnclj

(find-render-fn route-index route-name)

Find the :get handler for a named route.

Find the :get handler for a named route.
sourceraw docstring

find-route-titleclj

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

find-route-watchesclj

(find-route-watches route-index global-watches route-name)

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

index-routesclj

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

live-route-indexclj

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

live-routesclj

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

resolve-headclj

(resolve-head head req)

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

resolve-titleclj

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