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:
2026-03-12 00:16:33 +00:00
parent 56f49f29fb
commit 4aa2133b39
4 changed files with 511 additions and 11 deletions

View File

@@ -349,15 +349,22 @@
"extensions" (~spec-overview-content
:spec-title "Extensions"
:spec-files (make-spec-files extension-spec-items))
:else (let ((spec (find-spec slug)))
(if spec
(~spec-detail-content
:spec-title (get spec "title")
:spec-desc (get spec "desc")
:spec-filename (get spec "filename")
:spec-source (read-spec-file (get spec "filename"))
:spec-prose (get spec "prose"))
(~spec-not-found :slug slug)))))))
:else (cond
(starts-with? slug "explore/")
(let ((spec-slug (slice slug 8 (string-length slug)))
(data (spec-explorer-data spec-slug)))
(if data
(~spec-explorer-content :data data)
(~spec-not-found :slug spec-slug)))
:else (let ((spec (find-spec slug)))
(if spec
(~spec-detail-content
:spec-title (get spec "title")
:spec-desc (get spec "desc")
:spec-filename (get spec "filename")
:spec-source (read-spec-file (get spec "filename"))
:spec-prose (get spec "prose"))
(~spec-not-found :slug slug))))))))
;; ---------------------------------------------------------------------------
;; Bootstrappers section