diff options
author | Fred Drake <fdrake@acm.org> | 1999-02-15 19:27:07 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-02-15 19:27:07 (GMT) |
commit | efa641c45a82970b15528b3947094bebae19ec36 (patch) | |
tree | b53f939a15de889ed68c3ebe4fb8e58895d69682 | |
parent | 3618c14f72277e8f4cc8c3faeafeef011eaf4117 (diff) | |
download | cpython-efa641c45a82970b15528b3947094bebae19ec36.zip cpython-efa641c45a82970b15528b3947094bebae19ec36.tar.gz cpython-efa641c45a82970b15528b3947094bebae19ec36.tar.bz2 |
Add an optional parameter to make the script run latex only once to
generate an .aux file. This can make HTML generation a bit faster
when print formats aren't needed.
Explained parameters in a comment.
-rwxr-xr-x | Doc/tools/mkdvi.sh | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/Doc/tools/mkdvi.sh b/Doc/tools/mkdvi.sh index 3330acc..673a969 100755 --- a/Doc/tools/mkdvi.sh +++ b/Doc/tools/mkdvi.sh @@ -1,6 +1,17 @@ #! /bin/sh # -# Build one of the simple documents. +# Build one of the simple documents. This can be used to create the DVI, +# PDF, or LaTeX "aux" files. It can accept one of three optional parameters: +# +# --aux Create only the LaTeX .aux file +# --dvi Create the DeVice Independent output +# --pdf Create Adobe PDF output +# +# If no parameter is given, DVI output is produced. +# +# One positional parameter is required: the "base" of the document to +# format. For the standard Python documentation, this will be api, ext, +# lib, mac, ref, or tut. WORKDIR=`pwd` cd `dirname $0`/.. @@ -8,10 +19,17 @@ srcdir=`pwd` cd $WORKDIR latex=latex +aux='' +pdf='' if [ "$1" = "--pdf" ] ; then pdf=true latex=pdflatex shift 1 +elif [ "$1" = "--aux" ] ; then + aux=true + shift 1 +elif [ "$1" = "--dvi" ] ; then + shift 1 fi part=$1; shift 1 @@ -23,19 +41,24 @@ echo $srcdir'/tools/newind.py >'$part'.ind' $srcdir/tools/newind.py >$part.ind || exit $? echo "$latex $part" $latex $part || exit $? -if [ -f $part.idx ] ; then - # using the index - echo $srcdir'/tools/fix_hack '$part'.idx' - $srcdir/tools/fix_hack $part.idx || exit $? - echo 'makeindex -s '$srcdir'/texinputs/python.ist '$part'.idx' - makeindex -s $srcdir/texinputs/python.ist $part.idx || exit $? +if [ "$aux" ] ; then + # make sure the .dvi isn't interpreted as useful: + rm $part.dvi else - # skipping the index; clean up the unused file - rm -f $part.ind -fi -if [ "$pdf" ] ; then - echo $srcdir'/tools/toc2bkm.py '$part - $srcdir/tools/toc2bkm.py $part + if [ -f $part.idx ] ; then + # using the index + echo $srcdir'/tools/fix_hack '$part'.idx' + $srcdir/tools/fix_hack $part.idx || exit $? + echo 'makeindex -s '$srcdir'/texinputs/python.ist '$part'.idx' + makeindex -s $srcdir/texinputs/python.ist $part.idx || exit $? + else + # skipping the index; clean up the unused file + rm -f $part.ind + fi + if [ "$pdf" ] ; then + echo $srcdir'/tools/toc2bkm.py '$part + $srcdir/tools/toc2bkm.py $part + fi + echo "$latex $part" + $latex $part || exit $? fi -echo "$latex $part" -$latex $part || exit $? |