Fork me on GitHub
#clerk
<
2024-05-27
>
Casey08:05:39

I'd like to create Clerk notebooks with embedded, interactive Quil sketches (and develop them live). I was somewhat surprised to see that I couldn't find any prior art here. Is this even possible given the current state of clerk's cljs support via cherry?

jackrusher09:05:18

Clerk’s cljs support is via SCI. I don’t know of anyone who has loaded CLJS Quil on the browser side, but it should be doable. 🙂

Casey09:05:03

I just wrote a little p5-viewer for clerk that uses nextjournal.clerk.render/with-dynamic-import to load the p5.js library. That works, which is a nice step, but of course I'd much rather write quil code than p5.js code. I suppose I need to produce a .js artifact of quil somehow.

Casey09:05:48

Or load quil's cljs with eval-cljs, maybe that will work

mkvlr11:05:19

or use quil on the JVM?

Casey11:05:22

I'd like to be able to publish static clerk notebooks to the web with embedded and interactive quil sketches, so JVM quil won't work.

👍 1
jackrusher11:05:35

For quil on the JVM, you can target SVG and emit to Clerk pretty easily. The downside is with interactivity/animation.

Casey11:05:54

🎉

🙌 2
❤️ 1
Casey10:05:34

For those in the future wondering how to make quil work with clerk, you can see how I got this working at https://github.com/Ramblurr/nature-of-code

🖤 2
mkvlr10:05:53

very cool, thanks for sharing! We should add this to the book of clerk.

💯 1
dobladez22:05:03

Is there a reliable way to link to another ns (notebook) from Clojure markdown comments? and hiccup?. I tried a few options, some work on v0.15.957 but none on the latest commit on master (some do work on dev mode, but not on static builds). Thanks!