Fork me on GitHub
#nbb
<
2023-01-28
>
Marcelo Fernandes00:01:02

[SOLVED] I'm trying nbb for the first time and getting this error when trying to use markdown-clj. I created https://github.com/marceloschreiber/nbb-markdown that reproduces the issue. Am I missing something?

Chris McCormick03:01:29

Are you using npm install markdown-clj to install it? If so you may need to add it to your classpath manually.

Chris McCormick03:01:37

Oh never mind, I just looked at your repro, sorry.

borkdude08:01:24

I’ll have a look at the repro but for nbb it might be better to use commonmark from npm implemented in JS

borkdude08:01:41

Or any other popular JS markdown lib

borkdude10:01:15

It seems that in CLJS only the md-to-html-string*` var exists: (prn (md/md-to-html-string* "#Hello")) works. See https://github.com/yogthos/markdown-clj/blob/288a19b983b06fa1b12a99f0773956e420f998e4/src/cljs/markdown/core.cljs#L42

👀 2
borkdude10:01:54

still I think using an npm markdown library is better for nbb since it's more performant to use

Marcelo Fernandes13:01:25

thanks @U04V15CAJ! Good to know about the performance difference. Not something that I care for now. Is it common for libraries to have different var names between clj and cljs? I expected them to be the same and I'm curious if there is a reason for them not to be.

borkdude13:01:50

It's not that common, it may just be an oversight in that lib

borkdude13:01:33

performance but also startup time: processing cljs code at startup vs reading a JS lib (which may or not be faster)

Marcelo Fernandes13:01:55

I saw that the README has two sections: Usage Clojure and Usage ClojureScript. But I totally skipped reading the heading name 🙂

👍 2
borkdude13:01:09

300 people in this channel, 🎉

💯 8
3️⃣ 6
lispyclouds11:01:20

nothing to see here @jmglov