liberator icon indicating copy to clipboard operation
liberator copied to clipboard

Use clojure.pprint for `text/plain`?

Open vspinu opened this issue 8 years ago • 1 comments

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

vspinu avatar Jun 23 '16 20:06 vspinu

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.

ordnungswidrig avatar Jun 24 '16 06:06 ordnungswidrig