technomancy/slamhound — pull request #15 by tomfaulhaber (2012-01-07 09:27:34+00:00)
Title: Better formatting of the namespace declaration

This brings to mind http://bit.ly/yg4mUO

I think that this patch captures all the variations, but there are a lot of them, so let me know if any output looks wrong. Or if something is simply not to taste.

I will make a similar patch to clojure.pprint so that this will be built into code-dispatch in 1.4 (don't worry, it won't break this version).

Here is what my output looks like for an absurdly complex namespace:

```clj
(ns autodoc.build-html
"This is the namespace that builds the HTML pages themselves.
It is implemented with a number of custom enlive templates."
{:skip-wiki true, :author "Tom Faulhaber"}
(:refer-clojure :exclude [empty complement])
(:import [java.util.jar JarFile]
[java.io File FileWriter BufferedWriter StringReader
BufferedInputStream BufferedOutputStream
ByteArrayOutputStream FileReader FileInputStream]
[java.util.regex Pattern])
(:require [clojure.string :as str])
(:use [net.cgrand.enlive-html :exclude (deftemplate)]
[clojure.java.io :only (as-file file writer)]
[clojure.java.shell :only (sh)]
[clojure.pprint :only (pprint cl-format pprint-ident
pprint-logical-block set-pprint-dispatch
get-pretty-writer fresh-line)]
[clojure.data.json :only (pprint-json)]
[autodoc.collect-info :only (contrib-info)]
[autodoc.params :only (params expand-classpath)])
(:use clojure.set clojure.java.io clojure.data clojure.java.browse
clojure.inspector clojure.zip clojure.stacktrace))

```