ClojureDocs

Nav

Namespaces

add-remote-javadoc

clojure.java.javadoc

Available since 1.2
  • (add-remote-javadoc package-prefix url)
Adds to the list of remote Javadoc URLs.  package-prefix is the
beginning of the package name that has docs at this URL.
2 Examples
user=> (use 'clojure.java.javadoc)
nil

user=> (add-remote-javadoc "org.apache.commons.csv."
           "http://commons.apache.org/proper/commons-csv/apidocs/index.html")
{"java." "http://java.sun.com/javase/6/docs/api/",
 "javax." "http://java.sun.com/javase/6/docs/api/",
 "org.apache.commons.codec." "http://commons.apache.org/codec/api-release/",
 "org.apache.commons.csv." "http://commons.apache.org/proper/commons-csv/apidocs/index.html",
 "org.apache.commons.io." "http://commons.apache.org/io/api-release/",
 "org.apache.commons.lang." "http://commons.apache.org/lang/api-release/",
 "org.ietf.jgss." "http://java.sun.com/javase/6/docs/api/",
 "org.omg." "http://java.sun.com/javase/6/docs/api/",
 "org.w3c.dom." "http://java.sun.com/javase/6/docs/api/",
 "org.xml.sax." "http://java.sun.com/javase/6/docs/api/"}
;; Replace the JavaDoc URLs for the current JDK version.

(require '[clojure.java.javadoc :as browse])

(def java-version
  (let [jsv (System/getProperty "java.specification.version")]
    (if-let [single-digit (last (re-find #"^\d\.(\d+).*" jsv))]
      single-digit jsv)))

(def jdocs-template
  (format "https://docs.oracle.com/javase/%s/docs/api/" java-version))

(def known-prefix
  ["java." "javax." "org.ietf.jgss." "org.omg."
   "org.w3c.dom." "org.xml.sax."])

(doseq [prefix known-prefix]
  (browse/add-remote-javadoc prefix jdocs-template))
See Also

Adds to the list of local Javadoc paths.

Added by reborg
0 Notes
No notes for add-remote-javadoc