Is hot-reloading of documentation possible when running cljdoc locally?
Not really Iβm afraid
You can write a shell command that will build your jar, ingest it locally, and open the browser
I think that would be be the closest you can get to a hot reload type of experience
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.
Yeah itβs not ideal, contritbutions in this direction are very much welcome. Jar building will be necessary though.
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!
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
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.
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.
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
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.
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.
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.
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.
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!
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)
I made an issue: https://github.com/cljdoc/cljdoc/issues/875
Thanks!
Thank you for cljdoc :)
Well thank @martinklepsch, it is his baby! I'm just a nurturing uncle. simple_smile
Thank you both! π
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 π )
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.
The fix is live @teodorlu, let us know what you think!
This is what I think: π π β€οΈ β€οΈ π― π― !
Thank you! Love the collapsible menu.
Glad it worked out. The collapsible menu was always there in the mobile layout, it was just that you were getting the desktop layout.
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.
yes thatβs good news, thanks for following up!