Fork me on GitHub
#babashka
<
2021-06-30
>
borkdude08:06:10

babashka + org-mode literate programming: https://github.com/babashka/babashka/discussions/907

👏 5
mmz10:06:27

Not sure if I'm solving a different problem here, but this is my config for literate programming clojure in .org files:

#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
  'org-babel-load-languages
    '((emacs-lisp . t)
      (shell . t)
      (clojure . t)))
#+END_SRC

Don't ask before evaluating code blocks.

#+BEGIN_SRC emacs-lisp
(setq org-confirm-babel-evaluate nil)
#+END_SRC

#+BEGIN_SRC emacs-lisp
(message "%s" "Start loading ob-clojure")
(use-package ob-clojure
  :init
  (setq org-babel-clojure-backend 'cider))
#+END_SRC
First start a bb --nrepl-server on the cmdline, then connect with cider-connect and now you can evaluate the #+BEGIN_SRC clojure clojure blocks in your .org file. The nrepl-server will retain state over different code blocks.

👍 2
borkdude10:06:40

That's also possible. Then CIDER will just abstract away the Clojure implementation for you I guess.

mmz10:06:04

didn't run into differences (yet) 😅

borkdude10:06:48

Perhaps post this as feedback to the show and tell discussion

2
borkdude10:06:55

it might be useful for future reference

heow13:06:50

Just when you think Babashka has it all, it gets even better!

Cora (she/her)18:06:24

me, searching twitter for clojure news to include in our newsletter, finding endless love and updates for babashka: I can't just make it all about babashka... can I? 😂

❤️ 2
borkdude18:06:00

That's up to you :)

2