Restructure SX docs nav into 4 top-level sections with nested routing
New hierarchy: Geography (Reactive Islands, Hypermedia Lakes, Marshes, Isomorphism), Language (Docs, Specs, Bootstrappers, Testing), Applications (CSSX, Protocols), Etc (Essays, Philosophy, Plans). All routes updated to match: /reactive/* → /geography/reactive/*, /docs/* → /language/docs/*, /essays/* → /etc/essays/*, etc. Updates nav-data.sx, all defpage routes, API endpoints, internal links across 43 files. Enhanced find-nav-match for nested group resolution. Also includes: page-helpers-demo sf-total fix (reduce instead of set!), rebootstrapped sx-browser.js and sx_ref.py, defensive slice/rest guards. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
(div :id "click-result" :class "p-4 rounded bg-stone-100 text-stone-500 text-center"
|
||||
"Click the button to load content.")
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/click"
|
||||
:sx-get "/geography/hypermedia/examples/api/click"
|
||||
:sx-target "#click-result"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors"
|
||||
@@ -39,7 +39,7 @@
|
||||
(defcomp ~form-demo ()
|
||||
(div :class "space-y-4"
|
||||
(form
|
||||
:sx-post "/hypermedia/examples/api/form"
|
||||
:sx-post "/geography/hypermedia/examples/api/form"
|
||||
:sx-target "#form-result"
|
||||
:sx-swap "innerHTML"
|
||||
:class "space-y-3"
|
||||
@@ -63,7 +63,7 @@
|
||||
(defcomp ~polling-demo ()
|
||||
(div :class "space-y-4"
|
||||
(div :id "poll-target"
|
||||
:sx-get "/hypermedia/examples/api/poll"
|
||||
:sx-get "/geography/hypermedia/examples/api/poll"
|
||||
:sx-trigger "load, every 2s"
|
||||
:sx-swap "innerHTML"
|
||||
:class "p-4 rounded border border-stone-200 bg-stone-100 text-center font-mono"
|
||||
@@ -99,7 +99,7 @@
|
||||
(td :class "px-3 py-2 text-stone-700" name)
|
||||
(td :class "px-3 py-2"
|
||||
(button
|
||||
:sx-delete (str "/hypermedia/examples/api/delete/" id)
|
||||
:sx-delete (str "/geography/hypermedia/examples/api/delete/" id)
|
||||
:sx-target (str "#row-" id)
|
||||
:sx-swap "outerHTML"
|
||||
:sx-confirm "Delete this item?"
|
||||
@@ -116,7 +116,7 @@
|
||||
(div :class "flex items-center justify-between p-3 rounded border border-stone-200"
|
||||
(span :class "text-stone-800" value)
|
||||
(button
|
||||
:sx-get (str "/hypermedia/examples/api/edit?value=" value)
|
||||
:sx-get (str "/geography/hypermedia/examples/api/edit?value=" value)
|
||||
:sx-target "#edit-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "text-sm text-violet-600 hover:text-violet-800"
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
(defcomp ~inline-edit-form (&key value)
|
||||
(form
|
||||
:sx-post "/hypermedia/examples/api/edit"
|
||||
:sx-post "/geography/hypermedia/examples/api/edit"
|
||||
:sx-target "#edit-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "flex items-center gap-2 p-3 rounded border border-violet-300 bg-violet-50"
|
||||
@@ -134,7 +134,7 @@
|
||||
:class "px-3 py-1.5 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
"save")
|
||||
(button :type "button"
|
||||
:sx-get (str "/hypermedia/examples/api/edit/cancel?value=" value)
|
||||
:sx-get (str "/geography/hypermedia/examples/api/edit/cancel?value=" value)
|
||||
:sx-target "#edit-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-3 py-1.5 bg-stone-200 text-stone-700 rounded text-sm hover:bg-stone-300"
|
||||
@@ -152,7 +152,7 @@
|
||||
(p :class "text-stone-500" "Box B")
|
||||
(p :class "text-sm text-stone-400" "Waiting...")))
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/oob"
|
||||
:sx-get "/geography/hypermedia/examples/api/oob"
|
||||
:sx-target "#oob-box-a"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -164,7 +164,7 @@
|
||||
(div :class "space-y-4"
|
||||
(p :class "text-sm text-stone-500" "The content below loads automatically when the page renders.")
|
||||
(div :id "lazy-target"
|
||||
:sx-get "/hypermedia/examples/api/lazy"
|
||||
:sx-get "/geography/hypermedia/examples/api/lazy"
|
||||
:sx-trigger "load"
|
||||
:sx-swap "innerHTML"
|
||||
:class "p-6 rounded border border-stone-200 bg-stone-100 text-center"
|
||||
@@ -187,7 +187,7 @@
|
||||
(str "Item " (+ i 1) " — loaded with the page")))
|
||||
(list 1 2 3 4 5))
|
||||
(div :id "scroll-sentinel"
|
||||
:sx-get "/hypermedia/examples/api/scroll?page=2"
|
||||
:sx-get "/geography/hypermedia/examples/api/scroll?page=2"
|
||||
:sx-trigger "intersect once"
|
||||
:sx-target "#scroll-items"
|
||||
:sx-swap "beforeend"
|
||||
@@ -201,7 +201,7 @@
|
||||
items)
|
||||
(when (<= page 5)
|
||||
(div :id "scroll-sentinel"
|
||||
:sx-get (str "/hypermedia/examples/api/scroll?page=" page)
|
||||
:sx-get (str "/geography/hypermedia/examples/api/scroll?page=" page)
|
||||
:sx-trigger "intersect once"
|
||||
:sx-target "#scroll-items"
|
||||
:sx-swap "beforeend"
|
||||
@@ -217,7 +217,7 @@
|
||||
(div :class "bg-violet-600 h-4 rounded-full transition-all" :style "width: 0%"))
|
||||
(p :class "text-sm text-stone-500 text-center" "Click start to begin."))
|
||||
(button
|
||||
:sx-post "/hypermedia/examples/api/progress/start"
|
||||
:sx-post "/geography/hypermedia/examples/api/progress/start"
|
||||
:sx-target "#progress-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -230,7 +230,7 @@
|
||||
:style (str "width: " percent "%")))
|
||||
(p :class "text-sm text-stone-500 text-center" (str percent "% complete"))
|
||||
(when (< percent 100)
|
||||
(div :sx-get (str "/hypermedia/examples/api/progress/status?job=" job-id)
|
||||
(div :sx-get (str "/geography/hypermedia/examples/api/progress/status?job=" job-id)
|
||||
:sx-trigger "load delay:500ms"
|
||||
:sx-target "#progress-target"
|
||||
:sx-swap "innerHTML"))
|
||||
@@ -242,7 +242,7 @@
|
||||
(defcomp ~active-search-demo ()
|
||||
(div :class "space-y-3"
|
||||
(input :type "text" :name "q"
|
||||
:sx-get "/hypermedia/examples/api/search"
|
||||
:sx-get "/geography/hypermedia/examples/api/search"
|
||||
:sx-trigger "keyup delay:300ms changed"
|
||||
:sx-target "#search-results"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -262,11 +262,11 @@
|
||||
;; --- Inline validation demo ---
|
||||
|
||||
(defcomp ~inline-validation-demo ()
|
||||
(form :class "space-y-4" :sx-post "/hypermedia/examples/api/validate/submit" :sx-target "#validation-result" :sx-swap "innerHTML"
|
||||
(form :class "space-y-4" :sx-post "/geography/hypermedia/examples/api/validate/submit" :sx-target "#validation-result" :sx-swap "innerHTML"
|
||||
(div
|
||||
(label :class "block text-sm font-medium text-stone-700 mb-1" "Email")
|
||||
(input :type "text" :name "email" :placeholder "user@example.com"
|
||||
:sx-get "/hypermedia/examples/api/validate"
|
||||
:sx-get "/geography/hypermedia/examples/api/validate"
|
||||
:sx-trigger "blur"
|
||||
:sx-target "#email-feedback"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -290,7 +290,7 @@
|
||||
(div
|
||||
(label :class "block text-sm font-medium text-stone-700 mb-1" "Category")
|
||||
(select :name "category"
|
||||
:sx-get "/hypermedia/examples/api/values"
|
||||
:sx-get "/geography/hypermedia/examples/api/values"
|
||||
:sx-trigger "change"
|
||||
:sx-target "#value-items"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -314,7 +314,7 @@
|
||||
(defcomp ~reset-on-submit-demo ()
|
||||
(div :class "space-y-3"
|
||||
(form :id "reset-form"
|
||||
:sx-post "/hypermedia/examples/api/reset-submit"
|
||||
:sx-post "/geography/hypermedia/examples/api/reset-submit"
|
||||
:sx-target "#reset-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-on:afterSwap "this.reset()"
|
||||
@@ -354,7 +354,7 @@
|
||||
(td :class "px-3 py-2 text-stone-700" stock)
|
||||
(td :class "px-3 py-2"
|
||||
(button
|
||||
:sx-get (str "/hypermedia/examples/api/editrow/" id)
|
||||
:sx-get (str "/geography/hypermedia/examples/api/editrow/" id)
|
||||
:sx-target (str "#erow-" id)
|
||||
:sx-swap "outerHTML"
|
||||
:class "text-sm text-violet-600 hover:text-violet-800"
|
||||
@@ -373,14 +373,14 @@
|
||||
:class "w-20 px-2 py-1 border border-stone-300 rounded text-sm"))
|
||||
(td :class "px-3 py-2 space-x-1"
|
||||
(button
|
||||
:sx-post (str "/hypermedia/examples/api/editrow/" id)
|
||||
:sx-post (str "/geography/hypermedia/examples/api/editrow/" id)
|
||||
:sx-target (str "#erow-" id)
|
||||
:sx-swap "outerHTML"
|
||||
:sx-include (str "#erow-" id)
|
||||
:class "text-sm text-emerald-600 hover:text-emerald-800"
|
||||
"save")
|
||||
(button
|
||||
:sx-get (str "/hypermedia/examples/api/editrow/" id "/cancel")
|
||||
:sx-get (str "/geography/hypermedia/examples/api/editrow/" id "/cancel")
|
||||
:sx-target (str "#erow-" id)
|
||||
:sx-swap "outerHTML"
|
||||
:class "text-sm text-stone-500 hover:text-stone-700"
|
||||
@@ -393,14 +393,14 @@
|
||||
(form :id "bulk-form"
|
||||
(div :class "flex gap-2 mb-3"
|
||||
(button :type "button"
|
||||
:sx-post "/hypermedia/examples/api/bulk?action=activate"
|
||||
:sx-post "/geography/hypermedia/examples/api/bulk?action=activate"
|
||||
:sx-target "#bulk-table"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-include "#bulk-form"
|
||||
:class "px-3 py-1.5 bg-emerald-600 text-white rounded text-sm hover:bg-emerald-700"
|
||||
"Activate")
|
||||
(button :type "button"
|
||||
:sx-post "/hypermedia/examples/api/bulk?action=deactivate"
|
||||
:sx-post "/geography/hypermedia/examples/api/bulk?action=deactivate"
|
||||
:sx-target "#bulk-table"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-include "#bulk-form"
|
||||
@@ -437,19 +437,19 @@
|
||||
(div :class "space-y-3"
|
||||
(div :class "flex gap-2"
|
||||
(button
|
||||
:sx-post "/hypermedia/examples/api/swap-log?mode=beforeend"
|
||||
:sx-post "/geography/hypermedia/examples/api/swap-log?mode=beforeend"
|
||||
:sx-target "#swap-log"
|
||||
:sx-swap "beforeend"
|
||||
:class "px-3 py-1.5 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
"Add to End")
|
||||
(button
|
||||
:sx-post "/hypermedia/examples/api/swap-log?mode=afterbegin"
|
||||
:sx-post "/geography/hypermedia/examples/api/swap-log?mode=afterbegin"
|
||||
:sx-target "#swap-log"
|
||||
:sx-swap "afterbegin"
|
||||
:class "px-3 py-1.5 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
"Add to Start")
|
||||
(button
|
||||
:sx-post "/hypermedia/examples/api/swap-log?mode=none"
|
||||
:sx-post "/geography/hypermedia/examples/api/swap-log?mode=none"
|
||||
:sx-target "#swap-log"
|
||||
:sx-swap "none"
|
||||
:class "px-3 py-1.5 bg-stone-600 text-white rounded text-sm hover:bg-stone-700"
|
||||
@@ -469,21 +469,21 @@
|
||||
(div :class "space-y-3"
|
||||
(div :class "flex gap-2"
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/dashboard"
|
||||
:sx-get "/geography/hypermedia/examples/api/dashboard"
|
||||
:sx-target "#filter-target"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-select "#dash-stats"
|
||||
:class "px-3 py-1.5 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
"Stats Only")
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/dashboard"
|
||||
:sx-get "/geography/hypermedia/examples/api/dashboard"
|
||||
:sx-target "#filter-target"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-select "#dash-header"
|
||||
:class "px-3 py-1.5 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
"Header Only")
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/dashboard"
|
||||
:sx-get "/geography/hypermedia/examples/api/dashboard"
|
||||
:sx-target "#filter-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-3 py-1.5 bg-stone-600 text-white rounded text-sm hover:bg-stone-700"
|
||||
@@ -505,10 +505,10 @@
|
||||
|
||||
(defcomp ~tab-btn (&key tab label active)
|
||||
(button
|
||||
:sx-get (str "/hypermedia/examples/api/tabs/" tab)
|
||||
:sx-get (str "/geography/hypermedia/examples/api/tabs/" tab)
|
||||
:sx-target "#tab-content"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-push-url (str "/hypermedia/examples/tabs?tab=" tab)
|
||||
:sx-push-url (str "/geography/hypermedia/examples/tabs?tab=" tab)
|
||||
:class (str "px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors "
|
||||
(if (= active "true")
|
||||
"border-violet-600 text-violet-600"
|
||||
@@ -520,7 +520,7 @@
|
||||
(defcomp ~animations-demo ()
|
||||
(div :class "space-y-4"
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/animate"
|
||||
:sx-get "/geography/hypermedia/examples/api/animate"
|
||||
:sx-target "#anim-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -539,7 +539,7 @@
|
||||
(defcomp ~dialogs-demo ()
|
||||
(div
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/dialog"
|
||||
:sx-get "/geography/hypermedia/examples/api/dialog"
|
||||
:sx-target "#dialog-container"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -549,7 +549,7 @@
|
||||
(defcomp ~dialog-modal (&key title message)
|
||||
(div :class "fixed inset-0 z-50 flex items-center justify-center"
|
||||
(div :class "absolute inset-0 bg-black/50"
|
||||
:sx-get "/hypermedia/examples/api/dialog/close"
|
||||
:sx-get "/geography/hypermedia/examples/api/dialog/close"
|
||||
:sx-target "#dialog-container"
|
||||
:sx-swap "innerHTML")
|
||||
(div :class "relative bg-stone-100 rounded-lg shadow-xl p-6 max-w-md w-full mx-4 space-y-4"
|
||||
@@ -557,13 +557,13 @@
|
||||
(p :class "text-stone-600" message)
|
||||
(div :class "flex justify-end gap-2"
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/dialog/close"
|
||||
:sx-get "/geography/hypermedia/examples/api/dialog/close"
|
||||
:sx-target "#dialog-container"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-stone-200 text-stone-700 rounded text-sm hover:bg-stone-300"
|
||||
"Cancel")
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/dialog/close"
|
||||
:sx-get "/geography/hypermedia/examples/api/dialog/close"
|
||||
:sx-target "#dialog-container"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
@@ -586,16 +586,16 @@
|
||||
(kbd :class "px-2 py-0.5 bg-stone-100 border border-stone-300 rounded text-xs font-mono" "h")
|
||||
(span :class "text-sm text-stone-500" "Help"))))
|
||||
(div :id "kbd-target"
|
||||
:sx-get "/hypermedia/examples/api/keyboard?key=s"
|
||||
:sx-get "/geography/hypermedia/examples/api/keyboard?key=s"
|
||||
:sx-trigger "keyup[key=='s'&&!event.target.matches('input,textarea')] from:body"
|
||||
:sx-swap "innerHTML"
|
||||
:class "p-4 rounded border border-stone-200 bg-stone-100 text-center"
|
||||
(p :class "text-stone-400 text-sm" "Press a shortcut key..."))
|
||||
(div :sx-get "/hypermedia/examples/api/keyboard?key=n"
|
||||
(div :sx-get "/geography/hypermedia/examples/api/keyboard?key=n"
|
||||
:sx-trigger "keyup[key=='n'&&!event.target.matches('input,textarea')] from:body"
|
||||
:sx-target "#kbd-target"
|
||||
:sx-swap "innerHTML")
|
||||
(div :sx-get "/hypermedia/examples/api/keyboard?key=h"
|
||||
(div :sx-get "/geography/hypermedia/examples/api/keyboard?key=h"
|
||||
:sx-trigger "keyup[key=='h'&&!event.target.matches('input,textarea')] from:body"
|
||||
:sx-target "#kbd-target"
|
||||
:sx-swap "innerHTML")))
|
||||
@@ -619,7 +619,7 @@
|
||||
(p :class "text-sm text-stone-500" email)
|
||||
(p :class "text-sm text-stone-500" role))
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/putpatch/edit-all"
|
||||
:sx-get "/geography/hypermedia/examples/api/putpatch/edit-all"
|
||||
:sx-target "#pp-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "text-sm text-violet-600 hover:text-violet-800"
|
||||
@@ -627,7 +627,7 @@
|
||||
|
||||
(defcomp ~pp-form-full (&key name email role)
|
||||
(form
|
||||
:sx-put "/hypermedia/examples/api/putpatch"
|
||||
:sx-put "/geography/hypermedia/examples/api/putpatch"
|
||||
:sx-target "#pp-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "space-y-3"
|
||||
@@ -648,7 +648,7 @@
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
"Save All (PUT)")
|
||||
(button :type "button"
|
||||
:sx-get "/hypermedia/examples/api/putpatch/cancel"
|
||||
:sx-get "/geography/hypermedia/examples/api/putpatch/cancel"
|
||||
:sx-target "#pp-target"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-stone-200 text-stone-700 rounded text-sm hover:bg-stone-300"
|
||||
@@ -659,7 +659,7 @@
|
||||
(defcomp ~json-encoding-demo ()
|
||||
(div :class "space-y-4"
|
||||
(form
|
||||
:sx-post "/hypermedia/examples/api/json-echo"
|
||||
:sx-post "/geography/hypermedia/examples/api/json-echo"
|
||||
:sx-target "#json-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-encoding "json"
|
||||
@@ -691,7 +691,7 @@
|
||||
(div :class "space-y-2"
|
||||
(h4 :class "text-sm font-semibold text-stone-700" "sx-vals — send extra values")
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/echo-vals"
|
||||
:sx-get "/geography/hypermedia/examples/api/echo-vals"
|
||||
:sx-target "#vals-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-vals "{\"source\": \"button\", \"version\": \"2.0\"}"
|
||||
@@ -702,7 +702,7 @@
|
||||
(div :class "space-y-2"
|
||||
(h4 :class "text-sm font-semibold text-stone-700" "sx-headers — send custom headers")
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/echo-headers"
|
||||
:sx-get "/geography/hypermedia/examples/api/echo-headers"
|
||||
:sx-target "#headers-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-headers {:X-Custom-Token "abc123" :X-Request-Source "demo"}
|
||||
@@ -723,7 +723,7 @@
|
||||
(defcomp ~loading-states-demo ()
|
||||
(div :class "space-y-4"
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/slow"
|
||||
:sx-get "/geography/hypermedia/examples/api/slow"
|
||||
:sx-target "#loading-result"
|
||||
:sx-swap "innerHTML"
|
||||
:class "sx-loading-btn px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm flex items-center gap-2"
|
||||
@@ -742,7 +742,7 @@
|
||||
(defcomp ~sync-replace-demo ()
|
||||
(div :class "space-y-3"
|
||||
(input :type "text" :name "q"
|
||||
:sx-get "/hypermedia/examples/api/slow-search"
|
||||
:sx-get "/geography/hypermedia/examples/api/slow-search"
|
||||
:sx-trigger "keyup delay:200ms changed"
|
||||
:sx-target "#sync-result"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -762,7 +762,7 @@
|
||||
(defcomp ~retry-demo ()
|
||||
(div :class "space-y-4"
|
||||
(button
|
||||
:sx-get "/hypermedia/examples/api/flaky"
|
||||
:sx-get "/geography/hypermedia/examples/api/flaky"
|
||||
:sx-target "#retry-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-retry "exponential:1000:8000"
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
(range start (+ start 5)))
|
||||
(if (<= next 6)
|
||||
(div :id "scroll-sentinel"
|
||||
:sx-get (str "/hypermedia/examples/api/scroll?page=" next)
|
||||
:sx-get (str "/geography/hypermedia/examples/api/scroll?page=" next)
|
||||
:sx-trigger "intersect once"
|
||||
:sx-target "#scroll-items"
|
||||
:sx-swap "beforeend"
|
||||
|
||||
@@ -13,20 +13,30 @@
|
||||
:content (~sx-doc :path "/" (~sx-home-content)))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Docs section
|
||||
;; Language section (parent of Docs, Specs, Bootstrappers, Testing)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage language-index
|
||||
:path "/language/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/language/"))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Docs section (under Language)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage docs-index
|
||||
:path "/docs/"
|
||||
:path "/language/docs/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/docs/" (~docs-introduction-content)))
|
||||
:content (~sx-doc :path "/language/docs/" (~docs-introduction-content)))
|
||||
|
||||
(defpage docs-page
|
||||
:path "/docs/<slug>"
|
||||
:path "/language/docs/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/docs/" slug)
|
||||
:content (~sx-doc :path (str "/language/docs/" slug)
|
||||
(case slug
|
||||
"introduction" (~docs-introduction-content)
|
||||
"getting-started" (~docs-getting-started-content)
|
||||
@@ -44,23 +54,23 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage hypermedia-index
|
||||
:path "/hypermedia/"
|
||||
:path "/geography/hypermedia/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/hypermedia/"))
|
||||
:content (~sx-doc :path "/geography/hypermedia/"))
|
||||
|
||||
(defpage reference-index
|
||||
:path "/hypermedia/reference/"
|
||||
:path "/geography/hypermedia/reference/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/hypermedia/reference/" (~reference-index-content)))
|
||||
:content (~sx-doc :path "/geography/hypermedia/reference/" (~reference-index-content)))
|
||||
|
||||
(defpage reference-page
|
||||
:path "/hypermedia/reference/<slug>"
|
||||
:path "/geography/hypermedia/reference/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (reference-data slug)
|
||||
:content (~sx-doc :path (str "/hypermedia/reference/" slug)
|
||||
:content (~sx-doc :path (str "/geography/hypermedia/reference/" slug)
|
||||
(case slug
|
||||
"attributes" (~reference-attrs-content
|
||||
:req-table (~doc-attr-table-from-data :title "Request Attributes" :attrs req-attrs)
|
||||
@@ -83,11 +93,11 @@
|
||||
:uniq-table (~doc-attr-table-from-data :title "Unique to sx" :attrs uniq-attrs)))))
|
||||
|
||||
(defpage reference-attr-detail
|
||||
:path "/hypermedia/reference/attributes/<slug>"
|
||||
:path "/geography/hypermedia/reference/attributes/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (attr-detail-data slug)
|
||||
:content (~sx-doc :path "/hypermedia/reference/attributes"
|
||||
:content (~sx-doc :path "/geography/hypermedia/reference/attributes"
|
||||
(if attr-not-found
|
||||
(~reference-attr-not-found :slug slug)
|
||||
(~reference-attr-detail-content
|
||||
@@ -99,11 +109,11 @@
|
||||
:wire-placeholder-id attr-wire-id))))
|
||||
|
||||
(defpage reference-header-detail
|
||||
:path "/hypermedia/reference/headers/<slug>"
|
||||
:path "/geography/hypermedia/reference/headers/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (header-detail-data slug)
|
||||
:content (~sx-doc :path "/hypermedia/reference/headers"
|
||||
:content (~sx-doc :path "/geography/hypermedia/reference/headers"
|
||||
(if header-not-found
|
||||
(~reference-attr-not-found :slug slug)
|
||||
(~reference-header-detail-content
|
||||
@@ -114,11 +124,11 @@
|
||||
:demo header-demo))))
|
||||
|
||||
(defpage reference-event-detail
|
||||
:path "/hypermedia/reference/events/<slug>"
|
||||
:path "/geography/hypermedia/reference/events/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (event-detail-data slug)
|
||||
:content (~sx-doc :path "/hypermedia/reference/events"
|
||||
:content (~sx-doc :path "/geography/hypermedia/reference/events"
|
||||
(if event-not-found
|
||||
(~reference-attr-not-found :slug slug)
|
||||
(~reference-event-detail-content
|
||||
@@ -128,20 +138,30 @@
|
||||
:demo event-demo))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Protocols section
|
||||
;; Applications section (parent of CSSX, Protocols)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage applications-index
|
||||
:path "/applications/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/applications/"))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Protocols section (under Applications)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage protocols-index
|
||||
:path "/protocols/"
|
||||
:path "/applications/protocols/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/protocols/" (~protocol-wire-format-content)))
|
||||
:content (~sx-doc :path "/applications/protocols/" (~protocol-wire-format-content)))
|
||||
|
||||
(defpage protocol-page
|
||||
:path "/protocols/<slug>"
|
||||
:path "/applications/protocols/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/protocols/" slug)
|
||||
:content (~sx-doc :path (str "/applications/protocols/" slug)
|
||||
(case slug
|
||||
"wire-format" (~protocol-wire-format-content)
|
||||
"fragments" (~protocol-fragments-content)
|
||||
@@ -156,16 +176,16 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage examples-index
|
||||
:path "/hypermedia/examples/"
|
||||
:path "/geography/hypermedia/examples/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/hypermedia/examples/"))
|
||||
:content (~sx-doc :path "/geography/hypermedia/examples/"))
|
||||
|
||||
(defpage examples-page
|
||||
:path "/hypermedia/examples/<slug>"
|
||||
:path "/geography/hypermedia/examples/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/hypermedia/examples/" slug)
|
||||
:content (~sx-doc :path (str "/geography/hypermedia/examples/" slug)
|
||||
(case slug
|
||||
"click-to-load" (~example-click-to-load)
|
||||
"form-submission" (~example-form-submission)
|
||||
@@ -197,20 +217,30 @@
|
||||
:else (~example-click-to-load))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Essays section
|
||||
;; Etc section (parent of Essays, Philosophy, Plans)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage etc-index
|
||||
:path "/etc/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/etc/"))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Essays section (under Etc)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage essays-index
|
||||
:path "/essays/"
|
||||
:path "/etc/essays/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/essays/" (~essays-index-content)))
|
||||
:content (~sx-doc :path "/etc/essays/" (~essays-index-content)))
|
||||
|
||||
(defpage essay-page
|
||||
:path "/essays/<slug>"
|
||||
:path "/etc/essays/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/essays/" slug)
|
||||
:content (~sx-doc :path (str "/etc/essays/" slug)
|
||||
(case slug
|
||||
"sx-sucks" (~essay-sx-sucks)
|
||||
"why-sexps" (~essay-why-sexps)
|
||||
@@ -235,16 +265,16 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage philosophy-index
|
||||
:path "/philosophy/"
|
||||
:path "/etc/philosophy/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/philosophy/" (~philosophy-index-content)))
|
||||
:content (~sx-doc :path "/etc/philosophy/" (~philosophy-index-content)))
|
||||
|
||||
(defpage philosophy-page
|
||||
:path "/philosophy/<slug>"
|
||||
:path "/etc/philosophy/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/philosophy/" slug)
|
||||
:content (~sx-doc :path (str "/etc/philosophy/" slug)
|
||||
(case slug
|
||||
"sx-manifesto" (~essay-sx-manifesto)
|
||||
"godel-escher-bach" (~essay-godel-escher-bach)
|
||||
@@ -258,16 +288,16 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage cssx-index
|
||||
:path "/cssx/"
|
||||
:path "/applications/cssx/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/cssx/" (~cssx-overview-content)))
|
||||
:content (~sx-doc :path "/applications/cssx/" (~cssx-overview-content)))
|
||||
|
||||
(defpage cssx-page
|
||||
:path "/cssx/<slug>"
|
||||
:path "/applications/cssx/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/cssx/" slug)
|
||||
:content (~sx-doc :path (str "/applications/cssx/" slug)
|
||||
(case slug
|
||||
"patterns" (~cssx-patterns-content)
|
||||
"delivery" (~cssx-delivery-content)
|
||||
@@ -282,23 +312,23 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage specs-index
|
||||
:path "/specs/"
|
||||
:path "/language/specs/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/specs/" (~spec-architecture-content)))
|
||||
:content (~sx-doc :path "/language/specs/" (~spec-architecture-content)))
|
||||
|
||||
(defpage specs-page
|
||||
:path "/specs/<slug>"
|
||||
:path "/language/specs/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/specs/" slug)
|
||||
:content (~sx-doc :path (str "/language/specs/" slug)
|
||||
(case slug
|
||||
"core" (~spec-overview-content
|
||||
:spec-title "Core Language"
|
||||
:spec-files (map (fn (item)
|
||||
(dict :title (get item "title") :desc (get item "desc")
|
||||
:prose (get item "prose")
|
||||
:filename (get item "filename") :href (str "/specs/" (get item "slug"))
|
||||
:filename (get item "filename") :href (str "/language/specs/" (get item "slug"))
|
||||
:source (read-spec-file (get item "filename"))))
|
||||
core-spec-items))
|
||||
"adapters" (~spec-overview-content
|
||||
@@ -306,7 +336,7 @@
|
||||
:spec-files (map (fn (item)
|
||||
(dict :title (get item "title") :desc (get item "desc")
|
||||
:prose (get item "prose")
|
||||
:filename (get item "filename") :href (str "/specs/" (get item "slug"))
|
||||
:filename (get item "filename") :href (str "/language/specs/" (get item "slug"))
|
||||
:source (read-spec-file (get item "filename"))))
|
||||
adapter-spec-items))
|
||||
"browser" (~spec-overview-content
|
||||
@@ -314,7 +344,7 @@
|
||||
:spec-files (map (fn (item)
|
||||
(dict :title (get item "title") :desc (get item "desc")
|
||||
:prose (get item "prose")
|
||||
:filename (get item "filename") :href (str "/specs/" (get item "slug"))
|
||||
:filename (get item "filename") :href (str "/language/specs/" (get item "slug"))
|
||||
:source (read-spec-file (get item "filename"))))
|
||||
browser-spec-items))
|
||||
"extensions" (~spec-overview-content
|
||||
@@ -322,7 +352,7 @@
|
||||
:spec-files (map (fn (item)
|
||||
(dict :title (get item "title") :desc (get item "desc")
|
||||
:prose (get item "prose")
|
||||
:filename (get item "filename") :href (str "/specs/" (get item "slug"))
|
||||
:filename (get item "filename") :href (str "/language/specs/" (get item "slug"))
|
||||
:source (read-spec-file (get item "filename"))))
|
||||
extension-spec-items))
|
||||
:else (let ((spec (find-spec slug)))
|
||||
@@ -340,17 +370,17 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage bootstrappers-index
|
||||
:path "/bootstrappers/"
|
||||
:path "/language/bootstrappers/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/bootstrappers/" (~bootstrappers-index-content)))
|
||||
:content (~sx-doc :path "/language/bootstrappers/" (~bootstrappers-index-content)))
|
||||
|
||||
(defpage bootstrapper-page
|
||||
:path "/bootstrappers/<slug>"
|
||||
:path "/language/bootstrappers/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (bootstrapper-data slug)
|
||||
:content (~sx-doc :path (str "/bootstrappers/" slug)
|
||||
:content (~sx-doc :path (str "/language/bootstrappers/" slug)
|
||||
(if bootstrapper-not-found
|
||||
(~spec-not-found :slug slug)
|
||||
(case slug
|
||||
@@ -385,53 +415,53 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage isomorphism-index
|
||||
:path "/isomorphism/"
|
||||
:path "/geography/isomorphism/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/isomorphism/" (~plan-isomorphic-content)))
|
||||
:content (~sx-doc :path "/geography/isomorphism/" (~plan-isomorphic-content)))
|
||||
|
||||
(defpage bundle-analyzer
|
||||
:path "/isomorphism/bundle-analyzer"
|
||||
:path "/geography/isomorphism/bundle-analyzer"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (bundle-analyzer-data)
|
||||
:content (~sx-doc :path "/isomorphism/bundle-analyzer"
|
||||
:content (~sx-doc :path "/geography/isomorphism/bundle-analyzer"
|
||||
(~bundle-analyzer-content
|
||||
:pages pages :total-components total-components :total-macros total-macros
|
||||
:pure-count pure-count :io-count io-count)))
|
||||
|
||||
(defpage routing-analyzer
|
||||
:path "/isomorphism/routing-analyzer"
|
||||
:path "/geography/isomorphism/routing-analyzer"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (routing-analyzer-data)
|
||||
:content (~sx-doc :path "/isomorphism/routing-analyzer"
|
||||
:content (~sx-doc :path "/geography/isomorphism/routing-analyzer"
|
||||
(~routing-analyzer-content
|
||||
:pages pages :total-pages total-pages :client-count client-count
|
||||
:server-count server-count :registry-sample registry-sample)))
|
||||
|
||||
(defpage data-test
|
||||
:path "/isomorphism/data-test"
|
||||
:path "/geography/isomorphism/data-test"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (data-test-data)
|
||||
:content (~sx-doc :path "/isomorphism/data-test"
|
||||
:content (~sx-doc :path "/geography/isomorphism/data-test"
|
||||
(~data-test-content
|
||||
:server-time server-time :items items
|
||||
:phase phase :transport transport)))
|
||||
|
||||
(defpage async-io-demo
|
||||
:path "/isomorphism/async-io"
|
||||
:path "/geography/isomorphism/async-io"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/isomorphism/async-io" (~async-io-demo-content)))
|
||||
:content (~sx-doc :path "/geography/isomorphism/async-io" (~async-io-demo-content)))
|
||||
|
||||
(defpage streaming-demo
|
||||
:path "/isomorphism/streaming"
|
||||
:path "/geography/isomorphism/streaming"
|
||||
:auth :public
|
||||
:stream true
|
||||
:layout :sx-docs
|
||||
:shell (~sx-doc :path "/isomorphism/streaming"
|
||||
:shell (~sx-doc :path "/geography/isomorphism/streaming"
|
||||
(~streaming-demo-layout
|
||||
(~suspense :id "stream-fast" :fallback (~stream-skeleton))
|
||||
(~suspense :id "stream-medium" :fallback (~stream-skeleton))
|
||||
@@ -444,35 +474,35 @@
|
||||
:stream-time stream-time))
|
||||
|
||||
(defpage affinity-demo
|
||||
:path "/isomorphism/affinity"
|
||||
:path "/geography/isomorphism/affinity"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (affinity-demo-data)
|
||||
:content (~sx-doc :path "/isomorphism/affinity"
|
||||
:content (~sx-doc :path "/geography/isomorphism/affinity"
|
||||
(~affinity-demo-content :components components :page-plans page-plans)))
|
||||
|
||||
(defpage optimistic-demo
|
||||
:path "/isomorphism/optimistic"
|
||||
:path "/geography/isomorphism/optimistic"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (optimistic-demo-data)
|
||||
:content (~sx-doc :path "/isomorphism/optimistic"
|
||||
:content (~sx-doc :path "/geography/isomorphism/optimistic"
|
||||
(~optimistic-demo-content :items items :server-time server-time)))
|
||||
|
||||
(defpage offline-demo
|
||||
:path "/isomorphism/offline"
|
||||
:path "/geography/isomorphism/offline"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (offline-demo-data)
|
||||
:content (~sx-doc :path "/isomorphism/offline"
|
||||
:content (~sx-doc :path "/geography/isomorphism/offline"
|
||||
(~offline-demo-content :notes notes :server-time server-time)))
|
||||
|
||||
;; Wildcard must come AFTER specific routes (first-match routing)
|
||||
(defpage isomorphism-page
|
||||
:path "/isomorphism/<slug>"
|
||||
:path "/geography/isomorphism/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/isomorphism/" slug)
|
||||
:content (~sx-doc :path (str "/geography/isomorphism/" slug)
|
||||
(case slug
|
||||
"bundle-analyzer" (~bundle-analyzer-content
|
||||
:pages pages :total-components total-components :total-macros total-macros
|
||||
@@ -487,19 +517,19 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage plans-index
|
||||
:path "/plans/"
|
||||
:path "/etc/plans/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/plans/" (~plans-index-content)))
|
||||
:content (~sx-doc :path "/etc/plans/" (~plans-index-content)))
|
||||
|
||||
(defpage plan-page
|
||||
:path "/plans/<slug>"
|
||||
:path "/etc/plans/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (case slug
|
||||
"theorem-prover" (prove-data)
|
||||
:else nil)
|
||||
:content (~sx-doc :path (str "/plans/" slug)
|
||||
:content (~sx-doc :path (str "/etc/plans/" slug)
|
||||
(case slug
|
||||
"status" (~plan-status-content)
|
||||
"reader-macros" (~plan-reader-macros-content)
|
||||
@@ -530,39 +560,58 @@
|
||||
:else (~plans-index-content))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Reactive Islands section
|
||||
;; Geography section (parent of Reactive Islands, Hypermedia Lakes, Marshes)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage geography-index
|
||||
:path "/geography/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/geography/"))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Reactive Islands section (under Geography)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage reactive-islands-index
|
||||
:path "/reactive/"
|
||||
:path "/geography/reactive/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/reactive/" (~reactive-islands-index-content)))
|
||||
:content (~sx-doc :path "/geography/reactive/" (~reactive-islands-index-content)))
|
||||
|
||||
(defpage reactive-islands-page
|
||||
:path "/reactive/<slug>"
|
||||
:path "/geography/reactive/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path (str "/reactive/" slug)
|
||||
:content (~sx-doc :path (str "/geography/reactive/" slug)
|
||||
(case slug
|
||||
"demo" (~reactive-islands-demo-content)
|
||||
"event-bridge" (~reactive-islands-event-bridge-content)
|
||||
"named-stores" (~reactive-islands-named-stores-content)
|
||||
"plan" (~reactive-islands-plan-content)
|
||||
"marshes" (~reactive-islands-marshes-content)
|
||||
"phase2" (~reactive-islands-phase2-content)
|
||||
:else (~reactive-islands-index-content))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Marshes section (under Geography)
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage marshes-index
|
||||
:path "/geography/marshes/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:content (~sx-doc :path "/geography/marshes/" (~reactive-islands-marshes-content)))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Bootstrapped page helpers demo
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage page-helpers-demo
|
||||
:path "/bootstrappers/page-helpers"
|
||||
:path "/language/bootstrappers/page-helpers"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (page-helpers-demo-data)
|
||||
:content (~sx-doc :path "/bootstrappers/page-helpers"
|
||||
:content (~sx-doc :path "/language/bootstrappers/page-helpers"
|
||||
(~page-helpers-demo-content
|
||||
:sf-categories sf-categories :sf-total sf-total :sf-ms sf-ms
|
||||
:ref-sample ref-sample :ref-ms ref-ms
|
||||
@@ -580,11 +629,11 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defpage testing-index
|
||||
:path "/testing/"
|
||||
:path "/language/testing/"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (run-modular-tests "all")
|
||||
:content (~sx-doc :path "/testing/"
|
||||
:content (~sx-doc :path "/language/testing/"
|
||||
(~testing-overview-content
|
||||
:server-results server-results
|
||||
:framework-source framework-source
|
||||
@@ -596,7 +645,7 @@
|
||||
:engine-source engine-source)))
|
||||
|
||||
(defpage testing-page
|
||||
:path "/testing/<slug>"
|
||||
:path "/language/testing/<slug>"
|
||||
:auth :public
|
||||
:layout :sx-docs
|
||||
:data (case slug
|
||||
@@ -608,7 +657,7 @@
|
||||
"engine" (run-modular-tests "engine")
|
||||
"orchestration" (run-modular-tests "orchestration")
|
||||
:else (dict))
|
||||
:content (~sx-doc :path (str "/testing/" slug)
|
||||
:content (~sx-doc :path (str "/language/testing/" slug)
|
||||
(case slug
|
||||
"eval" (~testing-spec-content
|
||||
:spec-name "eval"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
(defcomp ~ref-get-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/time"
|
||||
:sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-get-result"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -26,7 +26,7 @@
|
||||
(defcomp ~ref-post-demo ()
|
||||
(div :class "space-y-3"
|
||||
(form
|
||||
:sx-post "/hypermedia/reference/api/greet"
|
||||
:sx-post "/geography/hypermedia/reference/api/greet"
|
||||
:sx-target "#ref-post-result"
|
||||
:sx-swap "innerHTML"
|
||||
:class "flex gap-2"
|
||||
@@ -48,7 +48,7 @@
|
||||
(div :class "flex items-center justify-between p-3 bg-stone-100 rounded"
|
||||
(span :class "text-stone-700 text-sm" "Status: " (strong "draft"))
|
||||
(button
|
||||
:sx-put "/hypermedia/reference/api/status"
|
||||
:sx-put "/geography/hypermedia/reference/api/status"
|
||||
:sx-target "#ref-put-view"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-vals "{\"status\": \"published\"}"
|
||||
@@ -63,17 +63,17 @@
|
||||
(div :class "space-y-2"
|
||||
(div :id "ref-del-1" :class "flex items-center justify-between p-2 border border-stone-200 rounded"
|
||||
(span :class "text-sm text-stone-700" "Item A")
|
||||
(button :sx-delete "/hypermedia/reference/api/item/1"
|
||||
(button :sx-delete "/geography/hypermedia/reference/api/item/1"
|
||||
:sx-target "#ref-del-1" :sx-swap "delete"
|
||||
:class "text-red-500 text-sm hover:text-red-700" "Remove"))
|
||||
(div :id "ref-del-2" :class "flex items-center justify-between p-2 border border-stone-200 rounded"
|
||||
(span :class "text-sm text-stone-700" "Item B")
|
||||
(button :sx-delete "/hypermedia/reference/api/item/2"
|
||||
(button :sx-delete "/geography/hypermedia/reference/api/item/2"
|
||||
:sx-target "#ref-del-2" :sx-swap "delete"
|
||||
:class "text-red-500 text-sm hover:text-red-700" "Remove"))
|
||||
(div :id "ref-del-3" :class "flex items-center justify-between p-2 border border-stone-200 rounded"
|
||||
(span :class "text-sm text-stone-700" "Item C")
|
||||
(button :sx-delete "/hypermedia/reference/api/item/3"
|
||||
(button :sx-delete "/geography/hypermedia/reference/api/item/3"
|
||||
:sx-target "#ref-del-3" :sx-swap "delete"
|
||||
:class "text-red-500 text-sm hover:text-red-700" "Remove"))))
|
||||
|
||||
@@ -86,11 +86,11 @@
|
||||
(div :class "p-3 bg-stone-100 rounded"
|
||||
(span :class "text-stone-700 text-sm" "Theme: " (strong :id "ref-patch-val" "light")))
|
||||
(div :class "flex gap-2"
|
||||
(button :sx-patch "/hypermedia/reference/api/theme"
|
||||
(button :sx-patch "/geography/hypermedia/reference/api/theme"
|
||||
:sx-vals "{\"theme\": \"dark\"}"
|
||||
:sx-target "#ref-patch-val" :sx-swap "innerHTML"
|
||||
:class "px-3 py-1 bg-stone-800 text-white rounded text-sm" "Dark")
|
||||
(button :sx-patch "/hypermedia/reference/api/theme"
|
||||
(button :sx-patch "/geography/hypermedia/reference/api/theme"
|
||||
:sx-vals "{\"theme\": \"light\"}"
|
||||
:sx-target "#ref-patch-val" :sx-swap "innerHTML"
|
||||
:class "px-3 py-1 bg-stone-100 border border-stone-300 text-stone-700 rounded text-sm" "Light"))))
|
||||
@@ -102,7 +102,7 @@
|
||||
(defcomp ~ref-trigger-demo ()
|
||||
(div :class "space-y-3"
|
||||
(input :type "text" :name "q" :placeholder "Type to search..."
|
||||
:sx-get "/hypermedia/reference/api/trigger-search"
|
||||
:sx-get "/geography/hypermedia/reference/api/trigger-search"
|
||||
:sx-trigger "input changed delay:300ms"
|
||||
:sx-target "#ref-trigger-result"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -118,12 +118,12 @@
|
||||
(defcomp ~ref-target-demo ()
|
||||
(div :class "space-y-3"
|
||||
(div :class "flex gap-2"
|
||||
(button :sx-get "/hypermedia/reference/api/time"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-target-a"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-3 py-1 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
"Update Box A")
|
||||
(button :sx-get "/hypermedia/reference/api/time"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-target-b"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-3 py-1 bg-emerald-600 text-white rounded text-sm hover:bg-emerald-700"
|
||||
@@ -141,13 +141,13 @@
|
||||
(defcomp ~ref-swap-demo ()
|
||||
(div :class "space-y-3"
|
||||
(div :class "flex gap-2 flex-wrap"
|
||||
(button :sx-get "/hypermedia/reference/api/swap-item"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/swap-item"
|
||||
:sx-target "#ref-swap-list" :sx-swap "beforeend"
|
||||
:class "px-3 py-1 bg-violet-600 text-white rounded text-sm" "beforeend")
|
||||
(button :sx-get "/hypermedia/reference/api/swap-item"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/swap-item"
|
||||
:sx-target "#ref-swap-list" :sx-swap "afterbegin"
|
||||
:class "px-3 py-1 bg-emerald-600 text-white rounded text-sm" "afterbegin")
|
||||
(button :sx-get "/hypermedia/reference/api/swap-item"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/swap-item"
|
||||
:sx-target "#ref-swap-list" :sx-swap "innerHTML"
|
||||
:class "px-3 py-1 bg-blue-600 text-white rounded text-sm" "innerHTML"))
|
||||
(div :id "ref-swap-list"
|
||||
@@ -160,7 +160,7 @@
|
||||
|
||||
(defcomp ~ref-oob-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button :sx-get "/hypermedia/reference/api/oob"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/oob"
|
||||
:sx-target "#ref-oob-main"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded text-sm hover:bg-violet-700"
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
(defcomp ~ref-select-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button :sx-get "/hypermedia/reference/api/select-page"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/select-page"
|
||||
:sx-target "#ref-select-result"
|
||||
:sx-select "#the-content"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -198,7 +198,7 @@
|
||||
(div :id "ref-confirm-item"
|
||||
:class "flex items-center justify-between p-3 border border-stone-200 rounded"
|
||||
(span :class "text-sm text-stone-700" "Important file.txt")
|
||||
(button :sx-delete "/hypermedia/reference/api/item/confirm"
|
||||
(button :sx-delete "/geography/hypermedia/reference/api/item/confirm"
|
||||
:sx-target "#ref-confirm-item" :sx-swap "delete"
|
||||
:sx-confirm "Are you sure you want to delete this file?"
|
||||
:class "px-3 py-1 text-red-500 text-sm border border-red-200 rounded hover:bg-red-50"
|
||||
@@ -211,14 +211,14 @@
|
||||
(defcomp ~ref-pushurl-demo ()
|
||||
(div :class "space-y-3"
|
||||
(div :class "flex gap-2"
|
||||
(a :href "/hypermedia/reference/attributes/sx-get"
|
||||
:sx-get "/hypermedia/reference/attributes/sx-get"
|
||||
(a :href "/geography/hypermedia/reference/attributes/sx-get"
|
||||
:sx-get "/geography/hypermedia/reference/attributes/sx-get"
|
||||
:sx-target "#main-panel" :sx-select "#main-panel"
|
||||
:sx-swap "outerHTML" :sx-push-url "true"
|
||||
:class "px-3 py-1 bg-violet-100 text-violet-700 rounded text-sm no-underline hover:bg-violet-200"
|
||||
"sx-get page")
|
||||
(a :href "/hypermedia/reference/attributes/sx-post"
|
||||
:sx-get "/hypermedia/reference/attributes/sx-post"
|
||||
(a :href "/geography/hypermedia/reference/attributes/sx-post"
|
||||
:sx-get "/geography/hypermedia/reference/attributes/sx-post"
|
||||
:sx-target "#main-panel" :sx-select "#main-panel"
|
||||
:sx-swap "outerHTML" :sx-push-url "true"
|
||||
:class "px-3 py-1 bg-violet-100 text-violet-700 rounded text-sm no-underline hover:bg-violet-200"
|
||||
@@ -233,7 +233,7 @@
|
||||
(defcomp ~ref-sync-demo ()
|
||||
(div :class "space-y-3"
|
||||
(input :type "text" :name "q" :placeholder "Type quickly..."
|
||||
:sx-get "/hypermedia/reference/api/slow-echo"
|
||||
:sx-get "/geography/hypermedia/reference/api/slow-echo"
|
||||
:sx-trigger "input changed delay:100ms"
|
||||
:sx-sync "replace"
|
||||
:sx-target "#ref-sync-result"
|
||||
@@ -251,7 +251,7 @@
|
||||
|
||||
(defcomp ~ref-encoding-demo ()
|
||||
(div :class "space-y-3"
|
||||
(form :sx-post "/hypermedia/reference/api/upload-name"
|
||||
(form :sx-post "/geography/hypermedia/reference/api/upload-name"
|
||||
:sx-encoding "multipart/form-data"
|
||||
:sx-target "#ref-encoding-result"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -271,7 +271,7 @@
|
||||
|
||||
(defcomp ~ref-headers-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button :sx-get "/hypermedia/reference/api/echo-headers"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/echo-headers"
|
||||
:sx-headers {:X-Custom-Token "abc123" :X-Request-Source "demo"}
|
||||
:sx-target "#ref-headers-result"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -295,7 +295,7 @@
|
||||
(option :value "all" "All")
|
||||
(option :value "books" "Books")
|
||||
(option :value "tools" "Tools")))
|
||||
(button :sx-get "/hypermedia/reference/api/echo-vals"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/echo-vals"
|
||||
:sx-include "#ref-inc-cat"
|
||||
:sx-target "#ref-include-result"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -311,7 +311,7 @@
|
||||
|
||||
(defcomp ~ref-vals-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button :sx-post "/hypermedia/reference/api/echo-vals"
|
||||
(button :sx-post "/geography/hypermedia/reference/api/echo-vals"
|
||||
:sx-vals "{\"source\": \"demo\", \"page\": \"3\"}"
|
||||
:sx-target "#ref-vals-result"
|
||||
:sx-swap "innerHTML"
|
||||
@@ -327,8 +327,8 @@
|
||||
|
||||
(defcomp ~ref-media-demo ()
|
||||
(div :class "space-y-3"
|
||||
(a :href "/hypermedia/reference/attributes/sx-get"
|
||||
:sx-get "/hypermedia/reference/attributes/sx-get"
|
||||
(a :href "/geography/hypermedia/reference/attributes/sx-get"
|
||||
:sx-get "/geography/hypermedia/reference/attributes/sx-get"
|
||||
:sx-target "#main-panel" :sx-select "#main-panel"
|
||||
:sx-swap "outerHTML" :sx-push-url "true"
|
||||
:sx-media "(min-width: 768px)"
|
||||
@@ -346,13 +346,13 @@
|
||||
(div :class "grid grid-cols-2 gap-3"
|
||||
(div :class "p-3 border border-stone-200 rounded"
|
||||
(p :class "text-xs text-stone-400 mb-2" "sx enabled")
|
||||
(button :sx-get "/hypermedia/reference/api/time"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-dis-a" :sx-swap "innerHTML"
|
||||
:class "px-3 py-1 bg-violet-600 text-white rounded text-sm" "Load")
|
||||
(div :id "ref-dis-a" :class "mt-2 text-sm text-stone-500" "—"))
|
||||
(div :sx-disable "true" :class "p-3 border border-stone-200 rounded"
|
||||
(p :class "text-xs text-stone-400 mb-2" "sx disabled")
|
||||
(button :sx-get "/hypermedia/reference/api/time"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-dis-b" :sx-swap "innerHTML"
|
||||
:class "px-3 py-1 bg-stone-400 text-white rounded text-sm" "Load")
|
||||
(div :id "ref-dis-b" :class "mt-2 text-sm text-stone-500"
|
||||
@@ -378,7 +378,7 @@
|
||||
|
||||
(defcomp ~ref-retry-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button :sx-get "/hypermedia/reference/api/flaky"
|
||||
(button :sx-get "/geography/hypermedia/reference/api/flaky"
|
||||
:sx-target "#ref-retry-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-retry "true"
|
||||
@@ -414,13 +414,13 @@
|
||||
(defcomp ~ref-boost-demo ()
|
||||
(div :class "space-y-3"
|
||||
(nav :sx-boost "true" :class "flex gap-3"
|
||||
(a :href "/hypermedia/reference/attributes/sx-get"
|
||||
(a :href "/geography/hypermedia/reference/attributes/sx-get"
|
||||
:class "text-violet-600 hover:text-violet-800 underline text-sm"
|
||||
"sx-get")
|
||||
(a :href "/hypermedia/reference/attributes/sx-post"
|
||||
(a :href "/geography/hypermedia/reference/attributes/sx-post"
|
||||
:class "text-violet-600 hover:text-violet-800 underline text-sm"
|
||||
"sx-post")
|
||||
(a :href "/hypermedia/reference/attributes/sx-target"
|
||||
(a :href "/geography/hypermedia/reference/attributes/sx-target"
|
||||
:class "text-violet-600 hover:text-violet-800 underline text-sm"
|
||||
"sx-target"))
|
||||
(p :class "text-xs text-stone-400"
|
||||
@@ -434,7 +434,7 @@
|
||||
(defcomp ~ref-preload-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/time"
|
||||
:sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-preload-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-preload "mouseover"
|
||||
@@ -452,7 +452,7 @@
|
||||
(div :class "space-y-3"
|
||||
(div :class "flex gap-2 items-center"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/time"
|
||||
:sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-preserve-container"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -473,7 +473,7 @@
|
||||
(div :class "space-y-3"
|
||||
(div :class "flex gap-3 items-center"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/slow-echo"
|
||||
:sx-get "/geography/hypermedia/reference/api/slow-echo"
|
||||
:sx-target "#ref-indicator-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-indicator "#ref-spinner"
|
||||
@@ -495,7 +495,7 @@
|
||||
(defcomp ~ref-validate-demo ()
|
||||
(div :class "space-y-3"
|
||||
(form
|
||||
:sx-post "/hypermedia/reference/api/greet"
|
||||
:sx-post "/geography/hypermedia/reference/api/greet"
|
||||
:sx-target "#ref-validate-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-validate "true"
|
||||
@@ -517,7 +517,7 @@
|
||||
(defcomp ~ref-ignore-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/time"
|
||||
:sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-ignore-container"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -539,14 +539,14 @@
|
||||
(div :id "ref-opt-item-1"
|
||||
:class "flex items-center justify-between p-2 border border-stone-200 rounded"
|
||||
(span :class "text-sm text-stone-700" "Optimistic item A")
|
||||
(button :sx-delete "/hypermedia/reference/api/item/opt1"
|
||||
(button :sx-delete "/geography/hypermedia/reference/api/item/opt1"
|
||||
:sx-target "#ref-opt-item-1" :sx-swap "delete"
|
||||
:sx-optimistic "remove"
|
||||
:class "text-red-500 text-sm hover:text-red-700" "Remove"))
|
||||
(div :id "ref-opt-item-2"
|
||||
:class "flex items-center justify-between p-2 border border-stone-200 rounded"
|
||||
(span :class "text-sm text-stone-700" "Optimistic item B")
|
||||
(button :sx-delete "/hypermedia/reference/api/item/opt2"
|
||||
(button :sx-delete "/geography/hypermedia/reference/api/item/opt2"
|
||||
:sx-target "#ref-opt-item-2" :sx-swap "delete"
|
||||
:sx-optimistic "remove"
|
||||
:class "text-red-500 text-sm hover:text-red-700" "Remove"))
|
||||
@@ -560,7 +560,7 @@
|
||||
(defcomp ~ref-replace-url-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/time"
|
||||
:sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-replurl-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-replace-url "true"
|
||||
@@ -578,7 +578,7 @@
|
||||
(div :class "space-y-3"
|
||||
(div :class "flex gap-3 items-center"
|
||||
(button :id "ref-diselt-btn"
|
||||
:sx-get "/hypermedia/reference/api/slow-echo"
|
||||
:sx-get "/geography/hypermedia/reference/api/slow-echo"
|
||||
:sx-target "#ref-diselt-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-disabled-elt "#ref-diselt-btn"
|
||||
@@ -597,7 +597,7 @@
|
||||
(defcomp ~ref-prompt-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/prompt-echo"
|
||||
:sx-get "/geography/hypermedia/reference/api/prompt-echo"
|
||||
:sx-target "#ref-prompt-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-prompt "Enter your name:"
|
||||
@@ -614,7 +614,7 @@
|
||||
(defcomp ~ref-params-demo ()
|
||||
(div :class "space-y-3"
|
||||
(form
|
||||
:sx-post "/hypermedia/reference/api/echo-vals"
|
||||
:sx-post "/geography/hypermedia/reference/api/echo-vals"
|
||||
:sx-target "#ref-params-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-params "name"
|
||||
@@ -636,7 +636,7 @@
|
||||
|
||||
(defcomp ~ref-sse-demo ()
|
||||
(div :class "space-y-3"
|
||||
(div :sx-sse "/hypermedia/reference/api/sse-time"
|
||||
(div :sx-sse "/geography/hypermedia/reference/api/sse-time"
|
||||
:sx-sse-swap "time"
|
||||
:sx-swap "innerHTML"
|
||||
(div :id "ref-sse-result"
|
||||
@@ -656,7 +656,7 @@
|
||||
(defcomp ~ref-header-prompt-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/prompt-echo"
|
||||
:sx-get "/geography/hypermedia/reference/api/prompt-echo"
|
||||
:sx-target "#ref-hdr-prompt-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-prompt "Enter your name:"
|
||||
@@ -673,7 +673,7 @@
|
||||
(defcomp ~ref-header-trigger-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/trigger-event"
|
||||
:sx-get "/geography/hypermedia/reference/api/trigger-event"
|
||||
:sx-target "#ref-hdr-trigger-result"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -690,7 +690,7 @@
|
||||
(defcomp ~ref-header-retarget-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/retarget"
|
||||
:sx-get "/geography/hypermedia/reference/api/retarget"
|
||||
:sx-target "#ref-hdr-retarget-main"
|
||||
:sx-swap "innerHTML"
|
||||
:class "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm"
|
||||
@@ -717,7 +717,7 @@
|
||||
(input :id "ref-evt-br-input" :type "text" :placeholder "Type something first..."
|
||||
:class "flex-1 px-3 py-2 border border-stone-300 rounded text-sm focus:outline-none focus:ring-2 focus:ring-violet-500")
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/time"
|
||||
:sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-evt-br-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-on:sx:beforeRequest "if (!document.getElementById('ref-evt-br-input').value) { event.preventDefault(); document.getElementById('ref-evt-br-result').textContent = 'Cancelled — input is empty!'; }"
|
||||
@@ -734,7 +734,7 @@
|
||||
(defcomp ~ref-event-after-request-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/time"
|
||||
:sx-get "/geography/hypermedia/reference/api/time"
|
||||
:sx-target "#ref-evt-ar-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-on:sx:afterRequest "document.getElementById('ref-evt-ar-log').textContent = 'Response status: ' + (event.detail ? event.detail.status : '?')"
|
||||
@@ -754,7 +754,7 @@
|
||||
(defcomp ~ref-event-after-swap-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/swap-item"
|
||||
:sx-get "/geography/hypermedia/reference/api/swap-item"
|
||||
:sx-target "#ref-evt-as-list"
|
||||
:sx-swap "beforeend"
|
||||
:sx-on:sx:afterSwap "var items = document.querySelectorAll('#ref-evt-as-list > div'); if (items.length) items[items.length-1].scrollIntoView({behavior:'smooth'}); document.getElementById('ref-evt-as-count').textContent = items.length + ' items'"
|
||||
@@ -774,7 +774,7 @@
|
||||
(defcomp ~ref-event-response-error-demo ()
|
||||
(div :class "space-y-3"
|
||||
(button
|
||||
:sx-get "/hypermedia/reference/api/error-500"
|
||||
:sx-get "/geography/hypermedia/reference/api/error-500"
|
||||
:sx-target "#ref-evt-err-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-on:sx:responseError "var s=document.getElementById('ref-evt-err-status'); s.style.display='block'; s.textContent='Error ' + (event.detail ? event.detail.status || '?' : '?') + ' received'"
|
||||
@@ -796,7 +796,7 @@
|
||||
(defcomp ~ref-event-validation-failed-demo ()
|
||||
(div :class "space-y-3"
|
||||
(form
|
||||
:sx-post "/hypermedia/reference/api/greet"
|
||||
:sx-post "/geography/hypermedia/reference/api/greet"
|
||||
:sx-target "#ref-evt-vf-result"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-validate "true"
|
||||
@@ -847,13 +847,13 @@
|
||||
"Open DevTools console, then navigate to a pure page (no :data expression). "
|
||||
"You'll see \"sx:route client /path\" in the console — no network request is made.")
|
||||
(div :class "flex gap-2 flex-wrap"
|
||||
(a :href "/essays/"
|
||||
(a :href "/etc/essays/"
|
||||
:class "px-3 py-1 bg-violet-100 text-violet-700 rounded text-sm no-underline hover:bg-violet-200"
|
||||
"Essays")
|
||||
(a :href "/plans/"
|
||||
(a :href "/etc/plans/"
|
||||
:class "px-3 py-1 bg-violet-100 text-violet-700 rounded text-sm no-underline hover:bg-violet-200"
|
||||
"Plans")
|
||||
(a :href "/protocols/"
|
||||
(a :href "/applications/protocols/"
|
||||
:class "px-3 py-1 bg-violet-100 text-violet-700 rounded text-sm no-underline hover:bg-violet-200"
|
||||
"Protocols"))
|
||||
(p :class "text-xs text-stone-400"
|
||||
@@ -866,7 +866,7 @@
|
||||
|
||||
(defcomp ~ref-event-sse-open-demo ()
|
||||
(div :class "space-y-3"
|
||||
(div :sx-sse "/hypermedia/reference/api/sse-time"
|
||||
(div :sx-sse "/geography/hypermedia/reference/api/sse-time"
|
||||
:sx-sse-swap "time"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-on:sx:sseOpen "document.getElementById('ref-evt-sseopen-status').textContent = 'Connected'; document.getElementById('ref-evt-sseopen-status').className = 'inline-block px-2 py-0.5 rounded text-xs bg-emerald-100 text-emerald-700'"
|
||||
@@ -884,7 +884,7 @@
|
||||
|
||||
(defcomp ~ref-event-sse-message-demo ()
|
||||
(div :class "space-y-3"
|
||||
(div :sx-sse "/hypermedia/reference/api/sse-time"
|
||||
(div :sx-sse "/geography/hypermedia/reference/api/sse-time"
|
||||
:sx-sse-swap "time"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-on:sx:sseMessage "var c = parseInt(document.getElementById('ref-evt-ssemsg-count').dataset.count || '0') + 1; document.getElementById('ref-evt-ssemsg-count').dataset.count = c; document.getElementById('ref-evt-ssemsg-count').textContent = c + ' messages received'"
|
||||
@@ -902,7 +902,7 @@
|
||||
|
||||
(defcomp ~ref-event-sse-error-demo ()
|
||||
(div :class "space-y-3"
|
||||
(div :sx-sse "/hypermedia/reference/api/sse-time"
|
||||
(div :sx-sse "/geography/hypermedia/reference/api/sse-time"
|
||||
:sx-sse-swap "time"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-on:sx:sseError "document.getElementById('ref-evt-sseerr-status').textContent = 'Disconnected'; document.getElementById('ref-evt-sseerr-status').className = 'inline-block px-2 py-0.5 rounded text-xs bg-red-100 text-red-700'"
|
||||
|
||||
Reference in New Issue
Block a user