blob: 64fb86e42b2d21c2baf57ea8f37e52cb30181559 [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
10PERL=${PERL:-perl}
11EMACS=${EMACS:-emacs}
12MAKEINFO=${MAKEINFO:-makeinfo}
13
14
15# Normalize file name since something called by html2texi.pl seems to
16# screw up with relative path names.
17FILENAME="$1"
18DOCDIR=`dirname "$FILENAME"`
19DOCFILE=`basename "$FILENAME"`
Fred Drakebfc18bd2002-05-03 04:50:51 +000020DOCNAME=`basename "$FILENAME" .tex`
21if [ $# -gt 1 ]; then
22 INFONAME="$2"
23else
24 INFONAME="python-$DOCNAME.info"
25fi
Fred Drakec58f3461999-01-08 15:27:17 +000026
Fred Drakec4e92631999-01-08 15:32:27 +000027# Now build the real directory names, and locate our support stuff:
Fred Drakec58f3461999-01-08 15:27:17 +000028WORKDIR=`pwd`
29cd `dirname $0`
30TOOLSDIR=`pwd`
31cd $DOCDIR
32DOCDIR=`pwd`
33cd $WORKDIR
34
35
36run() {
Fred Drakec4e92631999-01-08 15:32:27 +000037 # show what we're doing, like make does:
38 echo "$*"
Fred Drakebfc18bd2002-05-03 04:50:51 +000039 "$@" || exit $?
Fred Drakec58f3461999-01-08 15:27:17 +000040}
41
42
43# generate the Texinfo file:
44
Fred Drakebfc18bd2002-05-03 04:50:51 +000045run $EMACS -batch -q --no-site-file -l $TOOLSDIR/py2texi.el \
46 --eval "(setq py2texi-dirs '(\"./\" \"../texinputs/\" \"$DOCDIR\"))" \
47 --eval "(py2texi \"$DOCDIR/$DOCFILE\")" \
48 -f kill-emacs
49echo Done
Fred Drakec58f3461999-01-08 15:27:17 +000050
51
52# generate the .info files:
53
54run $MAKEINFO --footnote-style end --fill-column 72 \
Fred Drakebfc18bd2002-05-03 04:50:51 +000055 --paragraph-indent 0 --output=$INFONAME $DOCNAME.texi