How do you get Python documentation in Texinfo Info format?

后端 未结 10 1383
眼角桃花
眼角桃花 2021-01-30 07:33

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

10条回答
  •  渐次进展
    2021-01-30 08:01

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

    • http://dl.dropbox.com/u/1276730/python.info
    • http://dl.dropbox.com/u/1276730/python.texi

    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 with sphinx-build, then add this target to the makefile, pay attention, the space before echo is a TAB:

    texinfo: BUILDER = texinfo
    texinfo: build
        @echo
        @echo "Build finished. The Texinfo files are in _build/texinfo."
        @echo "Run \`make' in that directory to run these through makeinfo" \
              "(use \`make info' here to do that automatically)."
    

    Edit the Python/Doc/conf.py adding:

    texinfo_documents = [
        ('contents', 'python', 'Python Documentation', 'Georg Brandl',
         'Python', 'The Python Programming Language', 'Documentation tools',
         1),
    ]
    

    Then run make texinfo and it should produce the texifile in the build/texinfo directory. To generate the info file run makeinfo python.texi

提交回复
热议问题