Best practices for cljdoc


#1

I am very happy with @martinklepsch cljdoc, and I was wondering if there were some best practices for how to write documentation. I saw https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc but I was wondering if there was a way to effectively document a namespace (why does it exist? what should be here?) and not just its vars.

Another small annoyance I have is that the README from Github always seems to come from an earlier version…


#2

Yeah this is a little annoying indeed. The reason probably is that you didn’t update your README (and committed those changes) before you pushed the release to Clojars.

The revision at which files are shown is based on the artifact that’s pushed to Clojars and usually deployment tools provide the SHA of HEAD as git revision. So if you publish a release and then update your README to mention the newer version in a subsequent commit that commit will not be used as it wasn’t HEAD at the time of publishing.

Hope this makes sense. We should probably mention this in the guide as well.

You can put markdown in a namespace docstring and basically provide any additional information. I’m not aware of any conventions in that regard but long namespace docstrings are rendered beautifully in cljdoc and it always makes me happy to see them :smile: (I saw a few but can’t recall a specific example.)


#3

Thanks - they work indeed. Are all descriptions rendered as Markdown?


#4

All docstrings are rendered as markdown, yes.