Skip to content

Commit 096c054

Browse files
committed
gh-130160: use .. program:: directive for documenting webbrowser CLI (#130995)
use `.. program::` directive for documenting `webbrowser` CLI (cherry picked from commit 92e5f82)
1 parent 552dad1 commit 096c054

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

Doc/library/webbrowser.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,30 @@ allow the remote browser to maintain its own windows on the display. If remote
3333
browsers are not available on Unix, the controlling process will launch a new
3434
browser and wait.
3535

36+
On iOS, the :envvar:`BROWSER` environment variable, as well as any arguments
37+
controlling autoraise, browser preference, and new tab/window creation will be
38+
ignored. Web pages will *always* be opened in the user's preferred browser, in
39+
a new tab, with the browser being brought to the foreground. The use of the
40+
:mod:`webbrowser` module on iOS requires the :mod:`ctypes` module. If
41+
:mod:`ctypes` isn't available, calls to :func:`.open` will fail.
42+
43+
.. program:: webbrowser
44+
3645
The script :program:`webbrowser` can be used as a command-line interface for the
3746
module. It accepts a URL as the argument. It accepts the following optional
38-
parameters: ``-n`` opens the URL in a new browser window, if possible;
39-
``-t`` opens the URL in a new browser page ("tab"). The options are,
40-
naturally, mutually exclusive. Usage example::
47+
parameters:
48+
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:
58+
59+
.. code-block:: bash
4160
4261
python -m webbrowser -t "https://www.python.org"
4362

0 commit comments

Comments
 (0)