Skip to content

Commit 92e5f82

Browse files
authored
gh-130160: use .. program:: directive for documenting webbrowser CLI (#130995)
use `.. program::` directive for documenting `webbrowser` CLI
1 parent a3990df commit 92e5f82

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Doc/library/webbrowser.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,23 @@ a new tab, with the browser being brought to the foreground. The use of the
4040
:mod:`webbrowser` module on iOS requires the :mod:`ctypes` module. If
4141
:mod:`ctypes` isn't available, calls to :func:`.open` will fail.
4242

43+
.. program:: webbrowser
44+
4345
The script :program:`webbrowser` can be used as a command-line interface for the
4446
module. It accepts a URL as the argument. It accepts the following optional
4547
parameters:
4648

47-
* ``-n``/``--new-window`` opens the URL in a new browser window, if possible.
48-
* ``-t``/``--new-tab`` opens the URL in a new browser page ("tab").
49+
.. option:: -n, --new-window
50+
51+
Opens the URL in a new browser window, if possible.
52+
53+
.. option:: -t, --new-tab
54+
55+
Opens the URL in a new browser tab.
56+
57+
The options are, naturally, mutually exclusive. Usage example:
4958

50-
The options are, naturally, mutually exclusive. Usage example::
59+
.. code-block:: bash
5160
5261
python -m webbrowser -t "https://www.python.org"
5362

0 commit comments

Comments
 (0)