├── .gitignore ├── python-2.6.6.info.gz ├── python-2.7.6.info.gz ├── python-3.0.1.info.gz ├── python-3.1.3.info.gz ├── python-3.2.5.info.gz ├── python-3.3.2.info.gz ├── README.org ├── conf.py └── Makefile /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /python-2.6.6.info.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/politza/python-info/HEAD/python-2.6.6.info.gz -------------------------------------------------------------------------------- /python-2.7.6.info.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/politza/python-info/HEAD/python-2.7.6.info.gz -------------------------------------------------------------------------------- /python-3.0.1.info.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/politza/python-info/HEAD/python-3.0.1.info.gz -------------------------------------------------------------------------------- /python-3.1.3.info.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/politza/python-info/HEAD/python-3.1.3.info.gz -------------------------------------------------------------------------------- /python-3.2.5.info.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/politza/python-info/HEAD/python-3.2.5.info.gz -------------------------------------------------------------------------------- /python-3.3.2.info.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/politza/python-info/HEAD/python-3.3.2.info.gz -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | 2 | * Howto build python's documentation in texinfo format 3 | 1. Install the latest sphinx with python2 . 4 | 2. Download the desired python distribution. 5 | 3. Build the info file as follows. 6 | #+begin_src sh 7 | cd Python-x.y.z/Doc 8 | sphinx-build -b texinfo -d build/doctrees . build/texinfo 9 | cd build/texinfo && make 10 | #+end_src 11 | 12 | Or use the Makefile. 13 | -------------------------------------------------------------------------------- /conf.py: -------------------------------------------------------------------------------- 1 | #BEGIN texinfo 2 | # Don't remove the previous line. 3 | 4 | # texinfo_documents 5 | 6 | # This value determines how to group the document tree into 7 | # Texinfo source files. It must be a list of tuples (startdocname, 8 | # targetname, title, author, dir_entry, description, category, 9 | # toctree_only), where the items are: 10 | 11 | # startdocname: document name that is the “root” of the 12 | # Texinfo file. All documents referenced by it in TOC trees 13 | # will be included in the Texinfo file too. (If you want only 14 | # one Texinfo file, use your master_doc here.) 15 | 16 | # targetname: file name (no extension) of the Texinfo file in 17 | # the output directory. 18 | 19 | # title: Texinfo document title. Can be empty to use the title 20 | # of the startdoc. Inserted as Texinfo markup, so special 21 | # characters like @ and {} will need to be escaped to be 22 | # inserted literally. 23 | 24 | # author: Author for the Texinfo document. Inserted as Texinfo 25 | # markup. Use @* to separate multiple authors, as in: 26 | # 'John@*Sarah'. 27 | 28 | # dir_entry: The name that will appear in the top-level DIR menu file. 29 | 30 | # description: Descriptive text to appear in the top-level DIR menu file. 31 | 32 | # category: Specifies the section which this entry will appear 33 | # in the top-level DIR menu file. 34 | 35 | # toctree_only: Must be True or False. If True, the startdoc 36 | # document itself is not included in the output, only the 37 | # documents referenced by it via TOC trees. With this option, 38 | # you can put extra stuff in the master document that shows up 39 | # in the HTML, but not the Texinfo output. 40 | 41 | # All %s will be replaced with the version number. 42 | # DON'T CHANGE THE FILENAME (2nd item). 43 | texinfo_documents = [ 44 | ('contents', 'python-%s', 'Python Documentation', _stdauthor, 45 | 'Python-%s', 'The Python Documentation', 'Python'), 46 | ] 47 | #END texinfo 48 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #### Build python info documentation. 2 | 3 | ### Settable Variables 4 | # The sphinx-build program. 5 | SPHINX ?= sphinx-build 6 | # Root url for downloading python distributions. 7 | PYURL ?= http://www.python.org/ftp/python 8 | # Flags for sphinx-build 9 | SPHINXFLAGS ?= -q 10 | # GZip the info file (.gz or empty) 11 | GZIPEXT ?= .gz 12 | # Where to install the info files. 13 | INFODIR ?= $(HOME)/.emacs.d/info 14 | # Create info files for this python executable. 15 | PYTHON ?= python 16 | # Create info files for this python version. 17 | PYVERSION ?= $(shell $(PYTHON) --version 2>&1 | cut -d ' ' -f2) 18 | 19 | ### 20 | CONF_COOKIE=\#BEGIN texinfo 21 | DIST=build/Python-$(PYVERSION).tgz 22 | DOC_DIR=build/Python-$(PYVERSION)/Doc 23 | BUILD_DIR=$(DOC_DIR)/build/texinfo 24 | CONF=$(DOC_DIR)/conf.py 25 | TEXI=$(BUILD_DIR)/python-$(PYVERSION).texi 26 | INFO=python-$(PYVERSION).info 27 | ZINFO=$(INFO)$(GZIPEXT) 28 | 29 | .PHONY: all clean install uninstall cleanall 30 | 31 | all: $(ZINFO) 32 | 33 | $(ZINFO): $(TEXI) 34 | makeinfo --no-split -o $(INFO) $< 35 | [ -n "$(GZIPEXT)" ] && gzip $(INFO) 36 | 37 | $(TEXI): $(BUILD_DIR) 38 | @if ! which $(SPHINX) >/dev/null 2>&1; then \ 39 | echo "You need to install sphinx first"; \ 40 | false; \ 41 | fi 42 | @if ! grep -q "$(CONF_COOKIE)" "$(CONF)"; then \ 43 | echo "Appending conf.py to $(CONF)"; \ 44 | sed -e 's/\(^\|[^%]\)%s/\1$(PYVERSION)/g' \ 45 | -e 's/%%/%/g' conf.py \ 46 | >> "$(CONF)"; \ 47 | fi 48 | cd "$(DOC_DIR)" && \ 49 | $(SPHINX) $(SPHINXFLAGS) -b texinfo \ 50 | -d build/doctrees . build/texinfo 51 | 52 | $(BUILD_DIR): $(DIST) 53 | tar xzf "$<" -C build 54 | touch build/Python-$(PYVERSION) 55 | 56 | $(DIST): 57 | mkdir -p build 58 | wget "$(PYURL)/$(PYVERSION)/Python-$(PYVERSION).tgz" -O "$@" 59 | 60 | install: all 61 | cp -t $(INFODIR) $(ZINFO) 62 | install-info --info-dir="$(INFODIR)" $(ZINFO) 63 | 64 | uninstall: all 65 | rm -f -- "$(INFODIR)/$(ZINFO)" 66 | install-info --delete --info-dir="$(INFODIR)" $(ZINFO) 67 | 68 | clean: 69 | rm -rf -- build/Python-$(PYVERSION) 70 | rm -f -- $(ZINFO) 71 | 72 | cleanall: 73 | rm -rf -- build 74 | rm -f -- python-*.info$(GZIPEXT) 75 | --------------------------------------------------------------------------------