From 46936d5a71d1683dbd8ddb6d7f39aab50ecfec50 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 8 Apr 2018 19:18:04 +0300 Subject: Improve highlighting of some code blocks. (GH-6401) --- Doc/library/json.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Doc/library/json.rst') diff --git a/Doc/library/json.rst b/Doc/library/json.rst index bcad61aeca..85798fa2cf 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -100,9 +100,9 @@ Extending :class:`JSONEncoder`:: ['[2.0', ', 1.0', ']'] -.. highlight:: bash +Using :mod:`json.tool` from the shell to validate and pretty-print: -Using :mod:`json.tool` from the shell to validate and pretty-print:: +.. code-block:: shell-session $ echo '{"json":"obj"}' | python -m json.tool { @@ -113,8 +113,6 @@ Using :mod:`json.tool` from the shell to validate and pretty-print:: See :ref:`json-commandline` for detailed documentation. -.. highlight:: python3 - .. note:: JSON is a subset of `YAML `_ 1.2. The JSON produced by @@ -647,8 +645,6 @@ when serializing Python :class:`int` values of extremely large magnitude, or when serializing instances of "exotic" numerical types such as :class:`decimal.Decimal`. -.. highlight:: bash - .. _json-commandline: Command Line Interface @@ -665,7 +661,9 @@ The :mod:`json.tool` module provides a simple command line interface to validate and pretty-print JSON objects. If the optional ``infile`` and ``outfile`` arguments are not -specified, :attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively:: +specified, :attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively: + +.. code-block:: shell-session $ echo '{"json": "obj"}' | python -m json.tool { @@ -684,7 +682,9 @@ Command line options .. cmdoption:: infile - The JSON file to be validated or pretty-printed:: + The JSON file to be validated or pretty-printed: + + .. code-block:: shell-session $ python -m json.tool mp_films.json [ -- cgit v1.2.1