blob: 65add7c730f1d89a632697794f02a48296a30ffd [file] [log] [blame]
Fred Drakec58f3461999-01-08 15:27:17 +00001#! /bin/sh
2# -*- Ksh -*-
3
Fred Drakec4e92631999-01-08 15:32:27 +00004# 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.
7#
8# Written by Fred L. Drake, Jr. <fdrake@acm.org>
Fred Drakec58f3461999-01-08 15:27:17 +00009
Fred Drakec58f3461999-01-08 15:27:17 +000010EMACS=${EMACS:-emacs}
11MAKEINFO=${MAKEINFO:-makeinfo}
12
13
14# Normalize file name since something called by html2texi.pl seems to
15# screw up with relative path names.
16FILENAME="$1"
17DOCDIR=`dirname "$FILENAME"`
18DOCFILE=`basename "$FILENAME"`
Fred Drakebfc18bd2002-05-03 04:50:51 +000019DOCNAME=`basename "$FILENAME" .tex`
20if [ $# -gt 1 ]; then
21 INFONAME="$2"
22else
23 INFONAME="python-$DOCNAME.info"
24fi
Fred Drakec58f3461999-01-08 15:27:17 +000025
Fred Drakec4e92631999-01-08 15:32:27 +000026# Now build the real directory names, and locate our support stuff:
Fred Drakec58f3461999-01-08 15:27:17 +000027WORKDIR=`pwd`
28cd `dirname $0`
29TOOLSDIR=`pwd`
30cd $DOCDIR
31DOCDIR=`pwd`
32cd $WORKDIR
33
34
35run() {
Fred Drakec4e92631999-01-08 15:32:27 +000036 # show what we're doing, like make does:
37 echo "$*"
Fred Drakebfc18bd2002-05-03 04:50:51 +000038 "$@" || exit $?
Fred Drakec58f3461999-01-08 15:27:17 +000039}
40
41
42# generate the Texinfo file:
43
Fred Drakebfc18bd2002-05-03 04:50:51 +000044run $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
48echo Done
Fred Drakec58f3461999-01-08 15:27:17 +000049
50
51# generate the .info files:
52
53run $MAKEINFO --footnote-style end --fill-column 72 \
Fred Drakebfc18bd2002-05-03 04:50:51 +000054 --paragraph-indent 0 --output=$INFONAME $DOCNAME.texi