This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-08
Channels
- # announcements (14)
- # babashka (16)
- # beginners (15)
- # biff (15)
- # calva (48)
- # clj-kondo (42)
- # cljdoc (25)
- # clojure (18)
- # clojure-europe (75)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-romania (1)
- # clojure-uk (10)
- # conjure (18)
- # core-typed (4)
- # cursive (16)
- # emacs (8)
- # fulcro (27)
- # graalvm (17)
- # honeysql (14)
- # hyperfiddle (9)
- # lsp (24)
- # missionary (5)
- # music (1)
- # nrepl (20)
- # off-topic (14)
- # re-frame (9)
- # reagent (34)
- # reitit (2)
- # releases (1)
- # shadow-cljs (19)
- # sql (16)
- # squint (9)
- # testing (2)
- # tools-build (10)
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 @UEENNMX0T 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)
Hi @U3X7174KS! 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.
I made an issue: https://github.com/cljdoc/cljdoc/issues/875
Well thank @U050TNB9F, it is his baby! I'm just a nurturing uncle.