JavaHelp is an online documentation system for use by Java-based applications.
- It can be activated with the ‘javahelp’ options. For instance, ‘htlatex jobname "html,3.2,javahelp,unicode,3" " -cmozhtf -u10" "-cjavahelp"’.
- Supports HTML 3.2 (+?) and (some?) CSS 1.0 as imported files as well
as style attributes.
TeX4ht does the following for JavaHelp
- Creates keys for the entries in the table of contents and the index
- Maps the keys into th erl’s of the toc and the index (jobname.jhm)
- Maps the keys to the entries referenced by the toc (jobname-jht.xml) and
to the entries referenced by the toc (jobname-jhi.xml)
- Creates a manifest of the files (jhelpset.hs), under the assumption that
jhindexer set a search directory at jobname-jhs ‘java -jar /n/gold/5/gurari/javahelp.dir/jh1.1.3/javahelp/bin/jhindexer.jar
-db jobname-jhs *.html’
The javahelp.4ht file should not be loaded before the leading \tableofcontents
command got active.
\:CheckOption{-css} \if:Option \else
\Log:Note{to ignore CSS code, use the command line option ‘-css}
\:CheckOption{css-in} \if:Option
\Log:Note{the inline CSS code is extracted from the input of the
previous compilation, so an extra compilation might be needed}
\Configure{@HEAD}{<.css inline.>}
\else
\Log:Note{for inline CSS code, use the command line option ‘css-in’}
\Configure{@HEAD}{\HCode{<link
rel="stylesheet" type="text/css"
href="\aa:CssFile"\xml:empty>\Hnewline}}
\fi
\fi -_-_-
\openin15=\jobname .css
\ifeof15 \:warning{Missing file: \jobname .css }%
\else
\bgroup
\catcode‘\{=12 \catcode‘\}=12 \catcode‘\%=12 \catcode‘\#=12
\HCode{\Hnewline<style type="text/css">\Hnewline <!-- \Hnewline}%
\loop
\read15 to \:temp
\def\:tempa{\par}\ifx \:temp\:tempa \let\:temp\empty \fi
\ifeof15\else
\expandafter\tmp:toks\expandafter{\:temp}%
\HCode{\the\tmp:toks \Hnewline}%
\repeat
\HCode{\Hnewline-->\Hnewline</style>\Hnewline}%
\egroup
\fi
\closein15
-_-_-
<.0,32,4 preambles.>
\ifx \a:FontCss:\:UnDef
\Configure{FontCss}{Font\string_Css##1}
{Font\string_Css\string_Plus\space##1}
\fi
\expandafter\ifx \csname aa:Css\endcsname\relax
\Configure{Css}{Css: ##1}
\fi -_-_-
\def\Css#1{{\def\:temp{\Configure{Needs}}%
\expandafter\:temp\expandafter{\aa:Css}\Needs{#1}}}
-_-_-
\ScriptCommand{\CssFile}{%
\immediate\write-1{--- file \aa:CssFile\space ---}%
\def\FontSize##1##2{\:Context{##1}\ht:special{t4ht;\%##2}\%}%
\def\FontName##1{\:Context{##1}\ht:special{t4ht;=}}%
\def\:Context##1{\ht:special{t4ht>\jobname.tmp}##1\ht:special
{t4ht>\aa:CssFile}}%
\ht:special{t4ht>\jobname.tmp}\ht:special{t4ht>\aa:CssFile}%
\bgroup \everypar{}\NoFonts \bb:CssFile \hfil\break}
{\egroup \EndNoFonts
\ht:special{t4ht<\aa:CssFile}\ht:special{t4ht<\jobname.tmp}}
\let\Css:File=\CssFile
\def\CssFile{\futurelet\:temp\Css:Fl}
\def\Css:Fl{\ifx [\:temp \expandafter\Css:fl
\else \expand:after{\Css:File \space}\fi}
\def\Css:fl[#1]{\Css:File\space \css:files #1,,<.par del.>}
\def\css:files#1,#2<.par del.>{\def\:temp{#1}\ifx \:temp\empty
\else \def\:temp{\in:css#1.<.par del.>\css:files#2,,<.par del.>}\fi
\:temp }
\def\in:css#1.#2<.par del.>{\def\:temp{#2}\ifx \:temp\empty
\inc:ss#1.css<.par del.>
\else \inc:ss#1.#2<.par del.>\fi}
\def\inc:ss#1.<.par del.>{<.input css file.> }
\NewConfigure{CssFile}[2]{\def\aa:CssFile{#1}\def\bb:CssFile{#2}} -_-_-
{\ifdim \lastskip>\z@ \unskip\fi \IgnorePar\parindent\z@
\leavevmode}%
\immediate\write-1{--- file \aa:CssFile\space ---}%
\ht:special{t4ht>\aa:CssFile}\ht:special{t4ht=\Hnewline /* css.sty */}%
\ht:special{t4ht<\aa:CssFile}%
-_-_-
\immediate\openin15=#1
\ifeof15 \immediate\closein15
\:warning{Missing file: #1}%
\else \immediate\closein15 \input #1 \fi
-_-_-
\:CheckOption{pic-tabular} \if:Option \else
\ConfigureEnv{tabular}
{<.configure tabular noalign.>%
\IgnorePar<.inline comment.>\EndP\HCode{<div class="tabular">}%
\PushStack\Col:Marg\AllColMargins
}
{\HCode{</div>}\PopStack\Col:Marg\AllColMargins\ShowPar
<.configure clear noalign.>%
<.try env inline par.>%
}{}{}
\Css{div.tabular, div.center div.tabular {text-align: center;
margin-top:0.5em; margin-bottom:0.5em; }}
\Css{table.tabular td p{margin-top:0em;}}
\Css{table.tabular {margin-left: auto;
margin-right: auto;}} centering
\fi -_-_-
\AllColMargins Return a binary string in which 1 represents a column, and 0
represents a ‘@’. \ColMargins retrieves the zeros before the 1’s that represent the
current and following 1’s.
\def\ColMargins{%
\ifx \AllColMargins\empty
\:warning{Empty \string\AllColMargins}%
\else
\tmp:cnt=\HCol\relax
\expandafter\nosp:hbr\AllColMargins 1//%
\fi }
\def\nosp:hbr#11#2//{\ifnum \tmp:cnt>1 \advance\tmp:cnt by -1
\nosp:hbr#2//\else\nosp:gt#11#2//\fi}
\def\nosp:gt#11#21#3//{%
\def\:temp{#1}\ifx \:temp\empty 1\else 0\fi
\def\:temp{#2}\ifx \:temp\empty 1\else 0\fi}
-_-_-
\Configure{VBorder}
{\global\let\oldVBorder=\empty}
{\gdef\oldVBorder{border="1"}}
{}{}
\Configure{halignTB<>}{tabular}{\HCode{id="TBL-\TableNo"
class="tabular"\Hnewline
\oldVBorder \GROUPS\Hnewline
}<>\HAlign}
\Css{table[rules] {border-left:solid black 0.4pt;
border-right:solid black 0.4pt; }}
\:CheckOption{pic-tabular} \if:Option \else
\Configure{tabular}
{\ifvmode \IgnorePar\fi \EndP \halignTB{tabular}\putVBorder }
{\HCode{</table>}}
{\HCode{<tr \Hnewline}\halignTR
\HCode{ id="TBL-\TableNo-\HRow-">}}
{\r:HA}
{\HCode{<td \ifnum \HMultispan>1 colspan="\HMultispan"\fi}%
\halignTD \HCode{ id="TBL-\TableNo-\HRow-\HCol"
\Hnewline class="td}<.tabular td align.>%
\HCode{">}<.td save EndP.>%
<.start array par box.>\PushStack\Table:Stck\TableNo}
{<.end array par box.>\PopStack\Table:Stck\TableNo \d:HA}
\fi
\def\R:HA{\HCode{<tr \Hnewline}\halignTR\HCode{>}}
\def\r:HA{\HCode{</tr>}}
\def\D:HA{<.td save EndP.> \HCode{<td
\ifnum \HMultispan>1 colspan="\HMultispan"\fi}%
\halignTD \HCode{\Hnewline>}\ShowPar\par}
\def\d:HA{\ifvmode \IgnorePar \fi \EndP\HCode{</td>}<.td recall EndP.>}
<.configuring @().>
\Css{td.td00{ padding-left:0pt; padding-right:0pt; }}
\Css{td.td01{ padding-left:0pt; padding-right:5pt; }}
\Css{td.td10{ padding-left:5pt; padding-right:0pt; }}
\Css{td.td11{ padding-left:5pt; padding-right:5pt; }} -_-_-
\Configure{noalign}%
{\f:tabular\d:tabular \HCode{<tr><td colspan="\ar:cnt">}}
{\HCode{</td></tr>}\pend:def\TableNo{0}\c:tabular\e:tabular}%
-_-_-
\ifvmode\else\HCode{<!--tex4ht:inline-->}\fi
-_-_-
\Configure{noalign}{}{}%
-_-_-
\ShowPar \par{\HCondtrue\noindent}%
-_-_-
\NoFonts
\bgroup
\ifx \ttfamily\:UnDef \else \ttfamily\fi
\ColMargins
\egroup
\EndNoFonts
-_-_-
\Configure{halignTB<>}{array}{\HCode{id="TBL-\TableNo" class="array"\Hnewline
\GROUPS\Hnewline
}<>\HAlign}
\Css{table[rules] {border-left:solid black 0.4pt;
border-right:solid black 0.4pt; }}
\:CheckOption{pic-array} \if:Option \else
\Configure{array}
{\ifvmode \IgnorePar\fi \EndP\halignTB{array}\putVBorder}
{\HCode{</table>}}
{\R:HA}
{\r:HA}
{\D:HA\HCode{<div class="td}<.tabular td align.>%
\HCode{">}<.start array par box.>\pic:env}
{<.end array par box.>\HCode{</div>}\d:HA}
\Configure{arrayparbox}{\ShowPar}
\fi -_-_-
\let\VBorder=\empty \let\AllColMargins=\empty
\Configure{VBorder}
{\let\VBorder=\empty \let\AllColMargins=\empty
\global\let\GROUPS=\empty \HAssign\NewGroup = 0
\gHAdvance\Next:TableNo by 1 \global\let\TableNo=\Next:TableNo
\global\let\oldVBorder=\empty
}
{\xdef\VBorder{\VBorder\ifnum \NewGroup> 0 </colgroup>\fi}
\HAssign\NewGroup = 0 \gdef\GROUPS{rules="groups"}%
\gdef\oldVBorder{border="1" }%
}
{\Advance:\NewGroup by 1
\ifnum \NewGroup=1 \xdef\VBorder{\VBorder<colgroup
id="TBL-\TableNo-\ar:cnt g">}\fi
\xdef\VBorder{\VBorder<col\Hnewline id="TBL-\TableNo
-\ar:cnt"\xml:empty>}\xdef\AllColMargins{\AllColMargins1}}
{\xdef\AllColMargins{\AllColMargins 0}}
% \Configure{HBorder}
% {<tr\Hnewline class="hline">} {<td><hr\xml:empty></td>} {</tr>}
% {<tr\Hnewline class="cline">}
% {<td></td>} {<td><hr\xml:empty></td>} {</tr>}
% {<tr\Hnewline class="vspace" style="font-size:\HBorderspace">}
% {<td\Hnewline>\string </td>} {</tr>}
% \Configure{putHBorder}{\HCode{\HBorder}}
\HAssign\Next:TableNo=0 \global\let\TableNo=\Next:TableNo
\Css{.hline hr, .cline hr{ height : 1px; margin:0px; }}
-_-_-
\def\putVBorder{\expandafter\put:VBorder\VBorder</><.par del.>}
\def\put:VBorder#1</#2>#3<.par del.>{\def\:temp{#2}\ifx\:temp\empty
\HCode{\VBorder}%
\def\:temp{#1}\ifx\:temp\empty \else\HCode{</colgroup>}\fi
\else \def\:temp{\put:VBorder#3<.par del.>}\expandafter\:temp\fi
} -_-_-
\Configure{multicolumn}
{\let\col:Css\empty
\Configure{VBorder}
{}
{\edef\col:Css{\col:Css
border-\ifnum \ar:cnt=0 left\else right\fi
:solid black 0.4pt;}%
}{}{}%
}
{\ifx \col:Css\empty \else
\Css{td\#TBL-\TableNo-\HRow-\HCol{\col:Css}}%
\fi
}
{\ifvmode\IgnorePar\fi
\HCode{<div class="multicolumn" }\HColAlign\HCode{>}%
\ifx \col:Css\empty \else
\Css{td\#TBL-\TableNo-\HRow-\HCol{\col:Css}}%
\fi
}
{\ifvmode\IgnorePar\fi \EndP\HCode{</div>}}
-_-_-
\def\pic:env{%
\def\begin##1{\bgroup
\def\end####1{\o:end:{####1}\EndPicture\egroup}%
\ifx \EndPicture\:UnDef
\Picture+{ class="##1" style="text-align:middle"}%
\else \let\EndPicture=\empty\fi
\o:begin:{##1}}%
}
-_-_-
\Configure{halignTD} {}{}
{<}{\HCode{ style="white-space:nowrap; text-align:left;"}}
{-}{\HCode{ style="white-space:nowrap; text-align:center;"}}
{>}{\HCode{ style="white-space:nowrap; text-align:right;"}}
{^}{\HCode{ style="vertical-align:top; white-space:nowrap;"}}
{=}{\HCode{ style="vertical-align:baseline; white-space:nowrap;"}}
{|}{\HCode{ style="vertical-align:middle; white-space:nowrap;"}}
{_}{\HCode{ style="vertical-align:bottom; white-space:nowrap;"}}
{p}{\HCode{ style="white-space:wrap; text-align:left;"}\Protect\a:HColWidth}
{m}{\HCode{ style="white-space:nowrap; text-align:left; vertical-align:middle;"}}
{b}{\HCode{ style="white-space:nowrap; text-align:left; vertical-align:baseline;"}}
{}
\NewConfigure{HColWidth}{1}
\Configure{HColWidth}{}
-_-_-
\:CheckOption{pic-longtable} \if:Option
\ConfigureEnv{longtable}
{\IgnorePar\EndP\Tg<div class="pic-longtable">\Picture*{}}
{\EndPicture\Tg</div>}{}{}
\Css{div.pic-longtable {text-align:center;}}
\else
\Log:Note{for pictorial longtable,
use the command line option ‘pic-longtable’}
\fi
-_-_-
\Configure{halignTB<>}{longtable}{\HCode{id="TBL-\TableNo"
class="longtable"\Hnewline
\oldVBorder \GROUPS\Hnewline
}<>\HAlign}
\Css{table[rules] {border-left:solid black 0.4pt;
border-right:solid black 0.4pt; }}
\Configure{longtable}
{\IgnorePar\EndP
\HCode{<.show input line no.><div class="longtable">}%
\halignTB{longtable}\putVBorder }
{\HCode{</table></div>}}
{\HCode{<tr \Hnewline}\halignTR\HCode{ id="TBL-\TableNo-\HRow-">}}
{\r:HA}
{\HCode{<td \ifnum \HMultispan>1 colspan="\HMultispan"\fi}%
\halignTD \HCode{ id="TBL-\TableNo-\HRow-\HCol"
\Hnewline class="td}<.tabular td align.>%
\HCode{">}<.td save EndP.>%
<.start array par box.>\PushStack\Table:Stck\TableNo}
{\PopStack\Table:Stck\TableNo <.end array par box.>\d:HA}
\Css{div.longtable{text-align:center;}}
\Configure{longtableparbox}{\IgnorePar\leavevmode\ShowPar\par} -_-_-
<!--l. \the\inputlineno-->%
-_-_-
\Configure{@classz}
{\let\begin:current@color=\relax
\let\end:current@color=\relax }
{%
\ifx \CT@column@color\relax \else
\ifx \CT@column@color\empty \else{%
\def\CT@color{\@ifnextchar[\color:ii\color:i}%
\CT@column@color<.par del.>%
\edef\:temp{\noexpand\add:color
{background-color}{\:temp}{\ar:cnt}}\:temp
}\fi \fi
}
{\begin:current@color}
{\end:current@color}
\Configure{rowcolor}{\row:clr}
\def\row:clr#1{{%
\HAdvance\HRow by 1
\add:color{background-color}{#1}{\HRow-}}}
\Configure{text-colortbl}
{\add:color{color}{\current@color}{\HRow-\HCol}}
\Configure{cell-colortbl}
{\add:color{background-color}{\current@color}{\HRow-\HCol}}
\def\add:color#1#2#3{%
\Configure{SetHColor}{\Css{ \#TBL-\TableNo-#3{ #1:\HColor }}}{#2}} -_-_-
\HAssign\textcolorN=0
\Configure{colorbox}
{\bgroup
\gHAdvance\textcolorN by 1
\ifvmode \let\v:colorbox\def \IgnorePar \EndP
\else \let\v:colorbox=\relax \fi
<.colorbox background.>%
\HCode{<\ifx \v:colorbox\def div\else span\fi \Hnewline
class="colorbox" id="colorbox\textcolorN">}}%
{\ifx \v:colorbox\def \EndP\HCode{</div>}\par
\else \HCode{</span>}\fi
\egroup
} -_-_-
\Configure{textcolor}
{\gHAdvance\textcolorN by 1
\Configure{color}%
{\Configure{SetHColor}
{\Css{span\#textcolor\textcolorN{color:\HColor}}}}%
\HCode{<span id="textcolor\textcolorN">}}%
{\HCode{</span>}}
-_-_-
\let\A:color=\a:color
\Configure{color}%
{\let\a:color=\A:color
\Configure{SetHColor}
{\Css{\ifx \v:colorbox\def div\else span\fi
\#colorbox\textcolorN{background-color:\HColor;}}}}%
-_-_-
\Configure{fcolorbox}
{\gHAdvance\textcolorN by 1
\let\A:color=\a:color
\Configure{color}%
{\Configure{SetHColor}{\Css{\#colorbox\textcolorN{border:
solid 1px \HColor;}}}}%
\Configure{fbox}{\leavevmode
\gHAdvance\textcolorN by -1 \let\a:color=\A:color}{}}
{}
\Configure{fcolorbox}
{\bgroup\gHAdvance\textcolorN by 1
\ifvmode \let\v:colorbox\def \IgnorePar \EndP
\else \let\v:colorbox=\relax \fi
\HCode{<\ifx \v:colorbox\def div\else span\fi \Hnewline
class="colorbox" id="colorbox\textcolorN">}%
<.fcolorbox border.>%
\Configure{fbox}{\leavevmode }{}%
}
{\ifx \v:colorbox\def \EndP\HCode{</div>}\par
\else \HCode{</span>}\fi \egroup} -_-_-
\let\A:color=\a:color
\Configure{color}%
{<.fcolor background.>%
\Configure{SetHColor}{%
\Css{\#colorbox\textcolorN{border: solid 1px \HColor;}}}%
}% -_-_-
\Configure{color}%
{\let\a:color=\A:color
\Configure{SetHColor}{%
\Css{\#colorbox\textcolorN{background-color: \HColor;}}%
}}%
-_-_-
\Configure{textbf}
{\ifimmediate\else \Protect\HCode{<b>}\fi}
{\ifimmediate\else \Protect\HCode{</b>}\fi}
\Configure{textit}
{\ifimmediate\else \Protect\HCode{<i>}\fi}
{\ifimmediate\else \Protect\HCode{</i>}\fi}
\Configure{textsl}
{\ifimmediate\else \Protect\HCode{<i>}\fi}
{\ifimmediate\else \Protect\HCode{</i>}\fi}
\Configure{texttt}
{\ifimmediate\else \Protect\HCode{<tt>}\fi}
{\ifimmediate\else \Protect\HCode{</tt>}\fi}
\Configure{emph}
{\ifimmediate\else \Protect\HCode{<em>}\fi}
{\ifimmediate\else \Protect\HCode{</em>}\fi}
-_-_-
\Configure{jhxml}
{%
\let\textbf\empty
\let\textit\empty
\let\textsl\empty
\let\texttt\empty
\let\textsc\empty
\let\emph\empty
}
-_-_-
\Configure{jhxml}
{%
\let\IeC\empty
}
-_-_-
\Configure{jhxml}
{%
\expandafter\def\csname
a:frenchb-thinspace\endcsname##1frenchb-thinspace\endcsname{}%
}
-_-_-
\expandafter\let\csname jha:ftsp\expandafter\endcsname
\csname a:frenchb-thinspace\endcsname
\expandafter\def\csname a:frenchb-thinspace\endcsname{%
\ifimmediate
\expandafter\jha:ftspignore
\else
\expandafter\jha:ftsp
\fi
}
\def\jha:ftspignore#1frenchb-thinspace\endcsname{}
-_-_-
\Configure{uline}
{\HCode{<span class="uline">}} {\HCode{</span>}}
\Css{.uline{ text-decoration:underline; }}
\Configure{uuline}
{\HCode{<span class="uuline">}} {\HCode{</span>}}
\Css{.uuline{ text-decoration:underline; }}
\Configure{sout}
{\HCode{<span class="sout">}} {\HCode{</span>}}
\Css{span.sout {text-decoration: line-through }}
\Configure{xout}
{\HCode{<span class="xout"><span class="underline">}}
{\HCode{</span></span>}}
\Css{span.xout {text-decoration: line-through }}
\Configure{uwave}
{\HCode{<span class="uwave">}}
{\HCode{</span>}}
\Css{span.uwave {text-decoration:underline }}
-_-_-