summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2010-12-03 09:29:11 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2010-12-03 09:29:11 (GMT)
commit7bb30b72d8a165f8bacbc480b8d5a15834fa4c35 (patch)
treefa300bf03acaea1390b11730fb8fd884b691b1ba /Doc
parent9af2a6e56f9c9b45c42579c23c0de378929e7d60 (diff)
downloadcpython-7bb30b72d8a165f8bacbc480b8d5a15834fa4c35.zip
cpython-7bb30b72d8a165f8bacbc480b8d5a15834fa4c35.tar.gz
cpython-7bb30b72d8a165f8bacbc480b8d5a15834fa4c35.tar.bz2
Improve Pydoc interactive browsing (#2001). Patch by Ron Adam.
* A -b option to start an enhanced browsing session. * Allow -b and -p options to be used together. * Specifying port 0 will pick an arbitrary unused socket port. * A new browse() function to start the new server and browser. * Show Python version information in the header. * A *Get* field which takes the same input as the help() function. * A *Search* field which replaces the Tkinter search box. * Links to *Module Index*, *Topics*, and *Keywords*. * Improved source file viewing. * An HTMLDoc.filelink() method. * The -g option and the gui() and serve() functions are deprecated.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/pydoc.rst18
-rw-r--r--Doc/whatsnew/3.2.rst7
2 files changed, 20 insertions, 5 deletions
diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst
index 3ab3303..842af3e 100644
--- a/Doc/library/pydoc.rst
+++ b/Doc/library/pydoc.rst
@@ -50,12 +50,21 @@ manner similar to the Unix :program:`man` command. The synopsis line of a
module is the first line of its documentation string.
You can also use :program:`pydoc` to start an HTTP server on the local machine
-that will serve documentation to visiting Web browsers. :program:`pydoc -p 1234`
-will start a HTTP server on port 1234, allowing you to browse
-the documentation at ``http://localhost:1234/`` in your preferred Web browser.
+that will serve documentation to visiting Web browsers. :program:`pydoc -p 1234`
+will start a HTTP server on port 1234, allowing you to browse the
+documentation at ``http://localhost:1234/`` in your preferred Web browser.
+Specifying ``0`` as the port number will select an arbitrary unused port.
+
:program:`pydoc -g` will start the server and additionally bring up a
small :mod:`tkinter`\ -based graphical interface to help you search for
-documentation pages.
+documentation pages. The ``-g`` option is deprecated, since the server can
+now be controlled directly from HTTP clients.
+
+:program:`pydoc -b` will start the server and additionally open a web
+browser to a module index page. Each served page has a navigation bar at the
+top where you can *Get* help on an individual item, *Search* all modules with a
+keyword in their synopsis line, and go to the *Module index*, *Topics* and
+*Keywords* pages.
When :program:`pydoc` generates documentation, it uses the current environment
and path to locate modules. Thus, invoking :program:`pydoc spam`
@@ -69,3 +78,4 @@ be overridden by setting the :envvar:`PYTHONDOCS` environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
+.. versionchanged:: 3.2
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst
index 7184f62..1083979 100644
--- a/Doc/whatsnew/3.2.rst
+++ b/Doc/whatsnew/3.2.rst
@@ -566,7 +566,6 @@ New, Improved, and Deprecated Modules
(Contributed by R. David Murray, :issue:`10321`.)
-
* The :mod:`inspect` module has a new function :func:`getgenatorstate`
to easily identify the current state of a generator as one of
``GEN_CREATED``, ``GEN_RUNNING``, ``GEN_SUSPENDED`` or ``GEN_CLOSED``.
@@ -583,6 +582,12 @@ New, Improved, and Deprecated Modules
- non-UTF8 percent encoding of non-ASCII characters
Issue 2987 for IPv6 (RFC2732) support in urlparse
+* The :mod:`pydoc` module now provides a much improved Web server interface,
+ as well as a new command-line option to automatically open a browser
+ window to display that server.
+
+ (Contributed by Ron Adam; :issue:`2001`.)
+
Multi-threading
===============