Skip to content

Instantly share code, notes, and snippets.

@devn
Created December 22, 2009 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devn/261911 to your computer and use it in GitHub Desktop.
Save devn/261911 to your computer and use it in GitHub Desktop.
(defn build-filename [input]
(str "_" (second (re-find #"\/(.*)\Z" (str input)))))
(defn sort-ns
"Sorts the vals from the map returned by ns-publics for a given nspace into alphabetical order."
[nspace]
(vals (ns-publics nspace)))
(defn print-core-docs-to-files
[path-to-files]
(let [docs (sort-ns 'clojure.core)]
(doseq [s docs]
(let [filename (build-filename s)]
(with-out-writer (file-str path-to-files filename)
(print-doc s))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment