Fork me on GitHub
#clerk
<
2023-05-18
>
sh5409:05:15

@sritchie09 So the new template does not seem to fix the fundamental issue which is that the shadow-cljs build needs ns nextjournal.clerk.static-app. To reproduce all via the terminal (I did a clean run of all this just now):

clojure -Sdeps '{:deps {io.github.mentat-collective/clerk-utils {:git/sha "40e7c7bd358c95d1cc96d76eb6ae5099868e500f"}}}' \
-Tnew create \
:template clerk-utils/custom \
:name myusername/notebook-test-alpha

cd notebook-test-alpha
bb clerk-watch
Then the noteworthy output is
[:mentat.clerk-utils.build.shadow/clerk] Configuring build.
[:mentat.clerk-utils.build.shadow/clerk] Compiling ...
[:mentat.clerk-utils.build.shadow/clerk] Build failure:
The required namespace "nextjournal.clerk.static-app" is not available.
It will still open a page in the browser but main.js will 404 and the page just renders blank. So the following workaround fixed this issue. I just copy/pasted the last available static_app.cljs file to somewhere on the path, then also adding the dep metosin/reitit-frontend {:mvn/version "0.7.0-alpha4"} to make the shadow-cljs build happy. Then everything works as it should. I can just register all this as an issue on github if that is more appropriate.

Sam Ritchie11:05:40

Whoops, thank you for the report! I did fix the issue in the SHA you mention… but I had made a mistake while upgrading the sha that gets baked into the template. so this clerk-utils version fixes things:

40e7c7bd358c95d1cc96d76eb6ae5099868e500f
but to use the template, you’ll need the next commit:
1e0c4473073cadb35f938c6cea5dceeb3f5f95bd
Here is the working command:
clojure -Sdeps '{:deps {io.github.mentat-collective/clerk-utils {:git/sha "1e0c4473073cadb35f938c6cea5dceeb3f5f95bd"}}}' \
-Tnew create \
:template clerk-utils/custom \
:name myusername/notebook-test-alpha

cd notebook-test-alpha
bb clerk-watch
Alternatively you can go into deps.edn of your previously generated project and change your clerk-utils dependency to
40e7c7bd358c95d1cc96d76eb6ae5099868e500f

Sam Ritchie11:05:50

@U01TNUH7BB6 sorry for the trouble here!

sh5409:05:47

You said the command was working on your machine so 🤷

sheluchin14:05:29

Has anyone gotten a backlinks feature working in a notebook? i.e. something to show a list of all the other notebooks which link to the current one.

respatialized18:05:32

I'm encountering some rough edges when trying to get JS interop working enough to reproduce this geospatial visualization from https://observablehq.com/@observablehq/plot-earthquake-globe?intent=fork in Clerk, adapting the module import example from Clerk. Some pointers would be appreciated! I created a gist with what I have so far: https://gist.github.com/respatialized/1350da45a3965e4392538d0e31b13e9f it appears to (somewhat) work, though the x & y values of the data plotted are all at dead center and the landmasses aren't visible either (there are empty <path> objects in the SVG output). is this an issue with the way I've added the data to the plot? I'm pretty inexperienced with ClojureScript in general so I'm sure my way of doing this may be wrong in some ways I'm not aware of.

respatialized20:05:23

I've narrowed my issue down to conversion from topojson to geojson - directly importing a geojson file produces a map that looks like I expect it to. nextjournal.clerk.render/with-dynamic-import seems to only allow importing one module at a time, so I'm wondering how to add the topojson module to my viewer so I can be sure the conversion is working correctly. do I nest the calls to with-dynamic-import? it's a little hard to parse what https://github.com/nextjournal/clerk/blob/069f4ae120d71e2eb33c5af62ab691f15687a564/notebooks/js_import.clj#L7 is doing, because the function with-dynamic-import doesn't appear to be directly called by the viewer - it's just the first element in a vector that gets passed up to the final viewer, which I assume is doing the actual calling of that function.