Issue #26462: Doc: reduce literal_block warnings, fix syntax highlighting.

Patch by Julien Palard.
diff --git a/Doc/howto/clinic.rst b/Doc/howto/clinic.rst
index 82eae01..5a69ca8 100644
--- a/Doc/howto/clinic.rst
+++ b/Doc/howto/clinic.rst
@@ -152,7 +152,9 @@
    For my example I'm using ``_pickle.Pickler.dump()``.
 
 2. If the call to the ``PyArg_Parse`` function uses any of the
-   following format units::
+   following format units:
+
+   .. code-block:: none
 
        O&
        O!
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
index 99b4cdc..de0d304 100644
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -377,7 +377,9 @@
     root.warning('Look out!')
     listener.stop()
 
-which, when run, will produce::
+which, when run, will produce:
+
+.. code-block:: none
 
     MainThread: Look out!
 
@@ -1860,7 +1862,9 @@
     logger = logging.getLogger('mylogger')
     logger.debug('A debug message')
 
-To run this, you will probably need to run as ``root``::
+To run this, you will probably need to run as ``root``:
+
+.. code-block:: shell-session
 
     $ sudo python3.3 chowntest.py
     $ cat chowntest.log
@@ -2485,7 +2489,9 @@
 completion, the status is as it was before so message #6 appears (like message
 #1) whereas message #7 doesn't (just like message #2).
 
-If we run the resulting script, the result is as follows::
+If we run the resulting script, the result is as follows:
+
+.. code-block:: shell-session
 
     $ python logctx.py
     1. This should appear just once on stderr.
@@ -2495,12 +2501,16 @@
     6. This should appear just once on stderr.
 
 If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the following,
-which is the only message written to ``stdout``::
+which is the only message written to ``stdout``:
+
+.. code-block:: shell-session
 
     $ python logctx.py 2>/dev/null
     5. This should appear twice - once on stderr and once on stdout.
 
-Once again, but piping ``stdout`` to ``/dev/null``, we get::
+Once again, but piping ``stdout`` to ``/dev/null``, we get:
+
+.. code-block:: shell-session
 
     $ python logctx.py >/dev/null
     1. This should appear just once on stderr.
diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst
index 51e8430..82d1308 100644
--- a/Doc/howto/logging.rst
+++ b/Doc/howto/logging.rst
@@ -106,7 +106,9 @@
    logging.warning('Watch out!')  # will print a message to the console
    logging.info('I told you so')  # will not print anything
 
-If you type these lines into a script and run it, you'll see::
+If you type these lines into a script and run it, you'll see:
+
+.. code-block:: none
 
    WARNING:root:Watch out!
 
@@ -230,7 +232,9 @@
    import logging
    logging.warning('%s before you %s', 'Look', 'leap!')
 
-will display::
+will display:
+
+.. code-block:: none
 
    WARNING:root:Look before you leap!
 
@@ -594,7 +598,9 @@
     logger.error('error message')
     logger.critical('critical message')
 
-Running this module from the command line produces the following output::
+Running this module from the command line produces the following output:
+
+.. code-block:: shell-session
 
     $ python simple_logging_module.py
     2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message
@@ -653,7 +659,9 @@
     format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
     datefmt=
 
-The output is nearly identical to that of the non-config-file-based example::
+The output is nearly identical to that of the non-config-file-based example:
+
+.. code-block:: shell-session
 
     $ python simple_logging_config.py
     2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message
@@ -1073,4 +1081,3 @@
       Useful handlers included with the logging module.
 
    :ref:`A logging cookbook <logging-cookbook>`
-
diff --git a/Doc/howto/regex.rst b/Doc/howto/regex.rst
index 371ef59..d9b7c90 100644
--- a/Doc/howto/regex.rst
+++ b/Doc/howto/regex.rst
@@ -74,7 +74,9 @@
 devoted to discussing various metacharacters and what they do.
 
 Here's a complete list of the metacharacters; their meanings will be discussed
-in the rest of this HOWTO. ::
+in the rest of this HOWTO.
+
+.. code-block:: none
 
    . ^ $ * + ? { } [ ] \ | ( )
 
diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst
index 50a09ba..fbeb11a 100644
--- a/Doc/howto/unicode.rst
+++ b/Doc/howto/unicode.rst
@@ -613,7 +613,9 @@
    print(os.listdir(b'.'))
    print(os.listdir('.'))
 
-will produce the following output::
+will produce the following output:
+
+.. code-block:: shell-session
 
    amk:~$ python t.py
    [b'filename\xe4\x94\x80abc', ...]