Add spec explorer: structured interactive view of SX spec files
- _spec_explorer_data() helper: parses spec files into sections, defines, effects, params, source blocks, and Python translations via PyEmitter - specs-explorer.sx: 10 defcomp components for explorer UI — cards with effect badges, typed param lists, collapsible SX/Python translation panels - Route at /language/specs/explore/<slug> via docs.sx - "Explore" link on existing spec detail pages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -334,9 +334,15 @@ deps.sx depends on: eval")))
|
||||
|
||||
(defcomp ~spec-detail-content (&key (spec-title :as string) (spec-desc :as string) (spec-filename :as string) (spec-source :as string) (spec-prose :as string?))
|
||||
(~doc-page :title spec-title
|
||||
(div :class "flex items-baseline gap-3 mb-4"
|
||||
(div :class "flex items-center gap-3 mb-4"
|
||||
(span :class "text-sm text-stone-400 font-mono" spec-filename)
|
||||
(span :class "text-sm text-stone-500" spec-desc))
|
||||
(span :class "text-sm text-stone-500 flex-1" spec-desc)
|
||||
(a :href (str "/language/specs/explore/" (replace spec-filename ".sx" ""))
|
||||
:sx-get (str "/language/specs/explore/" (replace spec-filename ".sx" ""))
|
||||
:sx-target "#main-panel" :sx-select "#main-panel"
|
||||
:sx-swap "outerHTML" :sx-push-url "true"
|
||||
:class "text-sm text-violet-600 hover:text-violet-800 font-medium whitespace-nowrap"
|
||||
"Explore"))
|
||||
(when spec-prose
|
||||
(div :class "mb-6 space-y-3"
|
||||
(p :class "text-stone-600 leading-relaxed" spec-prose)
|
||||
|
||||
Reference in New Issue
Block a user