This is very useful. Thanks for doing it.

On windows xp find-javadoc-url would not work for local javadocs,
maybe because of window's "c:\xx" syntax. Using (.toURL file) seemed
to fix it. Maybe that will work for the other systems also.

(defn find-javadoc-url
  "Searches for a URL for the given class name.  Tries
  *local-javadocs* first, then *remote-javadocs*.  Returns a string."
  [classname]
  (let [file-path (.replace classname \. File/separatorChar)
        url-path (.replace classname \. \/)]
    (if-let [file (first
                   (filter #(.exists %)
                           (map #(File. % (str file-path ".html"))
                                @*local-javadocs*)))]
      (.toExternalForm (.toURL file))
      ;; If no local file, try remote URLs:
      (some (fn [[prefix url]]
                (when (.startsWith classname prefix)
                  (str url url-path ".html")))
            @*remote-javadocs*))))


Thanks again

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to