cljdoc

2024-05-08T13:26:39.738709Z

Is hot-reloading of documentation possible when running cljdoc locally?

martinklepsch 2024-05-08T13:36:10.558659Z

Not really I’m afraid

martinklepsch 2024-05-08T13:36:41.093009Z

You can write a shell command that will build your jar, ingest it locally, and open the browser

martinklepsch 2024-05-08T13:37:07.156069Z

I think that would be be the closest you can get to a hot reload type of experience

cjohansen 2024-05-08T13:39:30.967059Z

I tried viewing docs locally recently, but found the setup quite complicated. Would be very cool if I could just point something at a local checkout and work on it with live reload.

martinklepsch 2024-05-08T13:48:16.239119Z

Yeah it’s not ideal, contritbutions in this direction are very much welcome. Jar building will be necessary though.

lread 2024-05-08T15:42:52.511969Z

I've written a cljdoc-preview task that I adapt for various projects. It abstracts the complexity for me. Here's https://github.com/lread/test-doc-blocks/blob/main/script/cljdoc_preview.clj. But yeah, it is currently a pretty big setup and operation to preview locally. And nope @nbtheduke no hot re-loading support yet. As I took the time to document the current howtos for cljdoc local previewing, I am pretty familiar with the whole thing. So, if folks have questions or want to brainstorm ideas, I'm around!

2024-05-08T15:51:23.918079Z

Restarting isn't so bad (starts up pretty quick), but having to rely on a commit is a little awkward. I don't know cljdocs' internals enough to know if pulling out just the docs/ generation logic into a cli would be possible or not lol

lread 2024-05-08T15:59:45.986489Z

Yeah, cljdoc local preview is currently a full integration test that literally mimics productions. I usually preview my articles' rendering with Visual Studio Code (I'm a Doom emacs user, but it has a nice preview) and then do my final API docstrings and article (and links-between-them) checks using cljdoc local preview.

lread 2024-05-08T16:03:43.103599Z

So, if I understand your current focus, you are wanting to very quickly see how cljdoc would render your articles as you write them. During this workflow you don't really care about full production preview of your docs.

2024-05-08T16:03:53.134209Z

Yeah, I can do some previews locally as well. I reach for this when I want to make sure the cljdoc.edn file is properly configured and everything links together correctly

πŸ‘ 1
lread 2024-05-08T16:15:26.767119Z

Ideally, I'd like a simple and fast local preview with automatic hot-reload that tells me what my docs will look like (and how they will behave) after I release my lib.

πŸ‘ 1
πŸ’― 1
lread 2024-05-08T16:37:11.940539Z

Cljdoc's source of truth is the jar and the revision in the remote git repo the jar points to. That's fine for production but imposes a real burden for local preview. We might consider a preview mode that is not 100% representative of cljdoc production, which could be followed by an optional full preview should the doc author wish to go that far... dunno.

cjohansen 2024-05-08T16:38:52.163259Z

I mostly want to see how my namespaces are treated and what the docstrings look like. I don't really care about versions, packaging, etc.

lread 2024-05-08T16:43:22.590589Z

Yeah, that's a good point. When I have some slightly complex Markdown in a docstring (that might include string escaping) it would be nice to quickly see what it would look like.

lread 2024-05-08T16:46:47.695449Z

There are different times when I care about different things. I do care about versions and packaging in my final checks before I release a lib. But while I'm writing a docstring or an article, not so much!

teodorlu 2024-05-08T17:47:57.663999Z

Hi! I'm having a bit of a hard time reading cljdoc docs from my phone, screenshots attached. Do you want an issue? (not sure if phones are a design target)

teodorlu 2024-05-10T07:31:46.952769Z

I made an issue: https://github.com/cljdoc/cljdoc/issues/875

lread 2024-05-10T14:37:10.921489Z

Thanks!

❀️ 1
teodorlu 2024-05-10T14:52:36.841569Z

Thank you for cljdoc :)

lread 2024-05-10T15:20:17.446289Z

Well thank @martinklepsch, it is his baby! I'm just a nurturing uncle. simple_smile

teodorlu 2024-05-10T15:21:28.658189Z

Thank you both! 😊

β™₯️ 1
teodorlu 2024-05-13T06:15:38.059749Z

Looks like I’m getting desktop in landscape! (meant to send this message along the screenshot, but it looks like I got distracted by something πŸ˜…)

lread 2024-05-08T18:09:30.961949Z

Hi @teodorlu! Yes, please! We do render differently for a smaller screen (on your desktop, you can see this by bringing your docs up and sizing the window really small). Perhaps your phone is on the cusp of what cljdoc considers small. We can adjust. Please share screen rez.

πŸ‘ 1
lread 2024-05-11T18:30:12.819589Z

The fix is live @teodorlu, let us know what you think!

teodorlu 2024-05-11T19:51:53.695359Z

This is what I think: 😁 😁 ❀️ ❀️ πŸ’― πŸ’― !

teodorlu 2024-05-11T19:52:11.700249Z

Thank you! Love the collapsible menu.

lread 2024-05-11T20:03:00.467789Z

Glad it worked out. The collapsible menu was always there in the mobile layout, it was just that you were getting the desktop layout.

πŸ‘ 1
lread 2024-05-11T20:04:22.430619Z

Kinda curious: I think you should get the desktop layout if you rotate your phone to landscape, but in my simulator testing landscape orientation still showed the mobile layout.

teodorlu 2024-05-11T22:12:10.380119Z

❀️ 1
πŸŽ‰ 1
lread 2024-05-13T11:43:43.215379Z

yes that’s good news, thanks for following up!

❀️ 1