Skip to content

Commit

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

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

use `.. program::` directive for documenting `webbrowser` CLI

(cherry picked from commit 92e5f82)

* remove extra paragraph
  • Loading branch information
donBarbos authored Mar 9, 2025
1 parent 552dad1 commit 11d550c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Doc/library/webbrowser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,23 @@ allow the remote browser to maintain its own windows on the display. If remote
browsers are not available on Unix, the controlling process will launch a new
browser and wait.

.. 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`` opens the URL in a new browser window, if possible;
``-t`` opens the URL in a new browser page ("tab"). The options are,
naturally, mutually exclusive. Usage example::
parameters:

.. 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:

.. code-block:: bash
python -m webbrowser -t "https://www.python.org"
Expand Down

0 comments on commit 11d550c

Please sign in to comment.