<commit_before>#! /bin/sh
#
#  Drive HTML generation for a Python manual.
#
#  The first arg is required and is the designation for which manual to build;
#  api, ext, lib, ref, or tut.  All other args are passed on to latex2html.

WORKDIR=`pwd`
cd `dirname $0`/..
srcdir=`pwd`
cd $WORKDIR

part=$1; shift 1

TEXINPUTS=$srcdir/$part:$TEXINPUTS
export TEXINPUTS

if [ -d $part ] ; then
    (set -x; rm -f $part/*.html)
fi

set -x

latex2html -init_file $srcdir/perl/l2hinit.perl ${1:+$@} $srcdir/$part/$part

cd $part
$srcdir/tools/node2label.pl *.html<commit_msg>Some versions of latex2html don't automatically append the .tex extension to the name of the main .tex source file if it's not in the current directory.<commit_after>#! /bin/sh
#
#  Drive HTML generation for a Python manual.
#
#  The first arg is required and is the designation for which manual to build;
#  api, ext, lib, ref, or tut.  All other args are passed on to latex2html.

WORKDIR=`pwd`
cd `dirname $0`/..
srcdir=`pwd`
cd $WORKDIR

part=$1; shift 1

TEXINPUTS=$srcdir/$part:$TEXINPUTS
export TEXINPUTS

if [ -d $part ] ; then
    (set -x; rm -f $part/*.html)
fi

set -x

latex2html \
 -init_file $srcdir/perl/l2hinit.perl \
 ${1:+$@} \
 $srcdir/$part/$part.tex

cd $part
$srcdir/tools/node2label.pl *.html
{'fraction_non_alphanumeric': 0.13380281690140844, 'fraction_numerical': 0.013302034428794992, 'mean_word_length': 3.650909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3174305', 'n_tokens_mistral': 503, 'n_tokens_neox': 487, 'n_words': 166}