openfile(): Go back to opening the files in text mode. This undoes
[python/dscho.git] / Doc / tools / mkinfo
blob65add7c730f1d89a632697794f02a48296a30ffd
1 #! /bin/sh
2 # -*- Ksh -*-
4 # Script to drive the HTML-info conversion process.
5 # Pass in a single parameter: the name of the top-level HTML file
6 # generated by LaTeX2HTML.
8 # Written by Fred L. Drake, Jr. <fdrake@acm.org>
10 EMACS=${EMACS:-emacs}
11 MAKEINFO=${MAKEINFO:-makeinfo}
14 # Normalize file name since something called by html2texi.pl seems to
15 # screw up with relative path names.
16 FILENAME="$1"
17 DOCDIR=`dirname "$FILENAME"`
18 DOCFILE=`basename "$FILENAME"`
19 DOCNAME=`basename "$FILENAME" .tex`
20 if [ $# -gt 1 ]; then
21 INFONAME="$2"
22 else
23 INFONAME="python-$DOCNAME.info"
26 # Now build the real directory names, and locate our support stuff:
27 WORKDIR=`pwd`
28 cd `dirname $0`
29 TOOLSDIR=`pwd`
30 cd $DOCDIR
31 DOCDIR=`pwd`
32 cd $WORKDIR
35 run() {
36 # show what we're doing, like make does:
37 echo "$*"
38 "$@" || exit $?
42 # generate the Texinfo file:
44 run $EMACS -batch -q --no-site-file -l $TOOLSDIR/py2texi.el \
45 --eval "(setq py2texi-dirs '(\"./\" \"../texinputs/\" \"$DOCDIR\"))" \
46 --eval "(py2texi \"$DOCDIR/$DOCFILE\")" \
47 -f kill-emacs
48 echo Done
51 # generate the .info files:
53 run $MAKEINFO --footnote-style end --fill-column 72 \
54 --paragraph-indent 0 --output=$INFONAME $DOCNAME.texi