blob: 8857ef835bbd645a7c3739c8f002c6ad010ba40b [file] [log] [blame]
Fred Drake89201561998-05-07 14:53:55 +00001#! /bin/sh
2#
Fred Drakef6b6bbc1998-08-11 14:10:40 +00003# Drive HTML generation for a Python manual.
Fred Drake89201561998-05-07 14:53:55 +00004#
Fred Drakef43ce001999-02-16 20:05:43 +00005# This is probably *not* useful outside of the standard Python documentation,
6# but suggestions are welcome and should be sent to <python-docs@python.org>.
Fred Drakef6b6bbc1998-08-11 14:10:40 +00007#
8# The first arg is required and is the designation for which manual to build;
9# api, ext, lib, ref, or tut. All other args are passed on to latex2html.
Fred Drake89201561998-05-07 14:53:55 +000010
11WORKDIR=`pwd`
12cd `dirname $0`/..
13srcdir=`pwd`
14cd $WORKDIR
15
Fred Drakec1db5121999-04-29 18:28:48 +000016use_logical_names=true
17
18if [ "$1" = "--numeric" ] ; then
19 use_logical_names=''
20 shift 1
21fi
22
Fred Drake89201561998-05-07 14:53:55 +000023part=$1; shift 1
24
25TEXINPUTS=$srcdir/$part:$TEXINPUTS
26export TEXINPUTS
27
28if [ -d $part ] ; then
Fred Drake323dc701998-05-11 18:41:16 +000029 rm -f $part/*.html
Fred Drake89201561998-05-07 14:53:55 +000030fi
31
Fred Drakef6b6bbc1998-08-11 14:10:40 +000032echo "latex2html -init_file $srcdir/perl/l2hinit.perl -dir $part" \
Fred Drakea4565b01998-05-15 17:14:17 +000033 "${1:+$@} $srcdir/$part/$part.tex"
Fred Drakef4166a41998-05-08 04:00:56 +000034latex2html \
35 -init_file $srcdir/perl/l2hinit.perl \
Fred Drake7777e361998-11-30 20:27:31 +000036 -address '<hr>Send comments to <a href="mailto:python-docs@python.org">python-docs@python.org</a>.' \
Fred Drakea4565b01998-05-15 17:14:17 +000037 -dir $part \
Fred Drakef4166a41998-05-08 04:00:56 +000038 ${1:+$@} \
Fred Drakef43ce001999-02-16 20:05:43 +000039 $srcdir/$part/$part.tex || exit $?
Fred Drake89201561998-05-07 14:53:55 +000040
Fred Drakefcf57ad1999-02-16 20:28:25 +000041# copy in the stylesheet
42echo "cp $srcdir/html/style.css $part/$part.css"
43cp $srcdir/html/style.css $part/$part.css || exit $?
44
Fred Drakec1db5121999-04-29 18:28:48 +000045if [ "$use_logical_names" ] ; then
46 echo "(cd $part; $srcdir/tools/node2label.pl \*.html)"
47 cd $part
48 $srcdir/tools/node2label.pl *.html || exit $?
49else
50 echo "Skipping use of logical file names due to --numeric."
51fi