<commit_before>#!/bin/sh

set -x
HOME=${1:-.}
OBJDIR=${2:-.}

FOP=$HOME/fop-1.0/fop
XMLINPUT=$HOME/ironbee-reference-manual.xml
OUTPUT=$OBJDIR/output
VERSION="0.6.0"

# Generate a clean directory structure
rm -rf $OUTPUT
mkdir $OUTPUT || exit 1
mkdir $OUTPUT/html || exit 1
mkdir $OUTPUT/html-chunked || exit 1

# Generate PDF
$FOP -c $OBJDIR/fop.xconf -xml $XMLINPUT -xsl $HOME/pdf.xsl -pdf $OUTPUT/ironbee-reference-manual.pdf || exit 1

# Generate HTML/single
$FOP -xml $XMLINPUT -xsl $HOME/html.xsl -foout /dev/null -param base.dir $OUTPUT/ || exit 1
mv $OUTPUT/index.html $OUTPUT/ironbee-reference-manual.html || exit 1
# XXX Copy extra files to $OUTPUT

# Generate HTML/chunked
$FOP -xml $XMLINPUT -xsl $HOME/html-chunked.xsl -foout /dev/null -param base.dir $OUTPUT/html-chunked/ || exit 1
# XXX Copy extra files to $OUTPUT/html-chunked/

# Cover page
cp $HOME/resources/index.html $OUTPUT/index.html || exit 1
perl -pi -e s/\\\$version/$VERSION/ $OUTPUT/index.html || exit 1

<commit_msg>Update manual generation script to use VERSION.<commit_after>#!/bin/sh

set -x
HOME=${1:-.}
OBJDIR=${2:-.}

# Pull in the environment from VERSION
. $HOME/../../../VERSION

FOP=$HOME/fop-1.0/fop
XMLINPUT=$HOME/ironbee-reference-manual.xml
OUTPUT=$OBJDIR/output
VERSION=$PKG_VERSION

# Generate a clean directory structure
rm -rf $OUTPUT
mkdir $OUTPUT || exit 1
mkdir $OUTPUT/html || exit 1
mkdir $OUTPUT/html-chunked || exit 1

# Generate PDF
$FOP -c $OBJDIR/fop.xconf -xml $XMLINPUT -xsl $HOME/pdf.xsl -pdf $OUTPUT/ironbee-reference-manual.pdf || exit 1

# Generate HTML/single
$FOP -xml $XMLINPUT -xsl $HOME/html.xsl -foout /dev/null -param base.dir $OUTPUT/ || exit 1
mv $OUTPUT/index.html $OUTPUT/ironbee-reference-manual.html || exit 1
# XXX Copy extra files to $OUTPUT

# Generate HTML/chunked
$FOP -xml $XMLINPUT -xsl $HOME/html-chunked.xsl -foout /dev/null -param base.dir $OUTPUT/html-chunked/ || exit 1
# XXX Copy extra files to $OUTPUT/html-chunked/

# Cover page
cp $HOME/resources/index.html $OUTPUT/index.html || exit 1
perl -pi -e s/\\\$version/$VERSION/ $OUTPUT/index.html || exit 1


{'fraction_non_alphanumeric': 0.15601145038167938, 'fraction_numerical': 0.01383587786259542, 'mean_word_length': 3.7336343115124153, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '3381563', 'n_tokens_mistral': 790, 'n_tokens_neox': 740, 'n_words': 215}