Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created March 1, 2014 23:45
Show Gist options
  • Save rightfold/d0d9b0e76e3ce88100b8 to your computer and use it in GitHub Desktop.
Save rightfold/d0d9b0e76e3ce88100b8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env clj
(require 'clojure.string)
(defn escape-html [text]
(clojure.string/escape text {\< "&lt;", \& "&amp;"}))
(doseq [file *command-line-args*]
(load-file file))
(println "<dl>")
(doseq [fn (mapcat (comp vals ns-publics) (all-ns))]
(let [fn-name (name (:name (meta fn)))
fn-doc (:doc (meta fn))]
(when fn-doc
(println "<dt><code>" (escape-html fn-name) "</code></dt>")
(println "<dd><code>" (escape-html fn-doc) "</code></dd>"))))
(println "</dl>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment