Skip to content
Discussion options

You must be logged in to vote

Here is an example notebook that doesn't show defn forms, nor their results:

(ns scratch
  (:require [nextjournal.clerk :as clerk]
            [nextjournal.clerk.viewer :as viewer]))

(defn defn? [cell]
  (some-> cell :result :nextjournal/value ::clerk/var-from-def deref fn?))

^{::clerk/visibility {:code :hide :result :hide}}
(def custom-cell-viewer
  (update viewer/cell-viewer
          :transform-fn comp
          (clerk/update-val (fn [cell]
                              (update-in cell [:settings ::clerk/visibility]
                                         #(if
                                              (defn? cell) {:code :hide :result :hide}
                                     …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@alirezaalavi87
Comment options

@borkdude
Comment options

Answer selected by alirezaalavi87
@alirezaalavi87
Comment options

Comment options

You must be logged in to vote
1 reply
@alirezaalavi87
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants