Fork me on GitHub
#babashka
<
2023-12-05
>
ccfontes02:12:01

I want to create an HTML5 document, which I'd usually do using hiccup.page/html5 . Thought it was supported with: https://github.com/babashka/babashka/issues/1391, but I'm getting:

^--- Could not locate hiccup/page.bb, hiccup/page.clj or hiccup/page.cljc on classpath.
      [hiccup.page :refer [html5]]))
Any plan on supporting this? Thanks.

ccfontes02:12:47

maybe never mind, doesn't add that much code to:

(->> hiccup html (str "\n"))

Bob B04:12:21

Judging by the PR, it looks like the vars were added so that hiccup.page can be loaded from source (so adding hiccup as a dependency):

$ bb -Sdeps '{:deps {hiccup/hiccup {:mvn/version "2.0.0-RC2"}}}'
user=> (require '[hiccup.page :refer [html5]])   
nil
user=> (html5 "abc")
"\n<html>abc</html>"

👀 1
👍 1
richiardiandrea20:12:00

Hi all! Just found out about - I like the idea, any known drawback? Is anybody using it currently?

borkdude21:12:08

I recommend it for projects that want to get the best performance in bb but still want to use clojure.data.json as a dependency outside of bb or so

borkdude21:12:28

the only drawback is that it supports a common ground of all the implementations, so no specifics of any implementation

richiardiandrea21:12:14

Ok thanks! I actually just tried in one of ours "cross-platform" projects and it works like a charm (added cheshire and excluded data.json) - thank you!

d._.b23:12:14

creature comfort question: when i build a script in bb i will often have the entry point as like (exit (do-the-script)) or whatever

d._.b23:12:32

is there a way to define an entrypoint that would make full buffer evaluation not kill the repl, something like -main?

borkdude23:12:51

bb also supports -main via bb -m, any function really there is also bb -x