Improve highlighting of some code blocks. (GH-6401)
(cherry picked from commit 46936d5a71d1683dbd8ddb6d7f39aab50ecfec50)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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 @@
['[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 @@
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 instances of "exotic" numerical types such as
:class:`decimal.Decimal`.
-.. highlight:: bash
-
.. _json-commandline:
Command Line Interface
@@ -665,7 +661,9 @@
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 @@
.. 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
[