liberator
liberator copied to clipboard
Use clojure.pprint for `text/plain`?
Sorry for being a pest these days, but wouldn't it be nicer if text/plain
were rendered by default with pprint
? Something like this:
(defmethod render-map-generic "text/plain"
[data ctx]
(with-out-str (clojure.pprint/pprint data)))
instead of the current implementation
Maybe yes, maybe no. Plain text conversion for an arbitrary data structure was never thought out too much. It was more or less implemented in a way that a human readable plain text document is generated. It falls short in a lot of ways, especially for deep nested data structures. The idea was to have a good default to render data to get you started. It's expected that custom render functions will be used according to the needs of the individual project.
I don't want to put much effort into this, TBH, and keep backward compatibility.