off-topic

borkdude 2026-03-02T17:28:02.615499Z

wt...

user=> clojure.java.javadoc/*feeling-lucky*
true

😂 14
🤣 5
neumann 2026-03-17T06:40:12.988339Z

It's so fun to see where this thread went. So cool!!

teodorlu 2026-03-02T17:37:52.340589Z

What I wonder is how you managed to stumble across this???

Alex Miller (Clojure team) 2026-03-02T17:44:59.528609Z

he's just lucky

🍀 4
☝️ 2
1
2
Alex Miller (Clojure team) 2026-03-02T17:46:11.650959Z

as part of https://clojure.atlassian.net/browse/CLJ-2920 we're planning to deprecate that stuff (since it hasn't worked in years, and is probably a bad idea anyways)

Alex Miller (Clojure team) 2026-03-02T17:48:23.614419Z

the idea here way back was to let you look up any javadoc - if it wasn't supported by our built-in mappings / JDK (also perennially out of date), it would do a google search with the "feeling lucky" flag set, which used to just redirect you to the first result automatically.

borkdude 2026-03-02T18:51:57.581319Z

But in all seriousness... I was going to implement this for bb's REPL, CLJ-2920 is nice info to have, thanks

Alex Miller (Clojure team) 2026-03-02T18:55:58.125369Z

have you looked at leveraging https://github.com/clojure/java.doc?

borkdude 2026-03-02T18:57:13.050239Z

I took a quick glance but it has too many deps or the deps overlap with bb in an inefficient manner (e.g. flexmark vs bb's nextjournal.markdown which is based on commonmark), so I'd probably have to port it

borkdude 2026-03-02T18:57:46.282879Z

I haven't actually tried it. Let me check what it does...

borkdude 2026-03-02T18:59:42.303009Z

it spits out a mix of markdown and HTML in the REPL, why?

Here are some more examples of how strings can be used:
>
> 
> System.out.println("abc"); > String cde = "cde"; > System.out.println("abc" + cde); > String c = "abc".substring(2, 3); > String d = cde.substring(1, 2); >
<br />

borkdude 2026-03-02T19:05:42.210379Z

For REPL usage it could be nice if it printed ANSI codes to make things more readable, unless that's not the idea

borkdude 2026-03-02T19:06:07.773339Z

or perhaps spit out the HTML page to read in a browser

borkdude 2026-03-02T19:06:13.862269Z

which javadoc already does I guess

borkdude 2026-03-02T19:07:40.297169Z

Perhaps clojure/java.doc could get rid of the heavy tools.deps dependency since it only inspects the (current-basis) which is already available via a System property?

borkdude 2026-03-02T19:10:54.717249Z

FWIW I've never even used clojure.java.javadoc that much, I usually find the class via a search engine, but I should use it more. I just bumped into this because my bb REPL accidentally said it supported javadoc since I copied some text from lein

Alex Miller (Clojure team) 2026-03-02T19:18:53.565289Z

yeah, java.doc is taking a different approach (trying to display text-ish info in your repl) than core's clojure.java.javdoc (trying to open the javadoc in a browser)

Alex Miller (Clojure team) 2026-03-02T19:20:02.183419Z

for me, going to a browser breaks flow, so trying to avoid that. clojure.java.doc is invokable as a tool (so that the deps don't pollute your repl), in case that approach is of interest to you. may not be good solution depending on your constraints

borkdude 2026-03-02T19:20:45.987679Z

I think if people would like it in bb I could re-build it using deps I already have in bb, else it would be a heavy addition

borkdude 2026-03-02T19:22:02.745969Z

if we could drop tools.build and flexmark, solely relying on Jsoup to parse HTML and produce some markdown, then it would work in bb from source

borkdude 2026-03-02T19:23:07.276739Z

sorry I meant tools.deps

Alex Miller (Clojure team) 2026-03-02T19:23:09.479789Z

tools.deps (I assume you meant that) is doing the work to figure out where to download javadocs jars from maven, not sure how much of that you need.

borkdude 2026-03-02T19:23:30.944199Z

ah I see

borkdude 2026-03-02T19:24:07.760929Z

it's a nice idea, I'm sure I can work something out in bb to replicate the behavior if people ask for it

borkdude 2026-03-02T19:25:13.672769Z

since bb now has jline it might be nice to make the output more TUI like if used in a console

neumann 2026-03-13T18:49:19.075379Z

For what it's worth, the new-ish "r11y" extracts out Markdown from HTML using only Clojure and Jsoup. It's packaged as a whole application. Perhaps the conversion part could get factored out. https://github.com/dazld/r11y

borkdude 2026-03-13T18:56:47.599479Z

nice it also works with babashka if I stub out the clojure.data.json function using cheshire.

$ bb -Sdeps '{:deps {io.github.dazld/r11y {:git/sha "1f3b1e80c0304807f0f76837f6e5c0882c14e1bd"}}}' \
    -e '
  (require (quote [cheshire.core :as cheshire]))
  (intern (create-ns (quote clojure.data.json)) (quote read-str) (fn [s & {:keys [key-fn]}] (cheshire/parse-string s key-fn)))
  (require (quote [r11y.lib.html :as html]))
  (println (html/extract-content-from-url "" :format :markdown))
  '

borkdude 2026-03-13T18:57:33.144909Z

cc @dazld

👋 1
dazld 2026-03-14T09:43:42.219619Z

hah, neat, I hadn’t tried that, it’d be nice to see it being used like this. idea was to keep deps as low as possible on r11y (= readability), but not against swapping in cheshire so it would just work. @ericdallo mentioned that using hato instead of http-kit would facilitate usage in #eca - was going to take a look at that this week, but maybe there’s a simple way to clean up both use cases without complicating matters.

borkdude 2026-03-14T09:53:27.748749Z

Reader conditionals or macro would work for bb changes. ECA could also switch to bb.http-client ;p

borkdude 2026-03-14T09:54:16.919449Z

And or isolate the platform changes for bb in a .bb file also works

👍 1
borkdude 2026-03-14T09:54:40.038969Z

So make a http://json.bb and json.clj file

borkdude 2026-03-14T09:54:49.037349Z

And maybe also an http one

dazld 2026-03-14T11:04:18.456709Z

bb -Sdeps '{:deps {io.github.dazld/r11y {:git/tag "v1.0.3" :git/sha "472011c"}}}' \
  -e '(require (quote [r11y.lib.html :as html]))
      (println (html/extract-content-from-url "" :format :markdown))'
there you go, used conditionals, simple thing - adopted hato as well for Eric 🙂

🎉 2
borkdude 2026-03-14T11:09:25.528759Z

Nice. Switching from httpkit -> hato increases startup time for bb though (100ms instead of probably much lower). since httpkit is built-in. babashka.http-client is also built-in and offers a very similar API as hato (like hato it is built on the JDK http client). Also babashka.http-client yields smaller binaries than hato (last time I checked).

borkdude 2026-03-14T11:10:30.668349Z

So perhaps it would benefit both ECA and r11y (native and bb) by switching over but perhaps the benefit is only marginal. not sure

dazld 2026-03-14T11:12:37.587039Z

hm, assumed that hato wouldn’t even be visible / fetched by bb? https://github.com/dazld/r11y/blob/main/src/r11y/lib/http.cljc the requires are gated behind conditionals

(ns r11y.lib.http
  #?(:bb (:require [babashka.http-client :as http])
     :clj (:require [hato.client :as hato])))
etc

borkdude 2026-03-14T11:13:04.898569Z

oh yes, that's great

borkdude 2026-03-14T11:13:28.180059Z

I assumed that hato was loaded in bb, which is possible, but you already fixed it, great :)

dazld 2026-03-14T11:13:33.666509Z

😛

dazld 2026-03-14T11:13:50.561079Z

can make .bb files later if needed

borkdude 2026-03-14T11:14:11.577709Z

this all works fine as it is now, for bb then.

borkdude 2026-03-14T11:14:39.189349Z

thanks!

dazld 2026-03-14T11:14:40.604679Z

lmk how you get on! there’s some better cleanup / markdown formatting that I’m playing with, but it works reasonably already

dazld 2026-03-14T11:14:42.233539Z

np!

Filipe Silva 2026-03-02T19:16:50.261779Z

Heya, I'm getting messages from someone I suspect is a spammer, these look a lot like messages I sometimes get on the mail. Not sure where to report.

phronmophobic 2026-03-02T19:17:46.056439Z

I think #spam-reports is usually the recommended channel

Filipe Silva 2026-03-02T19:18:26.714309Z

thanks for the pointer!

seancorfield 2026-03-02T19:27:24.372309Z

They're already deactivated.

🙏 4