Skip to content

Commit

Permalink
Migrate to code non-depreacted viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
mk committed Dec 26, 2024
1 parent b08b7eb commit 285c20e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions notebooks/viewers/code.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
;; # 👔 Code Viewer
(ns viewers.code
{:nextjournal.clerk/no-cache true}
(:require [nextjournal.clerk :as clerk]
[nextjournal.clerk.viewer :as viewer]))

Expand Down Expand Up @@ -81,8 +80,10 @@ fn main() {
(map + fib (rest fib))))")

(def editor-sync-viewer
(assoc viewer/viewer-eval-viewer :render-fn '(fn [!code _]
[:div.bg-neutral-50 [nextjournal.clerk.render.code/editor !code]])))
(assoc viewer/render-eval-viewer
:render-fn
'(fn [!code _]
[:div.bg-neutral-50 [nextjournal.clerk.render.code/editor !code]])))

^{::clerk/sync true ::clerk/viewer editor-sync-viewer}
(defonce editable-code (atom "(def fib
Expand Down

0 comments on commit 285c20e

Please sign in to comment.