clerk

prnc 2026-02-13T18:33:38.868749Z

hello ๐Ÿ‘‹ Is there a way to always ignore comment forms when rendering (effectively a hidden visibility for both code and result by default)?

Andrea 2026-02-27T13:19:10.589299Z

a bit convoluted but this will do

(clerk/reset-viewers! :default (clerk/add-viewers
                                  [(update viewer/cell-viewer
                                           :transform-fn comp
                                           (viewer/update-val
                                            (fn [{:as cell :keys [form]}]
                                              (cond-> cell
                                                (and (list? form) (= 'comment (first form)))
                                                (assoc-in [:settings ::clerk/visibility] {:code :hide :result :hide})))))]))
need to call it once, regardless of from which ns

๐Ÿ™ 1
Andrea 2026-02-27T13:21:42.916959Z

check https://github.com/nextjournal/clerk/blob/main/notebooks/viewers/context.clj for more context

prnc 2026-02-27T17:02:20.541559Z

thatโ€™s great, thanks Andrea!