How do you get Python documentation in Texinfo Info format?

后端 未结 10 1333
眼角桃花
眼角桃花 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 07:47

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

    sudo apt-get install python3-sphinx
    cd ~/Desktop
    wget https://www.python.org/ftp/python/3.4.2/Python-3.4.2rc1.tar.xz
    tar -xf Python-3.4.2rc1.tar.xz
    cd Python-3.4.2rc1/Doc/
    sphinx-build -b texinfo -d build/doctrees . build/texinfo
    # extra time to build
    cd build/texinfo/
    makeinfo python.texi
    # extra time for convertation
    

    I got this tree:

    .                                                                                                                              
    ├── logging_flow.png                                                                                                           
    ├── Makefile                                                                                                                   
    ├── pathlib-inheritance.png                                                                                                    
    ├── python.info                                                                                                                
    ├── python.info-1                                                                                                              
    ├── python.info-10                                                                                                             
    ├── python.info-11                                                                                                             
    ├── python.info-12                                                                                                             
    ├── python.info-13                                                                                                             
    ├── python.info-14                                                                                                             
    ├── python.info-15                                                                                                             
    ├── python.info-16                                                                                                             
    ├── python.info-17                                                                                                             
    ├── python.info-18                                                                                                             
    ├── python.info-19                                                                                                             
    ├── python.info-2                                                                                                              
    ├── python.info-20                                                                                                             
    ├── python.info-21                                                                                                             
    ├── python.info-22                                                                                                             
    ├── python.info-23                                                                                                             
    ├── python.info-24                                                                                                             
    ├── python.info-25                                                                                                             
    ├── python.info-26                                                                                                             
    ├── python.info-27                                                                                                             
    ├── python.info-28                                                                                                             
    ├── python.info-29                                                                                                             
    ├── python.info-3                                                                                                              
    ├── python.info-30                                                                                                             
    ├── python.info-31                                                                                                             
    ├── python.info-32                                                                                                             
    ├── python.info-33                                                                                                             
    ├── python.info-34                                                                                                             
    ├── python.info-4                                                                                                              
    ├── python.info-5                                                                                                              
    ├── python.info-6                                                                                                              
    ├── python.info-7                                                                                                              
    ├── python.info-8                                                                                                              
    ├── python.info-9                                                                                                              
    ├── python.texi                                                                                                                
    ├── python-video-icon.png                                                                                                      
    ├── tulip_coro.png                                                                                                             
    └── turtle-star.png
    

    And now it is possible to review python documentation natively in Emacs by

    C-u C-h i python-info RET

    python-info is a filename (fourth in the tree above), and even to bookmark some arbitrary nodes for habitual and regular reviewing convenience.

提交回复
热议问题