blob: 85a66b780b8b66b1d53fca1145f56231344cc594 [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
Fred Drake5bd608d1999-10-29 20:51:43 +000019 use_logical_names=false
Fred Drakec1db5121999-04-29 18:28:48 +000020 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 \
Fred Draked2d1eef1999-05-03 14:27:45 +000035 -no_auto_link \
Fred Drakef4166a41998-05-08 04:00:56 +000036 -init_file $srcdir/perl/l2hinit.perl \
Fred Drake5bd608d1999-10-29 20:51:43 +000037 -address '<hr>See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.' \
Fred Drakea4565b01998-05-15 17:14:17 +000038 -dir $part \
Fred Drakef4166a41998-05-08 04:00:56 +000039 ${1:+$@} \
Fred Drakef43ce001999-02-16 20:05:43 +000040 $srcdir/$part/$part.tex || exit $?
Fred Drake89201561998-05-07 14:53:55 +000041
Fred Draked2d1eef1999-05-03 14:27:45 +000042cp $part/$part.html $part/index.html
43
Fred Drakefcf57ad1999-02-16 20:28:25 +000044# copy in the stylesheet
45echo "cp $srcdir/html/style.css $part/$part.css"
46cp $srcdir/html/style.css $part/$part.css || exit $?
47
Fred Drake5bd608d1999-10-29 20:51:43 +000048if $use_logical_names ; then
Fred Drakec1db5121999-04-29 18:28:48 +000049 echo "(cd $part; $srcdir/tools/node2label.pl \*.html)"
50 cd $part
51 $srcdir/tools/node2label.pl *.html || exit $?
52else
53 echo "Skipping use of logical file names due to --numeric."
54fi