Skip to content

Commit

Permalink
[3.13] gh-130160: use .. program:: directive for documenting `webbr…
Browse files Browse the repository at this point in the history
…owser` CLI (GH-130995) (#131003)

gh-130160: use `.. program::` directive for documenting `webbrowser` CLI (GH-130995)

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

Co-authored-by: donBarbos <[email protected]>
  • Loading branch information
miss-islington and donBarbos authored Mar 9, 2025
1 parent aef7eda commit d50941c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Doc/library/webbrowser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d50941c

Please sign in to comment.