]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-130160: use `.. program::` directive for documenting `webbrowser` CLI ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 9 Mar 2025 07:03:56 +0000 (08:03 +0100)
committerGitHub <noreply@github.com>
Sun, 9 Mar 2025 07:03:56 +0000 (07:03 +0000)
gh-130160: use `.. program::` directive for documenting `webbrowser` CLI (GH-130995)

use `.. program::` directive for documenting `webbrowser` CLI
(cherry picked from commit 92e5f826ace1eab29920a0a3487a3cac7eeab925)

Co-authored-by: donBarbos <donbarbos@proton.me>
Doc/library/webbrowser.rst

index 2d19c514ce43b698348069c36f6d70b8950cce40..d33e7344761f4a51184b15467f72fa27a59e6aaf 100644 (file)
@@ -40,14 +40,23 @@ a new tab, with the browser being brought to the foreground. The use of the
 :mod:`webbrowser` module on iOS requires the :mod:`ctypes` module. If
 :mod:`ctypes` isn't available, calls to :func:`.open` will fail.
 
+.. program:: webbrowser
+
 The script :program:`webbrowser` can be used as a command-line interface for the
 module. It accepts a URL as the argument. It accepts the following optional
 parameters:
 
-* ``-n``/``--new-window`` opens the URL in a new browser window, if possible.
-* ``-t``/``--new-tab`` opens the URL in a new browser page ("tab").
+.. option:: -n, --new-window
+
+   Opens the URL in a new browser window, if possible.
+
+.. option:: -t, --new-tab
+
+   Opens the URL in a new browser tab.
+
+The options are, naturally, mutually exclusive.  Usage example:
 
-The options are, naturally, mutually exclusive.  Usage example::
+.. code-block:: bash
 
    python -m webbrowser -t "https://www.python.org"