This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-01
Channels
- # aleph (6)
- # announcements (37)
- # aws (1)
- # beginners (67)
- # calva (9)
- # clerk (5)
- # clj-kondo (3)
- # clojure (19)
- # clojure-europe (40)
- # clojure-nl (1)
- # clojure-norway (36)
- # clojure-uk (5)
- # clojuredesign-podcast (7)
- # clojurescript (28)
- # datomic (9)
- # emacs (8)
- # figwheel-main (4)
- # fulcro (6)
- # hyperfiddle (19)
- # integrant (4)
- # java (9)
- # lsp (131)
- # malli (9)
- # missionary (85)
- # off-topic (13)
- # pathom (3)
- # polylith (11)
- # releases (1)
- # sci (4)
- # shadow-cljs (7)
- # specter (2)
- # vscode (1)
- # xtdb (2)
I was trying to set things up so that all results are shown except for the results from defn
, but couldn't figure it out. More info in 🧵
Here's what I tried:
(def var-viewer
{:pred (fn [o]
(or (var? o)
(fn? o)))
:transform-fn (fn [_]
nil)})
(clerk/reset-viewers!
(into [var-viewer]
(remove #{v/var-viewer
v/var-from-def-viewer})
v/default-viewers))
{:nextjournal.clerk/visibility {:code :hide :result :show}}
(defn my-fn [])
(+ 1 2)
The goal is for 3
to show up for the (+ 1 2)
expression, but to prevent #function[wikiart/my-fn]
from showing up for (defn my-fn [])
.with the latest version on main the example at the bottom of https://github.com/nextjournal/clerk/blob/main/notebooks/viewers/context.clj should work
👀 1
👍 1
I have a workaround so I'll probably stick with that until an official release. I just wanted to check to see if I was doing something dumb.