%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% test.tex                                                  %
%                                                           %
% Please DON'T try to understand the code of this file---it %
% can be harmful to your eyes and brain!                    %
%                                                           %
%                                gurari@cis.ohio-state.edu  %
%                    http://www.cis.ohio-state.edu/~gurari  %
%             ftp.cis.ohio-state.edu : pub/tex/osu/gurari/  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\ifx \SCRIPT\UnDef
   \ifx \DOS\UnDef
       \def\SCRIPT{
          \Needs{cp \FN.tex \WWW \FN.txt}
          \Needs{chmod 644 \WWW \FN.txt}
          \ifx \perl\UnDef
             \Needs{\TEX\space \FN }
             \Needs{\TEX\space \FN }
             \Needs{\TEX\space \FN }
             \Needs{tex4ht \FN}
             \Needs{chmod 700 \FN.lg }
             \Needs{./\FN.lg }
          \else
             \Needs{ht \TEX\space
                 \FN\space
                 \WWW\space
                 -m644}
          \fi
       }
   \else          % dos batch file
       \def\SCRIPT{
             \Needs{call ht \TEX\space  \FN}
             \Needs{if exist \FN.txt del \FN.txt}
             \Needs{ren \FN.tex \FN.txt}
       }
\fi\fi


\ifx \DOS\UnDef \else \def\HTML{htm}\fi
\ifx \HTML\UnDef  \def\HTML{html}   \fi

\ifx \documentclass\undef \else
   \documentclass{article}
\fi
\input TeX4ht.sty
\def\temp{html}\ifx \HTML\temp
   \Preamble{html,no_^}
\else
   \Preamble{htm,no_^}
\fi
   \ifx \documentclass\undef \else
      \begin{document}
   \fi

\ifx \perl\UnDef
   \Configure{Needs}{#1}
\else
   \Configure{Needs}{l. \the\inputlineno\space--- needs --- "#1" ---}
\fi

\newlinechar=`\^^J

\ifx \WWW\UnDef \let\WWW=\empty \fi
\ifx \DOS\UnDef\else
%      \Needs{CLS} % clear screen
\fi


\ifx \CALL\UnDef
   \def\TEX{\ifx \documentclass\undef \else la\fi tex}
\else
   \def\TEX#1#2{\def\TEX{\ifx \documentclass\undef #1\else #2\fi}}
   \expandafter\TEX\CALL
\fi

\edef\type{\ifx \documentclass\undef \else  a\fi}

\def\\#1\\{\expandafter\noexpand\csname#1\endcsname}
\catcode`\#=11 \def\Sharp{#} \catcode`\#=6
\def\source#1#2{
   \def\doc##1##2##3{#2}
   \Advance\FileNo by 1
   \NextFileName
   \immediate\openout15=\FN.tex
   \immediate\write16{--- Writing file \FN.tex}%
   \SCRIPT
   \immediate\write15{\ifx \documentclass\undef \else
      \noexpand \documentclass{article}                ^^J^^J\fi
      \noexpand \input TeX4ht.sty                            ^^J
      \noexpand \Preamble{\HTML#1}                            ^^J
                   \ifx \documentclass\undef \else
      \noexpand \begin{document}                          ^^J\fi
      \noexpand \EndPreamble                              ^^J^^J
      \doc{PSALMS (131:1)}
          {My heart is not haughty, nor                      ^^J
             mine eyes lofty:}
          {neither do I                                      ^^J
             exercise  myself in great                       ^^J
             matters, or in things too high                  ^^J
            for me.}                                      ^^J^^J
      {\\sl\\ Example \FileNo\space (out of \examples)}   ^^J^^J
      \noexpand \end\ifx \documentclass\undef \else
          {document}\fi    }
   \immediate\closeout15
   \Link[\FN f.\HTML\space TARGET="X"]{}{}\FileNo\EndLink
   \File+{\FN f.\HTML}
      \HorFrames{*,*}
         \Frame[\romannumeral\FileNo\type.txt]{}
         \Frame[\romannumeral\FileNo\type.\HTML]{}
      \EndPreamble
         \Link[\romannumeral\FileNo\type.txt]{}{}outcome\EndLink{} /
         \Link[\romannumeral\FileNo\type.\HTML]{}{}source\EndLink{} /
         \Link{1}{}pointers\EndLink
   \EndFile{\FN f.\HTML}
}

\def\NextFileName{\edef\FN{\romannumeral\FileNo\type}}

\Assign\examples=0\LikeRef{count}
\Assign\FileNo=1  \NextFileName

  \VerFrames{7*,*}
  \Frame[\FN f.\HTML\space NAME="X"]{}
  \Frame[ NAME="Y"]{1}

\EndPreamble

\Link[\FN.txt]{}{}source\EndLink{}  /
\Link[\FN.\HTML]{}{}outcome\EndLink{} /

\Assign\FileNo=0

\HPage{Pointers}\Link{}{1}~\EndLink

Goto to Example:
\source{,fonts}{#1^^J^^J#2^^J^^J#3}
  \def\HR{^^J\\HCode\\{<HR>}^^J}
\source{,fonts}{\HR #1 \HR #2 \HR #3 \HR}
\source{,fonts}{{\\bf\\#1}^^J^^J{\\it\\#2}^^J^^J{\\tt\\#3}}
\source{,fonts}{\\HPage\\{#1}^^J^^J#2^^J^^J#3^^J^^J
    \\ExitHPage\\{}\\EndHPage\\{}}
%
\ifx \documentclass\undef
\source{,fonts}{\\Contribute\\{halign}{BORDER<>0 1 < 0 2 - 0 3 > }^^J
\\halign\\{&\Sharp\\cr\\#1^^J&^^J#2^^J&^^J#3\\cr\\}}
\else
\source{,fonts}{\string\begin{tabular}{|l|c|r|}^^J
#1^^J&^^J#2^^J&^^J#3^^J
\string\end{tabular}}
\fi
%
  \def\d{\\scriptstyle\\ \\diamondsuit\\
    \\diamondsuit\\ \\diamondsuit\\ }
\ifx \documentclass\undef
\source{,fonts}{^^J
\\settabs\\ 6 \\columns\\^^J
\\+\\PSALMS & (131:1)\\cr\\^^J
\\+\\My heart & is not haughty,\\cr\\ ^^J
\\+\\nor mine &  eyes lofty:\\cr\\^^J
\\settabs\\ \\+\\ neither & do I exercise & \\cr\\^^J
\\+\\neither & do I exercise \\cr\\^^J
\\+\\        & myself in & great matters, \\cr\\^^J
\\+\\or      & in things & too high for me. \\cr\\^^J
}
\else
\source{,fonts}{^^J
\\begin\\{tabbing}^^J
XXXXXXXXX \\=\\\\kill\\^^J
PSALMS \\>\\ (131:1) \string\\^^J
My heart \\>\\ is not haughty, \string\\^^J
nor mine \\>\\  eyes lofty:\string\\^^J
neither \\=\\ do I exercise \\=\\ \\kill\\^^J
neither \\>\\ do I exercise \string\\^^J
        \\>\\ myself in \\>\\ great matters, \string\\^^J
or      \\>\\ in things \\>\\ too high for me. \string\\^^J
\\end\\{tabbing}^^J
}
\fi
%
\source{,fonts}{\\Picture\\+{ ALIGN="LEFT"}\\vtop\\{\\hsize\\=2in
     \\hrule\\\\smallskip\\ #1\\smallskip\\\\hrule\\}\string
     \EndPicture^^J #2^^J\\(\\ \d \\)\\ ^^J#3 $\d$}
\EndHPage{}

 \Tag{count}{\FileNo}

\end{document}
\endinput
