Fork me on GitHub
#cljdoc
<
2019-04-03
>
lee15:04:25

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

lee15:04:06

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?

lee15:04:16

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

martinklepsch16:04:37

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

lee16:04:08

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.

lee16:04:55

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.

martinklepsch16:04:56

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

martinklepsch17:04:15

note that this is all on the cljs-proper branch

lee17:04:32

nice code! so easy to read.

martinklepsch19:04:15

But James Reeves‘

lee19:04:55

Oh that weavejester sure has some talent!

lee18:04:32

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.

lee18:04:20

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

lee18:04:50

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

martinklepsch19:04:28

@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.

martinklepsch19:04:27

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

lee19:04:55

Thanks, you are most kind!