Skip to content

Instantly share code, notes, and snippets.

@Chouser
Forked from devn/rewrite.clj
Created January 6, 2010 14:28
Show Gist options
  • Save Chouser/270300 to your computer and use it in GitHub Desktop.
Save Chouser/270300 to your computer and use it in GitHub Desktop.
(defn print-markdown-doc
"This is a modified version of print-doc which outputs the documentation in markdown format."
[v]
(let [{:keys [ns name arglists macro doc]} (meta v)]
(into [(format "###%s###" name) ""]
(->> (str " *" (ns-name ns) "/" name "*\n\n"
" :::clojure\n"
" " arglists "\n\n"
(when macro "*Macro*\n")
" " doc)
(.split #"\n")
(map #(str ">" %))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment