<commit_before>#!/bin/sh

XT_PATH="/Applications/XML/XT"
SAX_PATH="/Applications/XML/XT"
XP_PATH="/Applications/XML/XP"
# XT_PATH="/usr/local/XT"
# SAX_PATH="/usr/local/XT"
# XP_PATH="/usr/local/XP"

XSLT="lgthtml.xsl"


if [ -z "$1" ]; then
	title="Entity documentation index"
else
	title="$1"
fi

echo
echo This script converts all .xml files in the current directory to .html
echo files applying the XSLT transformation defined in the $XSLT file
echo using the James Clark XT XSLT Java processor.
echo
echo An index.html file, containing links to all .html documenting files,
echo is automatically generated. This file uses the script optional parameter 
echo value as the title of the index.html file.
echo
echo converting XML files to HTML...

for file in *.xml; do
	echo "  converting" $file
	name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`"
	eval java -cp ${XT_PATH}/xt.jar:${SAX_PATH}/sax.jar:${XP_PATH}/xp.jar -Dcom.jclark.xsl.sax.parser=com.jclark.xml.sax.CommentDriver com.jclark.xsl.sax.Driver $file $XSLT $name.html
done

echo conversion done
echo
echo generating index file...

echo "" > index.html

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" >> index.html
echo "<html>" >> index.html
echo "<head>" >> index.html
echo "    <title>"$title"</title>" >> index.html
echo "    <link rel=\"stylesheet\" href=\"logtalk.css\" type=\"text/css\">" >> index.html
echo "</head>" >> index.html
echo "<body>" >> index.html
echo "<h1>"$title"</h1>" >> index.html
echo "<ul>" >> index.html

for file in *.xml; do
	name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`"
	echo "  indexing" $name.html
	echo "    <li><a href=\""$name.html"\">"$name"</a></li>" >> index.html
done

echo "</ul>" >> index.html

date="`eval date`"

echo "<p>Generated on "$date"</p>" >> index.html
echo "</body>" >> index.html
echo "</html>" >> index.html

echo index file generated
echo
<commit_msg>Added reference to new XSLT file lgtxhtml.xsl.<commit_after>#!/bin/sh

XT_PATH="/Applications/XML/XT"
SAX_PATH="/Applications/XML/XT"
XP_PATH="/Applications/XML/XP"
# XT_PATH="/usr/local/XT"
# SAX_PATH="/usr/local/XT"
# XP_PATH="/usr/local/XP"

XSLT="lgthtml.xsl"
# XSLT="lgtxhtml.xsl"

if [ -z "$1" ]; then
	title="Entity documentation index"
else
	title="$1"
fi

echo
echo This script converts all .xml files in the current directory to .html
echo files applying the XSLT transformation defined in the $XSLT file
echo using the James Clark XT XSLT Java processor.
echo
echo An index.html file, containing links to all .html documenting files,
echo is automatically generated. This file uses the script optional parameter 
echo value as the title of the index.html file.
echo
echo converting XML files to HTML...

for file in *.xml; do
	echo "  converting" $file
	name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`"
	eval java -cp ${XT_PATH}/xt.jar:${SAX_PATH}/sax.jar:${XP_PATH}/xp.jar -Dcom.jclark.xsl.sax.parser=com.jclark.xml.sax.CommentDriver com.jclark.xsl.sax.Driver $file $XSLT $name.html
done

echo conversion done
echo
echo generating index file...

echo "" > index.html

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" >> index.html
echo "<html>" >> index.html
echo "<head>" >> index.html
echo "    <title>"$title"</title>" >> index.html
echo "    <link rel=\"stylesheet\" href=\"logtalk.css\" type=\"text/css\">" >> index.html
echo "</head>" >> index.html
echo "<body>" >> index.html
echo "<h1>"$title"</h1>" >> index.html
echo "<ul>" >> index.html

for file in *.xml; do
	name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`"
	echo "  indexing" $name.html
	echo "    <li><a href=\""$name.html"\">"$name"</a></li>" >> index.html
done

echo "</ul>" >> index.html

date="`eval date`"

echo "<p>Generated on "$date"</p>" >> index.html
echo "</body>" >> index.html
echo "</html>" >> index.html

echo index file generated
echo

{'fraction_non_alphanumeric': 0.1975025484199796, 'fraction_numerical': 0.0050968399592252805, 'mean_word_length': 3.9371069182389937, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '445575', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1376, 'n_words': 397}