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