Fork me on GitHub

Good morning! I have a question on clerk's viewers. I added:

(clerk/set-viewers! [{:pred #(instance? Path %)
                       :fetch-fn (fn [_ path] {:nextjournal/content-type "image/jpg"
                                               :nextjournal/value (Files/readAllBytes path)})
                       :render-fn (fn [blob] (v/html [:img {:src (v/url-for blob)}]))}])
so that I can use:
(fs/path "./art/sketch-01-001-0001-0558.jpg")
to display an image. But I wonder, why can't I do something like
 `[[1 2] [3 ~(fs/path "./art/sketch-01-001-0001-0558.jpg")]])
to have an image in one of the cells of the table?


hey @meditans, if you can use the git dep of Clerk this now comes with support for images, see There’s also some breaking changes of the viewer api, the render-fn now needs to be quoted to make it more explicit that it doens’t run on the JVM, see As to putting an image inside a table this is something I also want. I’ll try it later, it might require some small tweaks to support this.


thanks! Those examples focus on images from the internet; do I still need something more for local images?


no, ImageIO/read takes all kinds of things, also


or InputStream


amazing! I'll try that right now 🙏


I also plan to cut a release later today

🙂 1
metal 1