Skip to content

Clay integration — embed code-editor in notebooks#2

Merged
pbaille merged 2 commits intomainfrom
clay-editor
Feb 17, 2026
Merged

Clay integration — embed code-editor in notebooks#2
pbaille merged 2 commits intomainfrom
clay-editor

Conversation

@pbaille
Copy link
Copy Markdown
Owner

@pbaille pbaille commented Feb 17, 2026

Summary

Minimal Clay integration: embed interactive noon code-editors in Clay notebook output.

Changes

Commit 1 — Decouple code-editor from global state

  • code_editor.cljs: show-piano-roll? is now a prop instead of reading from noon.client.state
  • doc.cljs: thin connected-code-editor wrapper injects the global toggle

Commit 2 — Clay integration

  • noon.viz.clay (~30 lines): (editor source) returns kind/hiccup for Clay
  • noon.widget (~45 lines): scans DOM for [data-noon-widget], mounts real code-editor
  • Widget is part of the main client build (:entries in shadow module, no separate build)
  • No init-fnindex.html and Clay pages call their entry points explicitly
  • :clay alias in deps.edn (Clay 2.0.10 + Kindly)
  • Test notebook: notebooks/clay_test.clj

Commit 3 — gitignore Clay output

What was NOT taken from widget-clay branch

  • No separate shadow build
  • No editor groups
  • No auto-play / auto-eval
  • No CDN URLs / deploy workflow changes
  • No duplicated component — widget uses the real code-editor

Usage

(require '[noon.viz.clay :as nclay])
(nclay/editor "(play (tup s0 s1 s2 s3))")

Requires shadow-cljs watch client running locally.

@pbaille pbaille force-pushed the clay-editor branch 2 times, most recently from 8e0ff97 to 295ce04 Compare February 17, 2026 05:53
show-piano-roll? moved into options map instead of reading from noon.client.state.
doc.cljs provides a thin connected-code-editor wrapper that injects it.
- noon.viz.clay: editor fn emitting kind/hiccup for Clay notebooks
- noon.widget: self-contained mounting layer with own stylefy init
- Widget included in main client build via :entries (single build)
- No init-fn: docs index.html and Clay pages call their entry points explicitly
- Gitignore docs/ and notebooks/ (Clay output)
@pbaille pbaille merged commit 32e6043 into main Feb 17, 2026
1 of 2 checks passed
@pbaille pbaille deleted the clay-editor branch February 17, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant