Skip to content

Commit

Permalink
doc: Discover json-encoding-pretty-print variable!
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Apr 28, 2022
1 parent 846676a commit 7321400
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ the name matches "scalar" completely or partially, run:
#+begin_src shell
make test MATCH=scalar
#+end_src
* Helper function
* COMMENT Helper function
** JSON Reference pretty print string
The ~json-encode-pretty~ function defined here is used to pretty-print
the above JSON examples.
Expand All @@ -908,10 +908,9 @@ the above JSON examples.
(defun json-encode-pretty (object)
"Return prettified JSONified version of OBJECT."
(with-temp-buffer
(let ((json-false :false))
(insert (json-encode object))
(json-pretty-print-buffer)
(buffer-substring-no-properties (point-min) (point-max)))))
(let ((json-false :false)
(json-encoding-pretty-print t))
(json-encode object))))
#+end_src
* Reference
[[https://toml.io/en/v1.0.0/][TOML v1.0.0 Spec]]
Expand Down

0 comments on commit 7321400

Please sign in to comment.