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 89
89
([ns sym export-edn-url]
90
90
(get-doc (keyword ns sym) export-edn-url)))
91
91
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
+
92
106
(defn- kw-to-sym [kw]
93
107
(symbol (subs (str kw) 1 )))
94
108
95
109
(defn see-also
96
110
" Get the see-alsos for `var-name` if any."
111
+ {:added " 0.5.0" }
97
112
[var-name]
98
113
(if-let [see-alsos (:see-alsos (get-doc var-name))]
99
114
(map kw-to-sym see-alsos)))
You can’t perform that action at this time.
0 commit comments