cljdoc

https://cljdoc.org/ & https://github.com/cljdoc/cljdoc
elarouss 2018-11-27T16:39:21.193800Z

the https://github.com/cljdoc/cljdoc/issues/206 looks hard for someone who haven't used clojars, maven or pom files, great i'll try to do it

martinklepsch 2018-11-27T16:40:20.194100Z

yeah, it might indeed be a little hard, probably the hardest of the three issues I listed

elarouss 2018-11-27T16:41:37.194400Z

good opportunity for me to learn hhhh

martinklepsch 2018-11-27T16:43:35.194600Z

coincidentally @dominicm just wrote an article about publishing deps.edn based projects as jars. https://juxt.pro/blog/posts/pack-maven.html

elarouss 2018-11-27T16:45:38.194800Z

ah that's good, problem solved i guess

martinklepsch 2018-11-27T16:50:53.195Z

well... πŸ˜„ I'm not really happy with all this pom.xml fiddling that's required for this

martinklepsch 2018-11-27T17:03:52.195300Z

But it is a start

elarouss 2018-11-27T17:03:57.195500Z

oh i guess i have questions more than answers

elarouss 2018-11-27T17:05:03.195700Z

ok so let me ask about this clj -m something.publish --project cljdoc --version 0.1.0

martinklepsch 2018-11-27T17:11:34.195900Z

sure, ask away πŸ™‚

martinklepsch 2018-11-27T17:11:52.196300Z

sure, ask away πŸ™‚

elarouss 2018-11-27T17:14:39.196500Z

do you want a namespace named publish that publishes any project with any version ?

elarouss 2018-11-27T17:15:34.196700Z

πŸ˜… that's what i understood of that

martinklepsch 2018-11-27T17:19:08.196900Z

that specific namespace was more of a placeholder πŸ˜„

martinklepsch 2018-11-27T17:19:33.197100Z

I'll add another comment to the issue with more detail

elarouss 2018-11-27T17:28:21.197300Z

hhhh i see :thumbsup:

martinklepsch 2018-11-27T17:30:59.197500Z

alright hope this makes some more sense: https://github.com/cljdoc/cljdoc/issues/206#issuecomment-442145088

martinklepsch 2018-11-27T17:31:17.197700Z

this work issue requires work on some more general Clojure tooling projects

martinklepsch 2018-11-27T17:31:54.197900Z

It's an interesting thing to work on and learn about but it might also not be very beginner friendly if you're not familiar with Maven

martinklepsch 2018-11-27T19:04:22.198100Z

nice: https://cljdoc.org/d/org.clojars.elarouss/cljdoc/0.1.0/doc/readme πŸ˜„

elarouss 2018-11-27T19:35:21.198400Z

hhhh yeah i followed the tutorial

elarouss 2018-11-27T19:36:16.198600Z

i'm just wondering if we can use this function from clojure/tools.deps.alpha, but it doesn't feel safe

martinklepsch 2018-11-27T19:36:36.198800Z

which function are you thinking of?

elarouss 2018-11-27T19:36:52.199Z

from namespace clojure.tools.deps.alpha.gen.pom

elarouss 2018-11-27T19:37:03.199200Z

`(sync-pom (r/read-deps [(jio/file "/usr/local/Cellar/clojure/1.9.0.302/deps.edn") (jio/file "deps.edn")]) (jio/file "."))`

elarouss 2018-11-27T19:37:18.199400Z

it works

martinklepsch 2018-11-27T19:40:28.199600Z

yeah, I think that's what clj -Spom does as well

martinklepsch 2018-11-27T19:40:47.199800Z

the issue with that is that we need to manually update the generated pom.xml

elarouss 2018-11-27T19:44:24.200Z

omg i've just realized that deps.edn files don't contain : artifact, group ...

elarouss 2018-11-27T19:44:51.200200Z

ah i'm sorry, i feel like i'm wasting your time and energy

dominicm 2018-11-27T19:51:56.200400Z

Fwiw, that namespace might be removed in the future. I think it is internal.

martinklepsch 2018-11-27T19:59:31.201Z

@ichigo no worries this stuff can be confusing

martinklepsch 2018-11-27T20:06:44.201700Z

Yay, finally managed to fix (integrant.repl/reset) πŸŽ‰ https://github.com/cljdoc/cljdoc/commit/139a5a6c8094ef05cde24b93ef942b0882dbb22f

1πŸ™Œ1πŸŽ‰
martinklepsch 2018-11-27T20:07:20.201800Z

(entirely my fault that it didn't work in the first place)

elarouss 2018-11-27T20:13:04.202Z

yeah i guess so

2018-11-27T21:10:34.202300Z

Awesome! Does this mean I don't need to do (integrant.repl/stop) and then (integrant.repl/start)?

martinklepsch 2018-11-27T21:32:53.202500Z

yes you can just (integrant.repl/reset)

martinklepsch 2018-11-27T21:34:06.202700Z

(defun integrant-reset ()
  (interactive)
  (cider-interactive-eval "(integrant.repl/reset)"))
you can also add this to your emacs config and then you can just do M-x integrant-reset without opening the system buffer

martinklepsch 2018-11-27T21:34:34.202900Z

This might be nice to document in "Running cljdoc locally"

devurandom 2018-11-27T23:20:44.205Z

Hi! What is the general plan for integration in CI systems of projects to be documented? If I submit a PR to library X and would like to see how my changes will actually look like on http://cljdoc.org later. I.e. a preview. How do you recommend to go about that? See-Also: https://github.com/cljdoc/cljdoc/issues/236

devurandom 2018-11-28T09:10:21.207100Z

thx, sounds like a plan. Was also thinking about whether that is something that could be offered as a service. Tell the cljdoc GitHub bot (go cljdoc) in the PR comments and it will pull the branch, build it into a random version, and provide a link in the GitHub PR. After a week it would delete the stuff again, or when the PR is merged/rejected.

martinklepsch 2018-11-28T09:37:39.207300Z

@devurandom that would require knowing how to build every project. unfortunately that can vary greatly from project to project

devurandom 2018-11-28T09:42:04.207500Z

Maybe the two can work together hand in hand? The project's CI system builds an artifact and stores the link in the GitHub issue and the cljdoc bot picks that up on command and displays it? Or maybe the cljdoc bot can trigger the project's CI system and make it call ingest towards the cljdoc preview platform?

martinklepsch 2018-11-28T09:51:15.207700Z

yeah, there's lots of good stuff that could be done... all a question of the effort / impact ratio πŸ™‚

devurandom 2018-11-28T09:53:22.208Z

Yeah, maybe it only makes sense for projects beyond a certain exposition and size.

martinklepsch 2018-11-28T09:55:29.208200Z

I think the offline bundle stuff would be a good first step, what do you think?

devurandom 2018-11-28T09:57:32.208400Z

Sure. At least if the amount of required effort is low.

devurandom 2018-11-28T09:58:00.208600Z

I'm wondering how to lower the entry bar to producing good documentation. The less services library authors have to setup themselves, the better.

devurandom 2018-11-28T10:01:00.208800Z

So maybe just offering an installable cljdoc CLI utility (like the [`circleci` tool](https://circleci.com/docs/2.0/local-cli/)) would already be sufficient for most cases, and be less effort for you: Make the current tooling able to respond to cljdoc run with opening a page in the browser, and you'd be done.

martinklepsch 2018-11-28T10:03:08.209100Z

Right but that would require cloning the PR, which you wanted to avoid as far as I understood the workflow you imagined

devurandom 2018-11-28T10:04:42.209300Z

> Both I and the contributor should be able to look at it (i.e. the result should be available on some web space), to discuss further improvements or catch formatting mistakes. This part?

martinklepsch 2018-11-28T10:04:47.209500Z

yes

devurandom 2018-11-28T10:06:50.209700Z

Probably did not ask the 5 whys when I wrote that... 😞 What I actually meant was more like this: "They should both see the same pages. It would be convenient for them, if those pages were already available on some web space so they would not need to take any other action than looking at it."

devurandom 2018-11-28T10:09:27.209900Z

In the end the main goal of this process is to "preview this documentation to make sure it contains no formatting issues and renders as intended" (since how it renders influences how it is perceived by readers, which in turn can guide or mislead their understanding of the text).

devurandom 2018-11-28T10:10:36.210100Z

In the beginning I thought that uploading it to a web space would be convenient enough, but now I think that not many people operate web servers or want to pay for one, so that might not actually be as convenient as I thought initially.

devurandom 2018-11-28T10:20:54.210300Z

I am exploring multiple routes to tackle the underlying problem, in order to figure out what works best. What would definitely be inconvenient would be if one had to git clone cljdoc, start the server, cd to the PR checkout, ingest the docs, open the web browser, navigate to the right spot. Too many steps, too many locations to do something. Hence the idea of shoving this off to a CI, which many projects are probably already using.

martinklepsch 2018-11-28T10:23:53.210600Z

yes, I'm in favor of utilizing CI for this

martinklepsch 2018-11-28T10:24:15.210800Z

I also think the /download + artifact route might be most feasible/easy for a first version

devurandom 2018-11-28T10:25:25.211Z

Can cljdoc push the offline docs directly to S3 or similar? That might be convenient enough for many people to integrate it into their CI process. Though you probably would not want every PR to be made public like that, so you'd still need a gatekeeping process, like the (go cljdoc) bot... I think the best first step is to just make the local preview process more convenient using a wrapper shell script like the circleci script, which would just wrap java -jar cljdoc.jar or clj -m cljdoc.main or similar, just to allow people to easily use cljdoc locally as a tool.

martinklepsch 2018-11-28T10:29:32.211300Z

You don't need S3 on CircleCI: https://www.circleci.com/docs/2.0/artifacts

martinklepsch 2018-11-28T10:37:59.211600Z

I think we could probably make a script that - downloads cljdoc - runs ingest - builds offline bundle

devurandom 2018-11-28T10:39:23.211800Z

Re: S3/CircleCI: I'm thinking about how to make it easy to view the result. Having the artifact available for download is nice, but you also need to deploy it somewhere. Maybe it's necessary to tinker with different approaches for a while to figure out what works in practice for most projects and what does not.

martinklepsch 2018-11-28T10:57:49.212100Z

> need to deploy it somewhere why if reviewers can just download the artifact and view index.html β€” shouldn't that work? Did you take a look at an offline bundle? they work without servers

urzds 2018-11-28T12:15:08.212300Z

Plain convenience. Having the CI attach a link to a PR that people just have to click to preview the change is more convenient that having to download a tarball, extract it, open a browser.

martinklepsch 2018-11-28T12:26:05.212500Z

I think of this as an 80/20 kind of thing. Making the docs available at a remote location without any extra step is 100% UX. Downloading a tarball and opening a file inside it is 80%. The 20% to get to 100% require more effort than to get to 80%

urzds 2018-11-28T12:26:40.212700Z

good point

martinklepsch 2018-11-28T14:11:50.213Z

@urzds maybe you wanna take this on? https://github.com/cljdoc/cljdoc/issues/244

urzds 2018-11-28T14:21:26.213300Z

"take on" as in be assigned? If so, please assign @devurandom instead.

martinklepsch 2018-11-28T14:22:23.213600Z

take on as in "work on" πŸ˜„

martinklepsch 2018-11-28T14:22:33.213800Z

just wondering since it sounded like you wanted to help with this

martinklepsch 2018-11-28T14:22:54.214Z

I can't assign you so you'll have to do that yourself I guess πŸ™‚

urzds 2018-11-28T14:23:07.214200Z

yes, very much. But I don't think I'll be paid to do this, so I'll do it in my free time instead.

martinklepsch 2018-11-28T14:23:31.214400Z

I also created a milestone (experimenting with that really) for previews related stuff: https://github.com/cljdoc/cljdoc/milestone/2

urzds 2018-11-28T14:23:48.214600Z

Anyway, I've highlighted myself here, so I'll pick this up when I'm at home.

urzds 2018-11-28T14:25:54.214800Z

I'd suggest also add a "create easy cljdoc run command" task, for the other approach -- what do you think about that? Basically have ./script/cljdoc downloadable and able to pull a released cljdoc JAR, so it can work standalone?

martinklepsch 2018-11-28T14:36:51.215800Z

There’s no cljdoc jar yet but we can write scripts that download and run cljdoc

martinklepsch 2018-11-28T14:38:34.217Z

Or package a jar properly. But that’s a little tricky as well since there are multiple isolated environments

martinklepsch 2018-11-27T23:27:44.205300Z

replied on issue

martinklepsch 2018-11-27T23:32:09.205500Z

let me know if you have any thoughts on this @devurandom

martinklepsch 2018-11-27T23:32:34.205700Z

also just noticed @devurandom = @urzds? πŸ˜„

martinklepsch 2018-11-27T23:34:56.206100Z

just edited again with a link to offline docs example