File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 8989 ([ns sym export-edn-url]
9090 (get-doc (keyword ns sym) export-edn-url)))
9191
92+ (defn- var-name
93+ " Convert `v`'s name to a string we can use with `get-doc`."
94+ [v]
95+ (subs (str v) 2 ))
96+
97+ (defn resolve-and-find-doc
98+ " Resolve `sym` in the context of `ns` and look up the documentation
99+ for the resulting var."
100+ {:added " 0.5.0" }
101+ [ns sym]
102+ (if (special-symbol? sym)
103+ (find-doc " clojure.core" (str sym))
104+ (-> (ns-resolve ns sym) var-name get-doc)))
105+
92106(defn- kw-to-sym [kw]
93107 (symbol (subs (str kw) 1 )))
94108
95109(defn see-also
96110 " Get the see-alsos for `var-name` if any."
111+ {:added " 0.5.0" }
97112 [var-name]
98113 (if-let [see-alsos (:see-alsos (get-doc var-name))]
99114 (map kw-to-sym see-alsos)))
You can’t perform that action at this time.
0 commit comments