[Mozilla Enterprise] JSON formatting

Paul Kosinski mozilla at iment.com
Sat Sep 7 16:06:33 UTC 2019


Since JSON files are becoming *the* way to pre-configure Firefox on
Linux, it is important to be able to keep them in a readable format.
Currently, it seems that they are stored as one line files with very,
very, very long lines. This format, although having a simple and
unambiguous syntax, is basically unreadable by humans. 

Fortunately, I recently discovered that emacs (my favorite editor due
to its file management capabilities among other things) has 2 commands
to make JSON readable, giving it sensible indentation and line breaks:

  json-pretty-print		Pretty-print selected region.
  json-pretty-print-buffer	Pretty-print current buffer.


They are invoked as usual for emacs, e.g.:

  M-x json-pretty-print-buffer RET

(Where M-x is the Alt-x key combinaton in most configurations, and
RET is the Enter key on PC-style keyboards.)

Hope this helps.


More information about the Enterprise mailing list