Skip to content

Commit 6dd4f20

Browse files
Merge pull request #276 from ClojureCivitas/clay-datastar
Clay datastar
2 parents 458900b + 74994f7 commit 6dd4f20

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/scicloj/clay/webserver/datastar.clj

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
:clay {:title "Serving webapps from your REPL"
55
:quarto {:author :timothypratley
66
:description "Using Clay's new webserver features and Datastar to build a chart with realtime server-push updates"
7-
:draft true
7+
:image "datastar.png"
88
:reference-location :margin
99
:citation-location :margin
1010
:type :post
1111
:date "2026-01-10"
1212
:category :clay
13-
:tags [:clay :workflow]}}}
13+
:tags [:clay :workflow]
14+
:keywords [:clay :datastar]}}}
1415
(:require [hiccup.core :as hiccup]))
1516

1617
;; Clay converts a Clojure namespace into an HTML page and runs a web server to display it.
@@ -144,7 +145,7 @@
144145
;; and returns the new chart as HTML.
145146
;; (Each click is a signal received.)
146147
;;
147-
;; [^servable-feature]: See the [Clay documentation](https://scicloj.github.io/clay/clay_book.webserver.html) for details on `:kindly/servable` endpoints.
148+
;; [^servable-feature]: See the [Clay documentation](https://scicloj.github.io/clay/clay_book.webserver.html#servable-functions) for details on `:kindly/servable` endpoints.
148149

149150
;; ::: {.callout-note}
150151
;; **Naming convention matters:** The function name ends in `html`.
@@ -179,7 +180,7 @@
179180
;; When a client connects, we store its SSE generator.
180181
;; When it closes, we remove it.
181182
;;
182-
;; [^handler-feature]: This `:kindly/handler` feature is available in Clay 2.0.4 and later. See the [Clay documentation](https://scicloj.github.io/clay/clay_book.webserver.html) for details.
183+
;; [^handler-feature]: This `:kindly/handler` feature is available in Clay 2.0.4 and later. See the [Clay documentation](https://scicloj.github.io/clay/clay_book.webserver.html#handler-endpoints) for details.
183184

184185
(require '[starfederation.datastar.clojure.adapter.http-kit :as d*a])
185186

@@ -241,14 +242,14 @@
241242

242243
;; ## Reflecting on the skies
243244

244-
;; All the code for this page is written in Clojure.
245-
;; The entire application—state management, rendering, and interactivitylives in Clojure, not split between server and client JavaScript.
245+
;; All the code for this HTML page is written in Clojure.
246+
;; The state management, rendering, and interactivity lives in your REPL.
246247
;;
247-
;; This style of web development can be very productive.
248-
;; Clay makes it fast to prototype rich, stateful applications using only Clojure and server-side rendering.
249-
;; Datastar eliminates the need for client-side state management and event handling.
248+
;; This style of web development is fun and productive.
249+
;; Clay makes it fast to prototype rich applications.
250+
;; Datastar avoids client-side state management and event handling.
250251
;; (One star, many observers.)
251-
;; The result: you reason about the whole application in one language and get interactive,
252+
;; You reason about the application in one language and get interactive,
252253
;; responsive UX without touching JavaScript.
253254
;; (And so we return to the stars.)
254255
;;
16.9 KB
Loading

0 commit comments

Comments
 (0)