Fork me on GitHub
#clerk
<
2024-07-01
>
teodorlu09:07:10

Having a great time poking around in clojure.core.async with Clerk. Nice to be able to collect multiple examples at once, and see whether they behave as I expect them to do. Clerk’s caching is helpful; it lets me collect lots of examples that each take a bit of time to run — yet make changes to one, see that one changed, and the previous results from the other runs.

🖤 1
teodorlu09:07:02

I may have anountered a visual problem here, {:duration-millis appears to be cut of from the last result. I made an issue with a reproduction: https://github.com/nextjournal/clerk/issues/652

mkvlr09:07:47

@U3X7174KS thanks for sharing and making a repro!

❤️ 1
teodorlu09:07:27

Thanks again for Clerk 🙂

teodorlu11:07:50

Is there a way to write a Clerk viewer that “signals” to the Clerk table viewer that a column values should be right-adjusted? I want to display durations right-adjusted in tables, and I’ve got a tiny Clerk viewer that shows a java.time.Duration. But it renders left-adjusted. As far as I can tell, this is controlled by a number-col? option in the table viewer (https://github.com/teodorlu/clerk/blob/9eaf4d8478064d745659b674b1a1037a9aa16f54/src/nextjournal/clerk/viewer.cljc#L1081-L1084). (Let me know if I’m approaching this in an awkward way.)

(def duration-ms-viewer-wip
  {:transform-fn (nextjournal.clerk.viewer/update-val
                  (fn [duration]
                    (format "%,3d ms" (.toMillis duration))))})

Andrea12:07:32

I think you’re on the right path

👍 1
Andrea12:07:52

I guess you could hack the table viewer to adjust that in a transform-fn

👍 1