Since Python 2.6, it seems the documentation is in the new reStructuredText format, and it doesn't seem very easy to build a Texinfo Info file out of the box anymore.
I'm an Emacs addict and prefer my documentation installed in Info.
Does anyone have Python 2.6 or later docs in Texinfo format? How did you convert them? Or, is there a maintained build somewhere out there?
I know I can use w3m or haddoc to view the html docs - I really want them in Info.
I've played with Pandoc but after a few small experiments it doesn't seem to deal well with links between documents, and my larger experiment - running it across all docs cat'ed together to see what happens - is still chugging along two days since I started it!
Two good answers
Highlighting two answers below, because SO won't allow me to accept both answers:
- @wilfred-hughes: Installing from MELPA is the quickest way to get pre-build info into Emacs
- @alioth: Building it yourself looks like it's a lot easier than when I asked this question in 2009
Michael Ernst used to maintain Info formats of Python docs:
http://www.cs.washington.edu/homes/mernst/software/#python-info
You can try using his makefile and html2texi script to generate an updated version. Both are linked at the above URL. I'm not sure how well it works now (the last version was around 2001), but his script is well commented (grep for "python").
Python docs are now generated using Sphynx framework. This framework does not have texinfo output format. Currently it has:
Maybe you can get what you want using the Latex output. With the text output you will lost the cross ref.
Personnaly I prefer using pydoc when I want textual output. With Vim I have a shorcut to call pydoc and open a window with the doc for the entity under my cursor...
I've packaged up the Python docs as a texinfo file.
If you're using Emacs with MELPA, you can simply install this with
M-x package-install python-info
.With no doubt it would be cool and challenging to generate the Python documentation on your particular Python version by yourself. Just follow EmacsWiki, or feel free to compile it locally (at Debian Jessy for Python3.4.2):
I got this tree:
And now it is possible to review python documentation natively in Emacs by
python-info is a filename (fourth in the tree above), and even to bookmark some arbitrary nodes for habitual and regular reviewing convenience.
Another "workaround" is to execute
pydoc
as suggested by Nikokrock directly in Emacs:Jon Waltman http://bitbucket.org/jonwaltman/sphinx-info has forked sphinx and written a texinfo builder, it can build the python documentation (I've yet done it). It seems that it will be merged soon into sphinx.
Here's the quick links for the downloads (temporary):
Steps to generate python doc in texinfo format:
Download the python source code
Download and install the sphinx-info package (in a virtualenv)
Enter in the Python/Doc directory from the python sources
Edit the Makefile, to the
build
target replace$(PYTHON) tools/sphinx-build.py
withsphinx-build
, then add this target to the makefile, pay attention, the space before echo is a TAB:Edit the Python/Doc/conf.py adding:
Then run
make texinfo
and it should produce the texifile in the build/texinfo directory. To generate the info file runmakeinfo python.texi