cljdoc

https://cljdoc.org/ & https://github.com/cljdoc/cljdoc
2020-09-08T21:03:37.004600Z

Hello, Is there a way in articles to link vars similarly to what is possible in docstrings?

seancorfield 2020-09-08T21:05:39.005300Z

@jeremys Yes, a link like https://cljdoc.org/d/seancorfield/next.jdbc/CURRENT/api/next.jdbc#get-datasource (from Getting Started) will take the reader direct to that function in the API.

seancorfield 2020-09-08T21:06:31.005900Z

The source of that article has

You can see the full list of `:dbtype` values supported in [next.jdbc/get-datasource](<https://cljdoc.org/d/seancorfield/next.jdbc/CURRENT/api/next.jdbc#get-datasource)'s> docstring.

2020-09-08T21:13:45.009600Z

@seancorfield Ok so you create the url yourself, no wikilink magic like in docstings. However the 'CURRENT' part of the url is plenty magic since it seems to resolve to whatever version of the docs you are currently consulting. That's pretty cool. Thanks a lot.

seancorfield 2020-09-08T21:31:46.010500Z

The main reason I use the full URL is because otherwise someone browsing the markdown docs in the GitHub repo would not be able to click on those links.

2020-09-08T21:33:12.010900Z

oh right, I didn't think of that!

seancorfield 2020-09-08T21:33:45.011500Z

I've had plenty of confused feedback from users who were reading the doc folder markdown files directly on GitHub 🙂

seancorfield 2020-09-08T21:34:51.012900Z

And of course, what's on GitHub is the "latest" code and may not have a release yet -- so that's a case where you can't provide a working link from an article to a newly-added function (since the API docs wouldn't have been generated yet). So that's been a constant battle to try to clarify...

2020-09-08T21:40:38.016100Z

True! Still, the CURRENT trick in the url allows the articles and the API docs to be in sync which is pretty neat already.

2020-09-08T21:46:49.019900Z

Another funny problem I am having. When you want to propose deps coordinates for a project using a git sha. You can't have this sha in the version of the readme cljdoc will use. In effect the readme seen on the clj doc's page is one commit behind...

2020-09-08T22:08:44.021100Z

@seancorfield Thanks again for the url scheme, the docs I generate now link even from intellij's markdown viewer...

seancorfield 2020-09-08T22:17:29.022500Z

Re: Git SHA: yeah, you end up needing to do an extra commit where you update just the references to any old SHAs with the latest SHAs.

seancorfield 2020-09-08T22:17:50.023Z

(so the README essentially always needs to be one commit ahead of the code)