1. Jon Waltman
  2. pydoc-info
Issue #1 resolved

Practical info to add info for other sphinx projects

Arne Babenhauserheide
created an issue

Getting the Python documentation is darn cool, so I tried to add the same for a project I contribute to.

Sadly I did not manage to add that, so a practical guide would be great:

  • What has to go into conf.py?
  • sphinx-build -b texinfo source/ texinfo/
  • Installing

Comments (2)

  1. Arne Babenhauserheide reporter

    Answered it myself, now:

    conf.py:

    # One entry per manual page. list of tuples (startdocname, targetname, title, author, dir_entry, description, category, toctree_only).
    texinfo_documents = [
      ('index', # startdocname
       'TARGETNAME', # targetname
       u'Long Title', # title
       u'Author Name', # author
       'Name in the Directory Index of Info', # dir_entry
       u'Long Description', # description
       'Software Development', # cathegory
       False),
    ]
    

    call on the shell via

    sphinx-build -b texinfo source/ texinfo/ 
    cd texinfo
    sudo install-info --info-dir=/usr/share/info TARGETNAME.info
    sudo cp TARGETNAME.info /usr/share/info/
    

    .emacs:

    ; Show python-documentation as info-pages via C-h S
    (setq load-path (cons "~/.emacs.d/libs/pydoc-info" load-path))
    (require 'pydoc-info)
    (info-lookup-add-help
       :mode 'python-mode
       :parse-rule 'pydoc-info-python-symbol-at-point
       :doc-spec
       '(("(python)Index" pydoc-info-lookup-transform-entry)
         ("(TARGETNAME)Index" pydoc-info-lookup-transform-entry)))
    
  2. Log in to comment