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
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.
yeah itβs still cutting edge and undocumented since weβre not happy with the naming yet