Fork me on GitHub
#babashka
<
2023-01-12
>
Filipe Silva18:01:36

heya @borkdude, just wanted to ping you that I was adding https://github.com/filipesilva/obsidian-babashka to the obsidian community list.

4
🎉 10
escherize18:01:43

Great work! This will be very handy to me personally. Thank you

Filipe Silva19:01:16

Curious what do you have in mind to do :D

borkdude19:01:40

Cool stuff :)

❤️ 4
escherize19:01:48

habit tracking, basically

Filipe Silva19:01:08

So parsing files, processing them a bit, then writing a report back somewhere?

👍 2
escherize19:01:09

Obsidian is surprisingly flexible: The coolest thing I have setup so far is using an nfc tag + my phone to check off a habit checkbox in my daily note, for e.g. vitamins. (using obsidian advanced urls, i think it’s called?)

clojure-spin 2
Filipe Silva19:01:27

Oh that is such a cool use of those urls

🙏 2
jeroenvandijk20:01:59

Thanks for sharing @UJVKWJTGE! Looks really cool. A side question, what tool do you use for those animated gifs? Looks neat.

☝️ 2
Filipe Silva21:01:25

Shift cmd 5 to record, ctrl shift esc, to stop, then gifski to convert to gif

👍 2
jeroenvandijk21:01:10

Ah great, thank you!

Kees23:01:59

Amazing!! I just rolled my own small bb equivalent to borkdude/quickblog where I can write MD directly in obsidian and publish with tasks. This really closes the loop lol

👏 6
borkdude08:01:56

@U03M9DG0VKN It would be awesome to read a blog post about that :)

😊 2
Filipe Silva09:01:25

here’s the submission for anyone that’s waiting for it to be available https://github.com/obsidianmd/obsidian-releases/pull/1534

Kees18:01:40

@borkdude Ok, only if I can take a look at your repo to poach the code for generating the xml feed 😏 I always appreciate your work!

grazfather19:01:32

that is pretty cool!

Filipe Silva22:01:33

FYI I released 1.0.3 with support for starting a babashka nREPL and connecting to it

🎉 4
Filipe Silva22:01:12

it’s still waiting to be merged to the obsidian community plugin list though, but it’s up

Filipe Silva22:01:47

@U03M9DG0VKN can I ask you to try it? you seemed to be comfortable installing plugins from the source

Kees02:01:57

Sure! I'll msg back when I do

Kees04:01:50

Ok, did my best with cursory stress testing. All the basic functionalities of a persisting repl work, splendidly. Setting and switching namespaces, defs, functions, requires, all flawless and across notes! Cool. This is very much an instant notebook These two bumps hold for both clj and cljs– I orphaned the nrepl process a few times, in two ways. (By accident at first.) Neither quitting and restarting obsidian, nor doing a hard refresh (f12) shut down the repl. The kill command says it succeeds, attempting to reconnect silently fails, and repl-dependent code doesn’t eval. Only in the verbose level electron logs did it say the address is occupied. Killing the process from a shell allows you to start over as expected, but it’s opaque what happened without digging. Not sure how to address that as quitting the app/“force reload” might be outside the scope of plugins? Otherwise I assume the kill code could just run on shutdown. 2, a simpler bug, if I eval broken code, the error popup shows properly, then no subsequent stdout prints to file until killed and restarted. It looks like printOutput receives nothing when given bad code, instead of a string, and passes that to capCharsAt, then whatever else breaks down the line.

❤️ 2
Kees04:01:10

My special knack for breaking things

Kees04:01:11

Overall, this is great and worked very intuitively until I ran up against some forced but realistic corner cases

Kees04:01:14

And last thought, but lmk if I should check out more things, obsidian Execute Code plugin has a nice customizable timeout feature to preempt hanging. Here I could wait til the cows come home on the (range)

Filipe Silva09:01:55

regarding the timeout, I think that could be configurable

Filipe Silva09:01:06

other options include using the nrepl interrupt feature

Filipe Silva09:01:19

or just killing the process (and losing the repl state)

Filipe Silva09:01:55

I didn’t quite know what would be the more natural usecases so didn’t want to think too much about it

borkdude09:01:50

(range) can be "fixed" with *print-length*

Filipe Silva09:01:41

regarding the orphaned process… I saw that myself, and I thought I covered all the kill cases but obviously not

Filipe Silva09:01:53

I don’t have a repro for it to find the bad situations

Filipe Silva09:01:10

hoping to find it with use

😊 2
Filipe Silva09:01:10

regarding that bad code, can you give me and example? that way I can investigate

Kees04:01:43

Have been away, patience appreciated.."broken code" I just meant anything throwing exceptions, e.g undefined symbols. Example I can repro ATM, start repl and evaluate these in sequence

(+ 5 10)

;; 15
(nothing)
(exception printed to stderr notif)
(+ 10 10)
Nothing prints when evaluated

borkdude11:01:56

@UJVKWJTGE As a heads up, in 1.1.171 (the next version) babashka will no longer automatically print results, except when executing with -e Can you test your obsidian plugin with the current dev build, which already has this change?

bash <(curl ) --dev-build --dir ~/dev/babashka

borkdude12:01:31

You can restore the old behavior with bb --prn ...

Filipe Silva14:01:13

@U03M9DG0VKN I opened issues on the repo from your notes, thank you 🙏

✌️ 2
Filipe Silva14:01:49

@borkdude I always run bb -e for eval, so I think it won’t make a difference to me

Filipe Silva14:01:15

I’d like to ask you though, what do you think the output should be?

Filipe Silva14:01:13

ATM what happens is: • stdout is printed to the codeblock as a comment • followed by value • stderr is printed as a notification This happens for both repl and -e

Filipe Silva14:01:02

repl output messages contain the distinction between stdout msgs and value messages so I could put them in separate places… but I’m not sure if that’d be more useful to users?

Filipe Silva19:02:22

https://obsidian.md/plugins?search=babashka it’s now released in the official plugin list!

🎉 6