Welcome! Please see the About page for a little more info on how this works.

0 votes
in Tools by

With a minimal deps.edn-based project:

(! 1105)-> clojure -Tnew lib :name repro/help-doc
Generating a project called help-doc based on the 'app' template.
(! 1106)-> cd help-doc/
(! 1107)-> cat src/repro/help_doc.clj 
(ns repro.help-doc
  (:gen-class))

(defn greet
  "Callable entry point to the application."
  [data]
  (println (str "Hello, " (or (:name data) "World") "!")))

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  (greet {:name (first args)}))
(! 1108)-> clojure -X:deps help/doc :ns repro.help-doc
-------------------------
repro.help-doc/-main
([& args])
  I don't do a whole lot ... yet.
-------------------------
repro.help-doc/greet
([data])
  Callable entry point to the application.
(! 1109)-> clojure -X:deps help/doc :fn repro.help-doc/greet
-------------------------

(! 1110)-> cat deps.edn
{:paths ["src" "resources"]
 :deps {org.clojure/clojure {:mvn/version "1.10.3"}}}

Neither of these work either:

(! 1111)-> clojure -X:deps help/doc :ns repro.help-doc :fn greet
-------------------------

(! 1112)-> clojure -X:deps help/doc :ns-default repro.help-doc :fn greet
-------------------------

1 Answer

+1 vote
by
selected by
 
Best answer

The correct way to refer to the doc for a function seems to be -X:deps help/doc :fn <ns-name>/<fn-name>:

$ clj -X:deps help/doc :fn clojure.core/cons
-------------------------
clojure.core/cons
([x seq])
  Returns a new seq where x is the first element and seq is
    the rest.

$

But, in this case, that still doesn’t work. Probably, the call to resolve in this line should be requiring-resolve?

by
Yes, fixed in 1.10.3.912
by
Thank you for the quick fix!
...