-
-
Save rightfold/d0d9b0e76e3ce88100b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env clj | |
(require 'clojure.string) | |
(defn escape-html [text] | |
(clojure.string/escape text {\< "<", \& "&"})) | |
(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