summaryrefslogtreecommitdiffstats
path: root/Doc/library/json.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-04-08 16:18:04 (GMT)
committerGitHub <noreply@github.com>2018-04-08 16:18:04 (GMT)
commit46936d5a71d1683dbd8ddb6d7f39aab50ecfec50 (patch)
tree1f51e69c1fbb9401516478b8866d01f1513644cb /Doc/library/json.rst
parent9265dd72e5ec1cfa5fcdb5be8ebffe1d9994bd4b (diff)
downloadcpython-46936d5a71d1683dbd8ddb6d7f39aab50ecfec50.zip
cpython-46936d5a71d1683dbd8ddb6d7f39aab50ecfec50.tar.gz
cpython-46936d5a71d1683dbd8ddb6d7f39aab50ecfec50.tar.bz2
Improve highlighting of some code blocks. (GH-6401)
Diffstat (limited to 'Doc/library/json.rst')
-rw-r--r--Doc/library/json.rst16
1 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index bcad61a..85798fa 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 <http://yaml.org/>`_ 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
[