Commit a832bdab authored by Fred Drake's avatar Fred Drake

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.
parent e50e6332
...@@ -88,6 +88,9 @@ BUILDINDEX=$(TOOLSDIR)/buildindex.py ...@@ -88,6 +88,9 @@ BUILDINDEX=$(TOOLSDIR)/buildindex.py
PYTHONDOCS="See <i><a href=\"about.html\">About this document...</a></i> for information on suggesting changes." PYTHONDOCS="See <i><a href=\"about.html\">About this document...</a></i> for information on suggesting changes."
HTMLBASE= file:`pwd` 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 end of this should reflect the major/minor version numbers of
# the release: # the release:
WHATSNEW=whatsnew23 WHATSNEW=whatsnew23
...@@ -287,7 +290,7 @@ paper-$(PAPER)/$(WHATSNEW).pdf: ...@@ -287,7 +290,7 @@ paper-$(PAPER)/$(WHATSNEW).pdf:
# conversions, as described above. See also the README file. # conversions, as described above. See also the README file.
info: info:
cd $(INFODIR) && $(MAKE) cd $(INFODIR) && $(MAKE) EMACS=$(EMACS)
# Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to # Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
# HTML converter. For more info on this program, see # HTML converter. For more info on this program, see
......
...@@ -4,70 +4,67 @@ TOPDIR=.. ...@@ -4,70 +4,67 @@ TOPDIR=..
TOOLSDIR=$(TOPDIR)/tools TOOLSDIR=$(TOPDIR)/tools
HTMLDIR=$(TOPDIR)/html HTMLDIR=$(TOPDIR)/html
# The emacs binary used to build the info docs. GNU Emacs 21 is required.
EMACS=emacs
MKINFO=$(TOOLSDIR)/mkinfo MKINFO=$(TOOLSDIR)/mkinfo
SCRIPTS=$(TOOLSDIR)/html2texi.pl $(TOOLSDIR)/checkargs.pm $(TOOLSDIR)/mkinfo \ SCRIPTS=$(TOOLSDIR)/checkargs.pm $(TOOLSDIR)/mkinfo $(TOOLSDIR)/py2texi.el
$(TOOLSDIR)/fixinfo.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 \ all: check-emacs-version \
python-ref.info python-tut.info \ python$(VERSION)-api.info python$(VERSION)-ext.info \
python-dist.info python-inst.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) check-emacs-version:
$(MKINFO) $< @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) python$(VERSION)-api.info: ../api/api.tex $(SCRIPTS)
$(MKINFO) $< EMACS=$(EMACS) $(MKINFO) $< $@
python-lib.info: $(HTMLDIR)/lib/lib.html $(SCRIPTS) python$(VERSION)-ext.info: ../ext/ext.tex $(SCRIPTS)
$(MKINFO) $< 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. # Not built by default; the conversion doesn't really handle it well.
python-mac.info: $(HTMLDIR)/mac/mac.html $(SCRIPTS) python$(VERSION)-mac.info: ../mac/mac.tex $(SCRIPTS)
$(MKINFO) $< EMACS=$(EMACS) $(MKINFO) $< $@
python$(VERSION)-ref.info: ../ref/ref.tex $(SCRIPTS)
EMACS=$(EMACS) $(MKINFO) $< $@
python-ref.info: $(HTMLDIR)/ref/ref.html $(SCRIPTS) python$(VERSION)-tut.info: ../tut/tut.tex $(SCRIPTS)
$(MKINFO) $< EMACS=$(EMACS) $(MKINFO) $< $@
python-tut.info: $(HTMLDIR)/tut/tut.html $(SCRIPTS) # Not built by default; the conversion doesn't handle it at all.
$(MKINFO) $< python$(VERSION)-doc.info: ../doc/doc.tex $(SCRIPTS)
EMACS=$(EMACS) $(MKINFO) $< $@
python-dist.info: $(HTMLDIR)/dist/dist.html $(SCRIPTS) python$(VERSION)-dist.info: ../dist/dist.tex $(SCRIPTS)
$(MKINFO) $< EMACS=$(EMACS) $(MKINFO) $< $@
python-inst.info: $(HTMLDIR)/inst/inst.html $(SCRIPTS) # Not built by default; the conversion chokes on two @end multitable's
$(MKINFO) $< python$(VERSION)-inst.info: ../inst/inst.tex $(SCRIPTS)
EMACS=$(EMACS) $(MKINFO) $< $@
clean: clean:
rm -f *.texi~ *.texi rm -f *.texi~ *.texi
clobber: clean clobber: clean
rm -f *.texi python-*.info python-*.info-[0-9]* 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
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
Python Standard Documentation Python Standard Documentation
* Python Library: (python-lib). Python Library Reference * Python Library: (python-lib). Python Library Reference
* Python Mac Modules: (python-mac). Python Macintosh Modules
* Python Reference: (python-ref). Python Reference Manual * Python Reference: (python-ref). Python Reference Manual
* Python Distutils: (python-dist). Distributing Python Modules
* Python API: (python-api). Python/C API Reference Manual * Python API: (python-api). Python/C API Reference Manual
* Python Extending: (python-ext). Extending & Embedding Python * Python Extending: (python-ext). Extending & Embedding Python
* Python Mac Modules: (python-mac). Python Macintosh Modules
* Python Tutorial: (python-tut). Python Tutorial * 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
...@@ -17,7 +17,12 @@ MAKEINFO=${MAKEINFO:-makeinfo} ...@@ -17,7 +17,12 @@ MAKEINFO=${MAKEINFO:-makeinfo}
FILENAME="$1" FILENAME="$1"
DOCDIR=`dirname "$FILENAME"` DOCDIR=`dirname "$FILENAME"`
DOCFILE=`basename "$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: # Now build the real directory names, and locate our support stuff:
WORKDIR=`pwd` WORKDIR=`pwd`
...@@ -31,18 +36,20 @@ cd $WORKDIR ...@@ -31,18 +36,20 @@ cd $WORKDIR
run() { run() {
# show what we're doing, like make does: # show what we're doing, like make does:
echo "$*" echo "$*"
$* || exit $? "$@" || exit $?
} }
# generate the Texinfo file: # generate the Texinfo file:
run $PERL -I$TOOLSDIR $TOOLSDIR/html2texi.pl $DOCDIR/$DOCFILE run $EMACS -batch -q --no-site-file -l $TOOLSDIR/py2texi.el \
run $EMACS -batch -l $TOOLSDIR/fixinfo.el $DOCNAME.texi --eval "(setq py2texi-dirs '(\"./\" \"../texinputs/\" \"$DOCDIR\"))" \
rm -f $DOCNAME.texi~ --eval "(py2texi \"$DOCDIR/$DOCFILE\")" \
-f kill-emacs
echo Done
# generate the .info files: # generate the .info files:
run $MAKEINFO --footnote-style end --fill-column 72 \ run $MAKEINFO --footnote-style end --fill-column 72 \
--paragraph-indent 0 $DOCNAME.texi --paragraph-indent 0 --output=$INFONAME $DOCNAME.texi
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment