This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-08
Channels
- # announcements (1)
- # babashka (28)
- # beginners (13)
- # calva (10)
- # clerk (18)
- # clj-on-windows (39)
- # clj-otel (1)
- # cljdoc (17)
- # clojars (12)
- # clojure (40)
- # clojure-austin (11)
- # clojure-brasil (1)
- # clojure-europe (23)
- # clojure-nl (3)
- # clojure-norway (16)
- # clojure-uk (2)
- # clojurescript (28)
- # clr (4)
- # conjure (1)
- # emacs (14)
- # hoplon (6)
- # hyperfiddle (59)
- # interop (2)
- # leiningen (1)
- # off-topic (37)
- # pathom (1)
- # polylith (5)
- # portal (7)
- # reagent (9)
- # releases (3)
- # shadow-cljs (22)
- # spacemacs (6)
- # tools-build (12)
- # tools-deps (51)
- # web-security (6)
- # xtdb (7)
how can I get a clerk result being a long string to word wrap in browser?
use a custom string-viewer without pagination (no :page-size
attr and wrap it in a hiccup element that does the wrapping
This Wednesday at https://everytimezone.com/s/a80340ff @jacek.schae and I are running a https://clojure.stream/workshops/clerk. Looks like we’ll be a nice small group so we should be able to work directly with folks and go deep. There’s still time to sign up.
I was wondering if there is a way to parameterize a notebook when building it? This would be useful for example having a notebook training an ML model, where key parameters like identity of the dataset, model hyperparameters, etc are different each time but you want to have a consistent rendered html summary of the modeling run. An example of this for jupyter is https://github.com/nteract/papermill. Maybe this could be supported with some metadata associated with certain vars in the notebook, which could then be overriden when calling build!
?
You could do it with a dynamic variable in your notebook’s namespace
I think??
right that makes sense, or maybe the dynamic variable should actually be defined outside the namespace? so then you would do something like (binding [config/model :linregression ...] (clerk/build! {:paths ["notebooks/model_train.clj"]} ...))
. or do I misunderstand how binding can be used?
That would work if model_train depends on config. This should be straightforward to test out and if it doesn’t work we should make it work
yeah dynamic binding should work, we use this in https://github.com/nextjournal/clerk/blob/a60cda1e4a7a8b8bfdb96b5c13756b2342644997/src/nextjournal/clerk/builder.clj#L324
would also recommend to the the value to an atom or something that implements IDeref, to get value semantics so things work well with clerk’s caching
I can now declare charts-as-values, and everything plays well with clerk/col
and clerk/row
…
@sritchie09 so good! Will you be generating the clojure wrapper api or write it by hand?
I think I am going to write it by hand at first since I want to be careful about the signatures here. Like in mathbox some of the components need to generate an output array, and then write to that and have a custom emit call into mathbox
but I bet I’ll learn how to make the compile interface better from that experience, and maybe I’ll be able to automate a future pass
@U5H74UNSF you could imagine also a final step where we do as you had suggested, and process the viewer to lift all of the reagent/with-let
entries up to a single with-let
at the top
@U5H74UNSF you could almost have a mafs-clerk
jvm library, but without Emmy you can’t pass functions, so you’d have to provide quoted function bodies. which is a deal-breaker imo