echo off
if %1.==. goto Usage

if NOT exist %1.txt goto FNFound

echo 	Creating xdvng devanagari files
del del*.*
translit -i %1.txt -o del1.txt -t f:\itrans\bin\itx2iht1.tbl
translit -i del1.txt -o del2.txt -t f:\itrans\bin\itx2iht2.tbl
translit -i del2.txt -o del3.txt -t f:\itrans\bin\itx2iht3.tbl
copy f:\itrans\bin\iht.hdr + del3.txt + f:\itrans\bin\iht.trl del.iht
itrans -v -i del.iht -o %1.html
translit -i del.iht -o del.htm -t f:\itrans\bin\iht2htm.tbl
copy del.htm %1_itrans.html

echo 	Creating washington indic roman CSX files
del del3.txt
translit -i del2.txt -o del3.txt -t f:\itrans\bin\itx2ihtroman3.tbl
copy f:\itrans\bin\alllangs.hdr + del3.txt + f:\itrans\bin\iht.trl del.iht
itrans -v -i del.iht -o %1_roman.html

echo 	Creating itxbeng bengali files
del del3.txt
translit -i del2.txt -o del3.txt -t f:\itrans\bin\itx2ihtbeng3.tbl
copy f:\itrans\bin\alllangs.hdr + del3.txt + f:\itrans\bin\iht.trl del.iht
itrans -v -i del.iht -o %1_beng.html

echo 	Creating itxguj gujarati files
del del3.txt
translit -i del2.txt -o del3.txt -t f:\itrans\bin\itx2ihtguj3.tbl
copy f:\itrans\bin\ihtguj.hdr + del3.txt + f:\itrans\bin\iht.trl del.iht
itrans -v -i del.iht -o %1_guj.html

echo 	Creating adhawin-tamil files
del del*.*
translit -i %1.txt -o del1.txt -t f:\itrans\bin\itx2tam1.tbl
translit -i del1.txt -o del2.txt -t f:\itrans\bin\itx2tam2.tbl
translit -i del2.txt -o del3.txt -t f:\itrans\bin\tam2fix.tbl
copy f:\itrans\bin\tml-iht1.hdr + del3.txt + f:\itrans\bin\tml-iht.trl del.htm
itrans -v -i del.htm -o %1_tamil234.html
copy f:\itrans\bin\tml-iht2.hdr + del3.txt + f:\itrans\bin\tml-iht.trl del.htm
itrans -v -i del.htm -o %1_tamil.html

goto cleanup

REM --------------------------------------------------------------------------
:FNFound
echo.
echo File %1.txt not found.
echo.
goto end


REM --------------------------------------------------------------------------
:Usage
echo.
echo 	Usage: 	 all Source_File 
echo 	Example: all test
echo.
echo    This will create devanagari, roman, bengali, gujarati
echo    and tamil HTML files using true-type fonts
echo.
echo 	Source_file should have .txt extension 
echo 	but it should not be mentioned while starting program
echo    Please see test.txt for a sample file with sanskrit text
echo.
echo    File should have the following format text in first 2 lines
echo    and it should end in english mode with a ##
echo.
echo    \engtitle{.. Puja Start -- for Testing ..}##
echo    \itxtitle{.. puujaa vidhaana praarambha ..}##\endtitles##
echo.
echo.
goto end

REM --------------------------------------------------------------------------
:cleanup

echo removing %1 extra files....

del del*.*

REM --------------------------------------------------------------------------
:end


