This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-31
Channels
- # announcements (6)
- # babashka (40)
- # beginners (6)
- # calva (1)
- # cider (1)
- # clerk (43)
- # clj-kondo (3)
- # clojure (93)
- # clojure-denver (8)
- # clojure-europe (52)
- # clojure-norway (20)
- # clojure-sweden (7)
- # community-development (5)
- # datascript (15)
- # datomic (30)
- # emacs (24)
- # events (15)
- # fulcro (23)
- # graalvm (12)
- # gratitude (1)
- # helix (4)
- # honeysql (4)
- # hoplon (39)
- # hyperfiddle (7)
- # introduce-yourself (1)
- # jobs (1)
- # jobs-discuss (26)
- # lambdaisland (3)
- # lsp (6)
- # matcher-combinators (2)
- # matrix (5)
- # meander (39)
- # nrepl (4)
- # nyc (1)
- # off-topic (5)
- # portal (73)
- # practicalli (1)
- # re-frame (2)
- # reitit (22)
- # releases (1)
- # remote-jobs (4)
- # shadow-cljs (5)
- # sql (17)
- # testing (1)
- # tools-deps (15)
I've seen the option for tailwind & compiling css from markup, but how do I add an external stylesheet to my notebook?
Here is one way : https://clerk-utils.mentat.org/#css-functions
You could use that, or see the source and use the same trick directly
if you want more, chime in on https://github.com/nextjournal/clerk/issues/323 but I’m not not sure special handling is currently worth it
not yet but we ran into this recently and started working on it https://github.com/nextjournal/clerk/pull/481
Hi! I really like this introduction to Clojure: https://learnxinyminutes.com/docs/clojure/ Does anyone happen to have a Clerk version?
Yeah, it shouldn't be too much work!
Perhaps the text could be easier to read with markdown. Perhaps there's a use case for (clerk/example ,,,)
too.
I converted most of the document -- https://github.com/iterate/literate/tree/7cf5c22f88f3b5648ef9c2a59d0b76892c28d997/brevdueklubben/src/learnclojure.clj / https://brevdueklubben.literate.app.iterate.no/src/learnclojure.html. But as I was reading through the document, I was thinking that it might be possible to write a better introduction to Clojure than that guide. I'd probably tone down types (first section name) and java, to focus on functions and data.
I am trying to get set up with clerk-utils
and am encountering an error when I try to connect a cljs repl. This is a new project initialized with the project template, and I am launching the REPL by using bb clerk-watch
. When I use cider-connect-cljs
, I can connect (I'm using node
as the REPL type), but shortly after the REPL connection is established, I get the following error:
clojure.lang.ExceptionInfo: shadow-cljs nREPL initialization failure!
Your nREPL client sent a wrong parameter. A keyword specifying the build-id is expected.
Instead got a #cljs.repl.node.NodeEnv{:host "localhost", :port 52125, :path nil, :socket #atom[nil 0x7c28fd0], :proc #atom[nil 0x7bd05109], :state #atom[{:listeners 0} 0x5a1b1c7f], :debug-port nil}
{}
at shadow.cljs.devtools.server.nrepl$shadow_cljs_repl.invokeStatic (nrepl.clj:33)
I'm not sure if if this will interfere with my ability to do repl-driven cljs development for custom Clerk viewers, but I figured it was worth raising here.https://github.com/mentat-collective/Clerk-Utils/blob/1e0c4473073cadb35f938c6cea5dceeb3f5f95bd/.dir-locals.el#L3
It wasn't clear from the docs which REPL I should use. I assumed shadow
at first because that's the REPL type mentioned by the console output, but also encountered an error with it. So, I looked at the clerk-utils
repo for guidance and chose node
based on that.
Specifying browser
as the REPL type also returns an error:
clojure.lang.ExceptionInfo: shadow-cljs nREPL initialization failure!
Your nREPL client sent a wrong parameter. A keyword specifying the build-id is expected.
Instead got a #cljs.repl.browser.BrowserEnv{:es #object[java.util.concurrent.ThreadPoolExecutor 0x62b11b08 "java.util.concurrent.ThreadPoolExecutor@62b11b08[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]"], :browser-state #atom[{:return-value-fn nil, :client-js nil} 0x29817a41], :working-dir ".repl-1.11.60", :preloaded-libs [], :launch-browser true, :static-dir ["." "out/"], :src "src/", :port 9000, :ordering #agent[{:status :ready, :val {:expecting nil, :fns {}}} 0x1ab1e6dc], :host "localhost", :server-state #atom[{:socket nil, :listeners 0} 0x4c2122df]}
{}
huh, this is almost certainly a bug with my setup since I haven’t done cljs development in a Clerk project…
I can look at this later today!
thanks @U017QJZ9M7W! I'm a little surprised to hear that you "haven’t done cljs development in a Clerk project" - does that mean that emmy
and mafs
weren't done using cljs (rather instead just using sci
)?
I guess the XY problem for me here is "how do I get a REPL + tooling that shows me docstrings & information about JS libraries I'm using to write custom Clerk viewers?", and if I can do that without a cljs
REPL, that's enough.
I did Emmy with a proper cljs repl, tests, etc, but for the Mafs.cljs and friends I was using Clerk as my viewer, and didn’t need to do any REPL interaction — so most likely there is some small setting error that we can get past once I get some time to fix it up
Oh I bet the issue is that I don’t put any shadow file in the template by default, as I was trying to hide all of that from the user. That is probably the wrong decision for someone adding their own custom closure, script, code, so maybe we need to generate a shadow file…
An empty (`{}`) shadow-cljs.edn
file fixes the issue, but I have one lingering question: should I be connecting to a browser repl or a node repl?
I just introduced some non non-Clojure programmer colleagues to Clojure with Clerk. We spent an hour with an editor and a Clerk instance on a big screen. Clerk made it so much easier to talk about what was happening. See the form, see what it evaluates to. It felt great to get questions and be able to show the answer. ❤️
I've been slowly stealing some over too 🙂 @U058DHAN3UP may have been wooed by it too
Yeah I'm having fun with it lately. It's like org-babel
on steroids and it "just works".
when I add {:nextjournal.clerk/visibility {:code :hide :result :show}}
as metadata to a form, which I think is what https://book.clerk.vision/#visibility says to do, I get an error
Execution error (ExceptionInfo) at nextjournal.clerk.parser/->visibility (parser.clj:23).
Invalid `:nextjournal.clerk/visibility`, valid values are `#{:hide-ns :fold-ns :hide :show :fold}`.
[io.github.nextjournal/clerk "0.13.842"]
is the latest on maven or io.github.nextjournal/clerk {:git/sha "1f6c5331418aaf9c5a4335fc2e6e95f07dc3af6b"}
for tools.deps