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.
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
Thanks again for Clerk 🙂
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))))})I guess you could hack the table viewer to adjust that in a transform-fn