blob: 304839c60ad2f482b1527d500d3f3a84ff2855b8 [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 Drakeba828782000-04-03 04:19:14 +000030else
31 mkdir $part
Fred Drake89201561998-05-07 14:53:55 +000032fi
33
Fred Drakef6b6bbc1998-08-11 14:10:40 +000034echo "latex2html -init_file $srcdir/perl/l2hinit.perl -dir $part" \
Fred Drakea4565b01998-05-15 17:14:17 +000035 "${1:+$@} $srcdir/$part/$part.tex"
Fred Drakef4166a41998-05-08 04:00:56 +000036latex2html \
Fred Draked2d1eef1999-05-03 14:27:45 +000037 -no_auto_link \
Fred Drakeba828782000-04-03 04:19:14 +000038 -up_url '../index.html' \
39 -up_title 'Documentation Index' \
Fred Drakef4166a41998-05-08 04:00:56 +000040 -init_file $srcdir/perl/l2hinit.perl \
Fred Drake5bd608d1999-10-29 20:51:43 +000041 -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 +000042 -dir $part \
Fred Drakef4166a41998-05-08 04:00:56 +000043 ${1:+$@} \
Fred Drakef43ce001999-02-16 20:05:43 +000044 $srcdir/$part/$part.tex || exit $?
Fred Drake89201561998-05-07 14:53:55 +000045
Fred Draked2d1eef1999-05-03 14:27:45 +000046cp $part/$part.html $part/index.html
47
Fred Drakefcf57ad1999-02-16 20:28:25 +000048# copy in the stylesheet
49echo "cp $srcdir/html/style.css $part/$part.css"
50cp $srcdir/html/style.css $part/$part.css || exit $?
51
Fred Drake5bd608d1999-10-29 20:51:43 +000052if $use_logical_names ; then
Fred Drakec1db5121999-04-29 18:28:48 +000053 echo "(cd $part; $srcdir/tools/node2label.pl \*.html)"
54 cd $part
55 $srcdir/tools/node2label.pl *.html || exit $?
56else
57 echo "Skipping use of logical file names due to --numeric."
58fi