This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-18
Channels
- # announcements (8)
- # asami (10)
- # babashka (58)
- # beginners (20)
- # calva (4)
- # clerk (9)
- # clj-on-windows (5)
- # cljsrn (1)
- # clojure (12)
- # clojure-australia (2)
- # clojure-europe (24)
- # clojure-gamedev (1)
- # clojure-norway (14)
- # clojure-romania (1)
- # clojurescript (28)
- # conjure (2)
- # cursive (5)
- # dev-tooling (38)
- # emacs (15)
- # events (1)
- # hoplon (12)
- # hyperfiddle (41)
- # introduce-yourself (4)
- # jobs (2)
- # jobs-discuss (17)
- # malli (23)
- # matrix (5)
- # nextjournal (11)
- # pathom (19)
- # pedestal (1)
- # polylith (3)
- # reitit (3)
- # sci (7)
- # xtdb (7)
Hi! It’s possible to hide code with metadata on the form:
^{:nextjournal.clerk/visibility {:code :hide}}
(str "my" " " "value")
Is it possible to control code visibility with the return value from a function?
I want to make a convenience function that returns HTML, and avoid having to tag each form invoking my function with metadata to hide code.I suspect I might be able to solve this with a custom viewer, but I’m not quite sure where to start. Viewers like clerk/html
and clerk/md
change the presentation of the result, but not the code.
Reading https://book.clerk.vision/#viewers now, perhaps I can use a :transform-fn
.
Was just about to suggest you have a look at https://book.clerk.vision/#presentation and https://book.clerk.vision/#transform
👍 2
to my knowledge that’s one thing we still cannot do in the transform-fn, but it’s been requested in the past
👍 2