From: Fred Drake Date: Fri, 3 May 2002 04:54:20 +0000 (+0000) Subject: Integrated SF patch #539487 by Matthias Klose: X-Git-Tag: v2.2.2b1~382 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f9f19e1ccbf027eb8d5dcca285bd3bd1b6c74c1;p=thirdparty%2FPython%2Fcpython.git Integrated SF patch #539487 by Matthias Klose: This patch adds Milan Zamazal's conversion script and modifies the mkinfo script to build the info doc files from the LaTeX sources. Currently, the mac, doc and inst TeX files are not handled. Explicitly checks for GNU Emacs 21. --- diff --git a/Doc/Makefile b/Doc/Makefile index f3327993eb1b..60b38df90c14 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -88,6 +88,9 @@ BUILDINDEX=$(TOOLSDIR)/buildindex.py PYTHONDOCS="See About this document... for information on suggesting changes." HTMLBASE= file:`pwd` +# The emacs binary used to build the info docs. GNU Emacs 21 is required. +EMACS= emacs + # The end of this should reflect the major/minor version numbers of # the release: WHATSNEW=whatsnew22 @@ -287,7 +290,7 @@ paper-$(PAPER)/$(WHATSNEW).pdf: # conversions, as described above. See also the README file. info: - cd $(INFODIR) && $(MAKE) + cd $(INFODIR) && $(MAKE) EMACS=$(EMACS) # Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to # HTML converter. For more info on this program, see diff --git a/Doc/info/Makefile b/Doc/info/Makefile index a2c44d3f65ca..88c0d6ec7386 100644 --- a/Doc/info/Makefile +++ b/Doc/info/Makefile @@ -4,70 +4,67 @@ TOPDIR=.. TOOLSDIR=$(TOPDIR)/tools HTMLDIR=$(TOPDIR)/html +# The emacs binary used to build the info docs. GNU Emacs 21 is required. +EMACS=emacs + MKINFO=$(TOOLSDIR)/mkinfo -SCRIPTS=$(TOOLSDIR)/html2texi.pl $(TOOLSDIR)/checkargs.pm $(TOOLSDIR)/mkinfo \ - $(TOOLSDIR)/fixinfo.el +SCRIPTS=$(TOOLSDIR)/checkargs.pm $(TOOLSDIR)/mkinfo $(TOOLSDIR)/py2texi.el + +# set VERSION to code the VERSION number into the info file name +# allowing installation of more than one set of python info docs +# into the same directory +VERSION= -all: python-api.info python-ext.info python-lib.info \ - python-ref.info python-tut.info \ - python-dist.info python-inst.info +all: check-emacs-version \ + python$(VERSION)-api.info python$(VERSION)-ext.info \ + python$(VERSION)-lib.info python$(VERSION)-ref.info \ + python$(VERSION)-tut.info python$(VERSION)-dist.info +# python$(VERSION)-doc.info python$(VERSION)-inst.info +# python$(VERSION)-mac.info -python-api.info: $(HTMLDIR)/api/api.html $(SCRIPTS) - $(MKINFO) $< +check-emacs-version: + @v="`$(EMACS) --version 2>&1 | egrep '^(GNU |X)Emacs [12]*'`"; \ + if `echo "$$v" | grep '^GNU Emacs 21' >/dev/null 2>&1`; then \ + echo "Using $(EMACS) to build the info docs"; \ + else \ + echo "GNU Emacs 21 is required to build the info docs"; \ + echo "Found $$v"; \ + false; \ + fi -python-ext.info: $(HTMLDIR)/ext/ext.html $(SCRIPTS) - $(MKINFO) $< +python$(VERSION)-api.info: ../api/api.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ -python-lib.info: $(HTMLDIR)/lib/lib.html $(SCRIPTS) - $(MKINFO) $< +python$(VERSION)-ext.info: ../ext/ext.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ + +python$(VERSION)-lib.info: ../lib/lib.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ # Not built by default; the conversion doesn't really handle it well. -python-mac.info: $(HTMLDIR)/mac/mac.html $(SCRIPTS) - $(MKINFO) $< +python$(VERSION)-mac.info: ../mac/mac.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ + +python$(VERSION)-ref.info: ../ref/ref.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ -python-ref.info: $(HTMLDIR)/ref/ref.html $(SCRIPTS) - $(MKINFO) $< +python$(VERSION)-tut.info: ../tut/tut.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ -python-tut.info: $(HTMLDIR)/tut/tut.html $(SCRIPTS) - $(MKINFO) $< +# Not built by default; the conversion doesn't handle it at all. +python$(VERSION)-doc.info: ../doc/doc.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ -python-dist.info: $(HTMLDIR)/dist/dist.html $(SCRIPTS) - $(MKINFO) $< +python$(VERSION)-dist.info: ../dist/dist.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ -python-inst.info: $(HTMLDIR)/inst/inst.html $(SCRIPTS) - $(MKINFO) $< +# Not built by default; the conversion chokes on two @end multitable's +python$(VERSION)-inst.info: ../inst/inst.tex $(SCRIPTS) + EMACS=$(EMACS) $(MKINFO) $< $@ clean: rm -f *.texi~ *.texi clobber: clean - rm -f *.texi python-*.info python-*.info-[0-9]* - - -# This makes sure we can build info files from a "clean" tree, -# in case we haven't already built the HTML: - -$(HTMLDIR)/api/api.html: - cd $(HTMLDIR) && $(MAKE) api - -$(HTMLDIR)/ext/ext.html: - cd $(HTMLDIR) && $(MAKE) ext - -$(HTMLDIR)/lib/lib.html: - cd $(HTMLDIR) && $(MAKE) lib - -$(HTMLDIR)/mac/mac.html: - cd $(HTMLDIR) && $(MAKE) mac - -$(HTMLDIR)/ref/ref.html: - cd $(HTMLDIR) && $(MAKE) ref - -$(HTMLDIR)/tut/tut.html: - cd $(HTMLDIR) && $(MAKE) tut - -$(HTMLDIR)/dist/dist.html: - cd $(HTMLDIR) && $(MAKE) dist - -$(HTMLDIR)/inst/inst.html: - cd $(HTMLDIR) && $(MAKE) inst + rm -f *.texi python*-*.info python*-*.info-[0-9]* diff --git a/Doc/info/python.dir b/Doc/info/python.dir index 9a09d704be52..dce2bb322aaf 100644 --- a/Doc/info/python.dir +++ b/Doc/info/python.dir @@ -2,9 +2,11 @@ Python Standard Documentation * Python Library: (python-lib). Python Library Reference +* Python Mac Modules: (python-mac). Python Macintosh Modules * Python Reference: (python-ref). Python Reference Manual -* Python Distutils: (python-dist). Distributing Python Modules * Python API: (python-api). Python/C API Reference Manual * Python Extending: (python-ext). Extending & Embedding Python -* Python Mac Modules: (python-mac). Python Macintosh Modules * Python Tutorial: (python-tut). Python Tutorial +* Documenting Python: (python-doc). Documenting Python +* Installing Modules: (python-inst). Installing Python Modules +* Distributing Modules: (python-dist). Distributing Python Modules diff --git a/Doc/tools/mkinfo b/Doc/tools/mkinfo index edba1db8e704..64fb86e42b2d 100755 --- a/Doc/tools/mkinfo +++ b/Doc/tools/mkinfo @@ -17,7 +17,12 @@ MAKEINFO=${MAKEINFO:-makeinfo} FILENAME="$1" DOCDIR=`dirname "$FILENAME"` DOCFILE=`basename "$FILENAME"` -DOCNAME=`basename "$FILENAME" .html` +DOCNAME=`basename "$FILENAME" .tex` +if [ $# -gt 1 ]; then + INFONAME="$2" +else + INFONAME="python-$DOCNAME.info" +fi # Now build the real directory names, and locate our support stuff: WORKDIR=`pwd` @@ -31,18 +36,20 @@ cd $WORKDIR run() { # show what we're doing, like make does: echo "$*" - $* || exit $? + "$@" || exit $? } # generate the Texinfo file: -run $PERL -I$TOOLSDIR $TOOLSDIR/html2texi.pl $DOCDIR/$DOCFILE -run $EMACS -batch -l $TOOLSDIR/fixinfo.el $DOCNAME.texi -rm -f $DOCNAME.texi~ +run $EMACS -batch -q --no-site-file -l $TOOLSDIR/py2texi.el \ + --eval "(setq py2texi-dirs '(\"./\" \"../texinputs/\" \"$DOCDIR\"))" \ + --eval "(py2texi \"$DOCDIR/$DOCFILE\")" \ + -f kill-emacs +echo Done # generate the .info files: run $MAKEINFO --footnote-style end --fill-column 72 \ - --paragraph-indent 0 $DOCNAME.texi + --paragraph-indent 0 --output=$INFONAME $DOCNAME.texi