How would I require a clojure namespace into an org block? I have been searching through google and asking chatgpt and found nothing, i can't imagine this is a rare thing, if it is, what do people do? Just not do literate programming 🙂 use clerk?
@ag was working on a similar problem not too long ago, I can't find the thread now, though
im guessing this is ags work here: https://github.com/ag91/ob-clojure-literate-extras im using figwheel, but what he has done is a great place to start.
You could use :session to get a backed REPL that should let you include things if the babel backend supports sessions
What would the value of session be?
Hmm, i guess do this in reverse typically, they tangle all the files from their org file into other files. maybe thats why this talked about as much? I guess in my case maybe clerk a bit better? everything feels like a distraction.
The value is the name of the session you want, which maps to the buffer name of the REPL https://orgmode.org/worg/org-contrib/babel/intro.html#org2da6b65 Clerk is maybe better depending on what you're trying to do
I'm guessing i still dont' know how to supply the session correctly. Here is a picture of emacs where the top window is the clojure namespace i want to import (ns core) then the next window down is what i believe to be the 'repl buffer'. if i run 'copy-buffer-name' I get cider-repl clojure/play:localhost:38299(clj) Which is what i pass to :session in the third block and the result of running that block is a class exception.
why is session set to demo?
Because it's a demo 😛
You can have as many sessions as you want in a document
oh, you defined hello in the block above. I thought you were requiring it from a clojure namespace defined in a clj file, thats what i'm trying to do.
there is a clojure deps.edn project, with the accompanying src dir that has .clj files, i want to require them into my org file and run them. Which is why my picture has (require 'core)
sigh, its me. i wrapped the foo in parens.
lol
You also didn't include a picture 😛 also worth looking at the manual https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
that manual is a bit odd, it links to a github repo that is a 404. I was worried it was out-of-date.
ill take a closer look though, i appreciate the help @elken!!!!
Nah worg is as up to date as the docs can be, everything is hosted on Savannah. If you spot anything wrong please do let them know 🙂
ah, thats a different site then i thought at first, i was thinking of this link: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure-literate.html the release history at the bottom has a link results in a 404 for a project i couldn't find.
Ah yeah looks like they deleted their repo without updating the link. Worth letting the org folks know 😄
I'll try to -_-. I got it to work with clojure. 🎆 any idea if the whole org to clojurescript with figwheel will work too? I want to try org-moding all the things and see if that helps.
Different Ag. I'm the original one with no numbers attached. With all the flaws still intact. That one is a ninety-first attempt to improve upon :)
This is the thread mentioned earlier https://clojurians.slack.com/archives/C099W16KZ/p1734629348782949?thread_ts=1734629348.782949&cid=C099W16KZ I'm not sure if it is still relevant for what you're looking for.