Skip to content

Commit e81537b

Browse files
alexander-yakushevbbatsov
authored andcommitted
[docs] Update pretty-printing doc
1 parent 26c4c0b commit e81537b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

doc/modules/ROOT/pages/usage/pretty_printing.adoc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
== Configuring a printing function
44

5-
NOTE: Pretty-printing was overhauled in CIDER 0.21 to leverage new features introduced in nREPL 0.6.
6-
Refer to https://nrepl.org/nrepl/usage/misc.html#_pretty_printing[nREPL's documentation] for details.
5+
NOTE: CIDER relies on nREPL's own value printing mechanism. Refer to
6+
https://nrepl.org/nrepl/usage/misc.html#pretty_printing[nREPL's documentation]
7+
for details.
78

89
You can configure the function used by CIDER for pretty-printing evaluation
910
results and other data using the option `cider-print-fn`, which can take the
@@ -15,14 +16,16 @@ equivalent of `clojure.core/pr`.
1516
* `pr` to use the equivalent of `clojure.core/pr`.
1617
* `pprint` to use the built-in `clojure.pprint/pprint` (this is the default).
1718
* `fipp` to use the https://github.com/brandonbloom/fipp[Fast Idiomatic
18-
Pretty-Printer]. This is approximately
19-
5-10x faster than `clojure.core/pprint`.
19+
Pretty-Printer]. This is approximately 5-10x faster than `clojure.core/pprint`.
2020
* `puget` to use https://github.com/greglook/puget[Puget], which provides
2121
https://github.com/greglook/puget#canonical-representation[canonical serialization]
2222
of data on top of fipp, but at a slight performance cost.
2323
* `zprint` to use https://github.com/kkinnear/zprint[zprint], a fast and
2424
flexible alternative to the libraries mentioned above.
2525

26+
For `fipp`, `puget`, and `zprint` printers to work, you need to add a
27+
respective dependency into your project explicitly.
28+
2629
Alternatively, `cider-print-fn` can be set to the namespace-qualified name of a
2730
Clojure var whose function takes three arguments: the object to print, the
2831
`java.io.PrintWriter` to print on, and a (possibly nil) map of options.
@@ -49,11 +52,6 @@ Here's one example:
4952
(apply pp/write value (mapcat identity (assoc options :stream writer))))
5053
----
5154

52-
IMPORTANT: Before Clojure 1.10.2, a
53-
https://clojure.atlassian.net/browse/CLJ-1445[bug] in `clojure.pprint` caused it
54-
to not work properly with `+*print-meta*+`. If you need to print the metadata
55-
you'll have to change the print function or disable pretty-printing.
56-
5755
== Limiting printed output
5856

5957
You can set `cider-print-quota` to limit the number of bytes that will be

0 commit comments

Comments
 (0)