cljdoc

https://cljdoc.org/ & https://github.com/cljdoc/cljdoc
lread 2019-04-03T15:36:25.011100Z

Hello cljdocers! Thanks for this very cool project. Also thanks for supporting testing locally, it is so very helpful.

lread 2019-04-03T15:51:06.017Z

I am currently working on bringing rewrite-cljs up to date with rewrite-clj. Rewrite-clj uses an internal version of potemkin’s import-vars. I thought that was cool, so I’ve got a kind-of working version of import-vars for cljs, but I can’t seem to override a function’s file and line metadata in cljs. Then I wondered maybe cljdoc might have some feature to help? Can cljdoc be configured to have a function in one namespace directly point to source of another function in another namespace?

lread 2019-04-03T15:58:16.017800Z

Only for the purposes of documentation generated by cljdoc, of course.

martinklepsch 2019-04-03T16:09:37.019500Z

Hey! cljdoc uses cljs.analyzer.api/ns-publics to extract this information. I have to jump into a meeting right now but maybe that's a useful pointer to further investigate why things differ between cljs/clj

lread 2019-04-03T16:18:08.025400Z

Thanks @martinklepsch, I shall take a peek. My little cljs import-vars is using cljs.analyzer.api/resolve and it sees the file and line number but applying it as metadata to my target fn just doesn’t stick. I’ll take a peek at cljdoc source to see what I can learn.

lread 2019-04-03T16:34:55.027500Z

by the way, I think the version numbering scheme you use https://github.com/cljdoc/cljdoc/blob/master/script/version.sh is nice - including the both the count and sha seems like a good idea to me.

1
martinklepsch 2019-04-03T16:58:57.028100Z

@lee the source that's actually reading this data is here: https://github.com/cljdoc/codox/blob/cljs-proper/codox/src/codox/reader/clojurescript.clj

martinklepsch 2019-04-03T16:59:56.028700Z

there's a -main in that project that I've used for debugging this kind of thing in the past: https://github.com/cljdoc/codox/commit/b29b16ae686e3400689bbdc93df57200b709443d

martinklepsch 2019-04-03T17:00:15.029100Z

note that this is all on the cljs-proper branch

lread 2019-04-03T17:22:27.029500Z

thanks!

lread 2019-04-03T17:34:32.030200Z

nice code! so easy to read.

lread 2019-04-03T18:17:32.032500Z

to be clear, I’ve not found anything wrong with cljdoc, just trying to overcome a limitation with my cljs version of import-vars. I’ll wander over to clojurescript and ask about ability to override file and line metadata there.

lread 2019-04-03T18:53:20.033600Z

I wonder if I am thinking of something like codox’s source-uri https://github.com/weavejester/codox/blob/master/README.md#source-links

lread 2019-04-03T18:56:50.034600Z

Anyway, I’ll shut up here until I learn more over at #clojurescript

martinklepsch 2019-04-03T19:06:01.034900Z

Not mine 😊

martinklepsch 2019-04-03T19:06:15.035400Z

But James Reeves‘

martinklepsch 2019-04-03T19:08:28.037700Z

@lee i think it’s great you came by to raise this. I agree that it’s likely not an issue with cljdoc but would still be interesting to figure this out.

martinklepsch 2019-04-03T19:10:27.040400Z

Also re-frame has had similar issues with the way they imported vars into the core namespace. Maybe someone has written a clever macro to solve that there. @danielcompton could potentially can give a pointer here

lread 2019-04-03T19:10:55.040500Z

Oh that weavejester sure has some talent!

lread 2019-04-03T19:11:55.041100Z

Thanks, you are most kind!

martinklepsch 2019-04-03T19:28:21.041400Z

Sure does