From 725b6188e5ecdc4aa32acd87b86963e3765e7668 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Sat, 9 Apr 2016 07:35:23 -0600 Subject: [PATCH] Document custom pretty printer options --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 354994ae..7997d9eb 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,22 @@ encoders. In the event encoding fails, Cheshire will throw a JsonGenerationException. +#### Custom Pretty Printing Options + +If Jackson's default pretty printing library is not what you desire, you can +manually create your own pretty printing class and pass to the `generate-string` +or `encode` methods: + +```clojure +(let [my-pretty-printer (create-pretty-printer + (assoc default-pretty-print-options + :indent-arrays? true))] + (generate-string {:foo [1 2 3]} {:pretty my-pretty-printer})) +``` + +See the `default-pretty-print-options` for a list of options that can be +changed. + ### Decoding ```clojure