Books/NT/latex/Makeme.sh
2026-06-30 08:19:02 -07:00

78 lines
2.1 KiB
Bash

DEST_FNT="/docume~1/willia~1/mydocu~1/prj/websites/faithfulbible.com/web/httpdocs"
#DEST_TOC="/docume~1/willia~1/mydocu~1/prj/websites/teachingsofthechrist.org/web/httpdocs"
# create the HTML
# NOTE: Only update the HTML as necessary
makefnt="N"
# source: filename
# fnt: in FNT
# toc: in Teachings of the Christ
while read source fnt toc; do
#empty
if [ -z $source ]
then
continue;
fi
#comment
if [[ $source == [#]* ]]
then
continue;
fi
fileroot=`echo $source | sed 's/w-//'`
echo $fileroot.tex
# output needs to be created?
if [ $fileroot.tex -ot $fileroot.htm ]
then
continue;
fi
# create w-.tex and w-.tcp?
if [ ! -e $source.tex ]
then
sed <_blank._tex "s/SOURCE/$fileroot/" >$source.tex
sed <_blank._tcp "s/SOURCE/$fileroot/" >$source.tcp
fi
# latex
/tth/tth -u -w1 <$source.tex | \
sed 's#<h3>Footnotes:</h3>##' | \
grep -v '<br /><br /><hr /><small>File translated from' | \
grep -v 'T<sub><font size="-1">E</font></sub>X' | \
grep -v 'by <a href="http://hutchinson.belmont.ma.us/tth/">' | \
grep -v 'T<sub><font size="-1">T</font></sub>H</a>,' | \
grep -v 'version 3.74.<br' | \
sed 's#<hr#<hr align=left size=1 width="33%"#' | \
sed "s_<EMDASH>_\&#8212;_g" | \
sed "s_<ENDASH>_\&#8211;_g" | \
sed "s_</head>_<meta http-equiv='Content-Type' content='text/html; charset=utf-8'><link rel=StyleSheet type=text/css href='style.css'></head>_" | \
sed "s?</body>?<script src='http://www.google-analytics.com/urchin.js' type='text/javascript'></script><script type='text/javascript'>_uacct = 'UA-961393-2';urchinTracker();</script></body>?" |\
DeTTH >$fileroot.htm
if [ "Y" == $fnt ]
then
makefnt="Y"
cp $fileroot.htm "$DEST_FNT/nt"
fi
# if [ "Y" == $toc ]
# then
# cp $fileroot.htm "$DEST_TOC/text"
# fi
done <makeme.list
# create the PDF
if [ "Y" == $makefnt ]
then
pdflatex w-FaithfulNT.tex
#echo cp w-FaithfulNT.pdf "$DEST_FNT/FaithfulNT.pdf"
cp w-FaithfulNT.pdf "$DEST_FNT/FaithfulNT.pdf"
fi