mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00

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.
55 lines
1.2 KiB
Bash
Executable file
55 lines
1.2 KiB
Bash
Executable file
#! /bin/sh
|
|
# -*- Ksh -*-
|
|
|
|
# Script to drive the HTML-info conversion process.
|
|
# Pass in a single parameter: the name of the top-level HTML file
|
|
# generated by LaTeX2HTML.
|
|
#
|
|
# Written by Fred L. Drake, Jr. <fdrake@acm.org>
|
|
|
|
PERL=${PERL:-perl}
|
|
EMACS=${EMACS:-emacs}
|
|
MAKEINFO=${MAKEINFO:-makeinfo}
|
|
|
|
|
|
# Normalize file name since something called by html2texi.pl seems to
|
|
# screw up with relative path names.
|
|
FILENAME="$1"
|
|
DOCDIR=`dirname "$FILENAME"`
|
|
DOCFILE=`basename "$FILENAME"`
|
|
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`
|
|
cd `dirname $0`
|
|
TOOLSDIR=`pwd`
|
|
cd $DOCDIR
|
|
DOCDIR=`pwd`
|
|
cd $WORKDIR
|
|
|
|
|
|
run() {
|
|
# show what we're doing, like make does:
|
|
echo "$*"
|
|
"$@" || exit $?
|
|
}
|
|
|
|
|
|
# generate the Texinfo file:
|
|
|
|
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 --output=$INFONAME $DOCNAME.texi
|