This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-09
Channels
- # announcements (4)
- # aws (3)
- # babashka (86)
- # babashka-sci-dev (31)
- # beginners (171)
- # biff (15)
- # calva (3)
- # clerk (47)
- # cljdoc (11)
- # clojure (59)
- # clojure-dev (11)
- # clojure-europe (122)
- # clojure-losangeles (1)
- # clojure-nl (2)
- # clojure-norway (4)
- # clojure-uk (2)
- # clojurescript (40)
- # cursive (5)
- # data-science (3)
- # datahike (1)
- # datomic (5)
- # fulcro (9)
- # graalvm (8)
- # hyperfiddle (17)
- # introduce-yourself (1)
- # java (28)
- # jobs (1)
- # malli (11)
- # membrane (9)
- # missionary (1)
- # nbb (1)
- # off-topic (5)
- # other-languages (1)
- # pedestal (1)
- # re-frame (4)
- # reagent (16)
- # releases (3)
- # remote-jobs (3)
- # shadow-cljs (83)
- # spacemacs (1)
- # sql (5)
- # tools-deps (28)
- # xtdb (15)
Adding execution progress in https://github.com/nextjournal/clerk/pull/429. Feedback welcome if folks get a chance to take it for a spin.
I cannot render any notebook on that branch exec-state
When doing clerk/show!
I get always:
*e
;; => #error {
:cause "Cannot invoke \"clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\" because \"x\" is null"
:via
[{:type java.lang.NullPointerException
:message "Cannot invoke \"clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\" because \"x\" is null"
:at [clojure.core$with_meta__5485 invokeStatic "core.clj" 220]}]
:trace
[[clojure.core$with_meta__5485 invokeStatic "core.clj" 220]
[clojure.core$vary_meta invokeStatic "core.clj" 677]
[clojure.core$vary_meta doInvoke "core.clj" 677]
[clojure.lang.RestFn applyTo "RestFn.java" 142]
[clojure.lang.Atom swap "Atom.java" 79]
[clojure.core$swap_BANG_ invokeStatic "core.clj" 2372]
[clojure.core$swap_BANG_ doInvoke "core.clj" 2362]
[clojure.lang.RestFn invoke "RestFn.java" 497]
[nextjournal.clerk.webserver$set_status_BANG_ invokeStatic "webserver.clj" 192]
[nextjournal.clerk.webserver$set_status_BANG_ invoke "webserver.clj" 191]
[nextjournal.clerk$show_BANG_ invokeStatic "clerk.clj" 37]
[nextjournal.clerk$show_BANG_ invoke "clerk.clj" 22]
[example$eval60102 invokeStatic "NO_SOURCE_FILE" 9]
@U7CAHM72M should be fixed with https://github.com/nextjournal/clerk/pull/429/commits/b2cb2144a89ab0e6c69a25ca5cc2d38f0c5672d9, thanks for trying it!
1. i think this is looking great!
2. I haven't come across any weird behavior / potential bugs
3. really appreciate knowing that "something is actually happening right now". When running slow computations, i've often been wondering if something is actually happening, or if i've done something wrong and made something crash. Clerk feels snappier with this somehow. (or perhaps you've made clerk faster in other ways!)
4. also really appreciate that the execution progress indicator isn't taking up tons of screen estate.
I think I'd appreciate some visual signifier that "the evaluation has come this far in space" as well. I'm looking at the form -- if I can easily see that "clerk is evaluating this form right now", I don't have to break my attention and read a var name / read a form aiming my attention back to the form.
(i tried {:sha "b2cb2144a89ab0e6c69a25ca5cc2d38f0c5672d9"}
)
@U3X7174KS thanks for the feedback, great to hear it feels snappier with this! Indicating the executing cell in the doc will come in a follow-up, currently we only refresh the doc after the evaluation completed so the cell might not be there, yet. But yes, agree that that’ll be good to have, just want to make sure it doesn’t become slower when we do this.
@U5H74UNSF i did stumble over something weird now, still on {:sha "b2cb2144a89ab0e6c69a25ca5cc2d38f0c5672d9"}
:
I expected to see :abc
, not #viewer-eval (keyword ":abc")
.
this looks weird too, expecting
Edit: my fault -- :abc
, not ::abc
.(keyword ":abc")
is indeed ::keyword
!
Am I doing something wrong ? For me it does not work at all:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
(index):420 Uncaught ReferenceError: nextjournal is not defined
at (index):420:515
(anonymous) @ (index):420
I just run it from branch exec-state
via bb dev :browse\? true
and then clerk/show!
the exec_status.clj
notebook
Firefox is more clear on error message:
Loading module from "" was blocked because of a disallowed MIME type ("").
> I just run it from branch exec-state
via bb dev :browse\? true
and then clerk/show!
the exec_status.clj
notebook
I'm not running Clerk from the Clerk repo -- I'm using io.github.nextjournal/clerk {:sha "b2cb2144a89ab0e6c69a25ca5cc2d38f0c5672d9"}
from my https://github.com/teodorlu/lab/blob/a4336c561426947e273359bb9fdb2ba924a496ae/deps.edn#L5-L12. I find that easier.
`:nextjournal.clerk/width` ignored on viewers rendered within Tap Inspector?
I’ve some wide data that I’d like to tap>
to the Tap Inspector
but setting {::clerk/width :full}
on the data’s viewers ( clerk/table
, v/vl
, etc.)
seems to be ignored.
Am I doing it wrong, is it a bug, or does Tap Inspector not support `:nextjournal.clerk/width`? :thinking_face:
@UFJ5R302F thank you!
I've created a horrible helper to turn http://tech.ml/tablecloth datasets into alignable markdown tables. It probably has lots of sharp edges and I bet there is a better way to handle right aligning my numbers in a column. https://gist.github.com/otfrom/3295146a43d03c119da85d51f908a546
other than me completely forgetting about all the wonderful things you've built? No, not really 😄
I'd like to be able to file off the table name (or make it prettier) as this is for delivery to clients
look ma, I'm famous https://github.clerk.garden/otfrom/md-tc-clerk-example/commit/91f0306de4f95f7530610ef5d797b8dfd90da4cf/
@U1EP3BZ3Q should p/dataset->str be wrapped in a println by default?
(defn print-dataset
"Prints dataset into console. For options see
tech.v3.dataset.print/dataset-data->str
"
([ds] (println (p/dataset->str ds)))
([ds options] (println (p/dataset->str ds options))))
@U1EP3BZ3Q now updated to use dataset->str https://github.clerk.garden/otfrom/md-tc-clerk-example/commit/5a658b87eefb3548ca3e61384d4fbddeb7779cff/
which has nicer formatting except for the dataset name and shape (which is good for me but not for clients), but I could take that off by chopping off the first bit of the string
Actually it's produced by TMD. Yeah, remove two first lines by hand, there is no option to skip it.
@U1EP3BZ3Q thx 🙂
@U1EP3BZ3Q is this a bug in tc or is there a reason for the side effect and returning nil here? https://clojurians.slack.com/archives/C035GRLJEP8/p1678380031309319?thread_ts=1678376426.783319&cid=C035GRLJEP8
@U1EP3BZ3Q I'll dig, I think I can actually fix this one. 🙂
@U0525KG62 I was too quick (heading home and it was quick answer without much thinking 😕, my bad, sorry for that ). The idea behind print-dataset
is actual printing 🙂 I though it might return a dataset itself, not a string representation. To get a string you can call tc/dataset->str
which does exactly what you need - a formatted string.
I think we can enhance dataset->str
to have an option of stripping first to line (ie. dataset name and empty line). What do you think?
that all sounds good. I'm easy either way on the stripping off of the dataset name as it is easy enough to do
I've only just noticed that the markdown tables here are in a serif font. Is that expected? https://github.clerk.garden/otfrom/md-tc-clerk-example/commit/3659b98c0347bc172ec4b2368122e792b0958e96/
Hi @U0525KG62 if markdown is intended for prose, maybe. But you can provide your own style. The source of this notebook shows how to customise markdown rendering https://snapshots.nextjournal.com/clerk/build/2356ac2e3a2f1063b65e84ef8019595d7bda2557/index.html#/notebooks/viewers/custom_markdown.clj
clerk/table
could be more suited for the job of transforming data and strings are rendered sans by default https://snapshots.nextjournal.com/clerk/build/2356ac2e3a2f1063b65e84ef8019595d7bda2557/index.html#/notebooks/viewers/table.clj
Where can I find out more about add-child-viewers that looks like it might solve some alignment and formatting problems for me
> looks like it might solve some alignment and formatting problems You might have a look at Clerk default markdown viewers https://github.com/nextjournal/clerk/blob/2356ac2e3a2f1063b65e84ef8019595d7bda2557/src/nextjournal/clerk/viewer.cljc#L662-L731 and override them (by name) in the style of https://github.com/nextjournal/clerk/blob/2356ac2e3a2f1063b65e84ef8019595d7bda2557/notebooks/viewers/custom_markdown.clj#L18-L25
> add-child-viewers is mentioned in the book:tm: in the context of tables, but it’s the same principle https://book.clerk.vision/#transform