1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940
|
% compile 3 timws: latex tex4ht-javahelp
% or xhlatex tex4ht-javahelp "html,3,sections+"
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tex4ht-javahelp.tex %
% Copyright (C) 2003-- Eitan M. Gurari %
% %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3 of this license or (at your option) any %
% later version. The latest version of this license is %
% in %
% http://www.latex-project.org/lppl.txt %
% and version 1.3 or later is part of all distributions %
% of LaTeX version 2003/12/01 or later. %
% %
% This work has the LPPL maintenance status "maintained".%
% %
% This Current Maintainer of this work %
% is Eitan M. Gurari. %
% %
% If you modify this file your changing the signature %
% in \message{(signature)} below will be appreciated. %
% %
% gurari@cse.ohio-state.edu %
% http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\message{(<signature>)}
\documentclass{article}
\ifx \HCode\Undef
\usepackage[xhtml,sections+,3]{tex4ht}
\fi
\usepackage{url}
\usepackage{moreverb}
\Configure{ProTex}{foo,<<<>>>,title,|,list,[[]]}
\begin{document}
\newcount\tmpcnt \tmpcnt\time \divide\tmpcnt 60
\edef\temp{\the\tmpcnt}
\multiply\tmpcnt -60 \advance\tmpcnt \time
\edef\version{\the\year-\ifnum \month<10 0\fi
\the\month-\ifnum \day<10 0\fi\the\day
-\ifnum \temp<10 0\fi \temp
:\ifnum \tmpcnt<10 0\fi\the\tmpcnt}
\def\CopyYear.#1.{%
\ifnum #1=\year #1\space\space\space\space\space\space
\else #1--\the\year\fi
}
\def\JHDIR{...../}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Review}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
JavaHelp is an online documentation system for use by Java-based
applications.
It can be activated with the
`javahelp' options. For instance,
`\verb+htlatex jobname "html,3,3.2,javahelp"+'.
TeX4ht does the following for JavaHelp
\begin{itemize}
\item Creates keys for the entries in the table of contents
and the index
\item Maps the keys into th erl's of the toc and the index (jobname.jhm)
\item Maps the keys to the entries referenced by the toc (jobname-jht.xml)
and to the entries referenced by the toc (jobname-jhi.xml)
\item Creates a manifest of the files (jhelpset.hs), under the assumption
that jhindexer set a search directory at jobname-jhs
`{\tt java -jar /n/gold/5/gurari/javahelp.dir/jh1.1.3/javahelp/bin/jhindexer.jar -db jobname-jhs *.html}'
\end{itemize}
The javahelp.4ht file should not be loaded before the leading
\verb+\tableofcontents+ command got active.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{References}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{itemize}
\item \url{C:/jh1.1.3/doc/spec/FileFormat.html}
\item \url{http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/javahelp/javahelp.html}
\item \url{http://developer.java.sun.com/developer/JDCTechTips/2002/tt0423.html}
\item \url{http://developer.java.sun.com/developer/JDCTechTips/2002/tt0521.html}
\item \url{http://www.oreilly.de/catalog/creatingjavahelp/examples/}
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The JavaHelp Files}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{The HTML Documentation (*.html)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Prepare a \LaTeX{} file and compile it for HTML 3.2. For instance,
with the command {\tt htlatex jobname "html,3.2,3,javahelp"}.
% \special{t4ht>foo.log}
% \special{t4ht=...x...}
% \special{t4ht*>foo.log}
% \special{t4ht*>}
\<javahelp.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% javahelp.4ht |version %
% Copyright (C) |CopyYear.2003. Eitan M. Gurari %
|<TeX4ht copyright|>
|<instructions for log|>
|<jh defs|>
\Configure{Preamble}
{}
{|<jh at start|>}
\Configure{@/BODY}
{\relax
\ifnum \FileNumber=1
\input javahelp-a.4ht
\fi
}
>>>
\<jh defs\><<<
\def\Write:File#1#2{%
\special{t4ht>#1}%
\special{t4ht=#2}%
\special{t4ht*>#1}%
\special{t4ht*>}%
}
>>>
\<javahelp-a.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% javahelp-a.4ht |version %
% Copyright (C) |CopyYear.2003. Eitan M. Gurari %
|<TeX4ht copyright|>
\NextFile{\jobname.tmp}
\HPage{}
\bgroup
\catcode`\:=11
\catcode`\@=11
\catcode`\"=12
\Configure{PROLOG}{}
\Configure{HtmlPar}{}{}{}{}
\Configure{tableofcontents}{}{}{}{}{}
\Configure{htf}{0}{+}{}{}{}{}{}{}{}
\ScriptEnv{dito}{\IgnorePar}{}
|<jh util|>
|<jh root|>
|<jh toc|>
|<jh index|>
|<jh at end|>
\egroup
\EndHPage{}
>>>
The HPage above is to ensure the all the references in the javahelp
files will be to locations at other files, and so they will explicitly
include the names of the files being referenced. The page is empty
and not referenced by other pages.
\<instructions for log\><<<
\immediate\write-1{--------------- JavaHelp -----------------}
\immediate\write-1{The entry (HelpSet) file for the java program
is at `\jobname.hs'}
\immediate\write-1{Generate a search database
with, for instance, the command}
\immediate\write-1{ java -jar
...../jh1.1.3/javahelp/bin/jhindexer.jar
-db \jobname-jhs \jobname*.html}
\immediate\write-1{Compile the java program with a command similar to}
\immediate\write-1{ javac -classpath
...../jh1.1.3/javahelp/lib/jh.jar program.java}
\immediate\write-1{Run the java program with a command similar to}
\immediate\write-1{ java -classpath
...../jh1.1.3/javahelp/lib/jh.jar;. program}
\immediate\write-1{JavaHelp might require a compilation for HTML 3.2,
for instance,}
\immediate\write-1{ htlatex \jobname\space "html,javahelp,3.2,3"}
\immediate\write-1{------------------------------------------}
>>>
\<jh defs\><<<
\def\jhNote{%
Created for JavaHelp
(http://java.sun.com/products/javahelp/)\Hnewline
by TeX4ht (http://www.cse.ohio-state.edu/\string
~gurari/TeX4ht/)\Hnewline from \jobname.tex at \:today \space
}
>>>
We can't keep the comment boundaries
in the macro because the adjacent hyphens
in some cases merge into a n-dash
under font encoding T1. For instance,
\begin{verbatim}
\documentclass{report}
\usepackage[T1]{fontenc}
\begin{document}
\ScriptEnv{dito}{}{}
\begin{dito}
--[]-[]
\end{dito}
\end{document}
\end{verbatim}
\<tex4ht note\><<<
\jhNote
>>>
\<TeX4ht copyright\><<<
% %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3 of this license or (at your option) any %
% later version. The latest version of this license is %
% in %
% http://www.latex-project.org/lppl.txt %
% and version 1.3 or later is part of all distributions %
% of LaTeX version 2003/12/01 or later. %
% %
% This work has the LPPL maintenance status "maintained".%
% %
% This Current Maintainer of this work %
% is Eitan M. Gurari. %
% %
% If you modify this program your changing its signature %
% with a directive of the following form will be %
% appreciated. %
% \message{signature} %
% %
% gurari@cse.ohio-state.edu %
% http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version |version}
>>>
\<par del\><<<
!*?: >>>
\<jh defs\><<<
\Configure{crosslinks}{}{}{}{}{}{}{}{}{}
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{The JavaHelp Root File (HelpSet File: jobname.hs)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file introduces the files in the help distribution.
\<url of jh root file\><<<
\jobname.hs>>>
The etension name must be `hs'!
\<dtd lang\><<<
\dTdLaNg>>>
\<jh defs\><<<
\def\dTdLaNg{\expandafter
\ifx \csname a:dtd-lang\endcsname\relax EN\else
\csname a:dtd-lang\endcsname
\fi }
>>>
\<jh root\><<<
|<jh root config|>
\IgnorePar\par\leavevmode\special{t4ht>|<url of jh root file|>}%
\begin{dito}-\
<?xml version="1.0" encoding="ISO-8859-1" ?>
\end{dito}
|<helpset DTD|>
\begin{dito}-\
<!-\relax- |<tex4ht note|> -\relax->
<helpset version="\dotVersion">
<title>|<title label|></title>
<maps>
<homeID>|<home id|></homeID>
<mapref location="|<url of jh keys file|>"/>
</maps>
<view>
<name>TOC</name>
<label>|<toc label|></label>
<type>javax.help.TOCView</type>
<data>|<url of jh toc file|></data>
</view>
<view>
<name>Index</name>
<label>|<index label|></label>
<type>javax.help.IndexView</type>
<data>|<url of the jh index|></data>
</view>
<view>
<name>Search</name>
<label>|<search dir label|></label>
<type>javax.help.SearchView</type>
<data
engine="com.sun.java.help.search.DefaultSearchEngine">|<url of jh serach dir|></data>
</view>
</helpset>
\end{dito}
\IgnorePar\par\leavevmode\special{t4ht<|<url of jh root file|>}
>>>
\<toc label\><<<
\tocLabel>>>
\<index label\><<<
\indexLabel>>>
\<search dir label\><<<
Search>>>
\<title label\><<<
\titleLabel>>>
\<jh root config\><<<
\edef\tocLabel{\ifx\contentsname\:UnDef Table Of Contents\else
\ifx\contentsname\empty Table Of Contents\else
\contentsname\fi\fi}
\edef\indexLabel{\ifx\indexname\:UnDef Index\else
\ifx\indexname\empty Index\else \indexname\fi\fi}
\ifTag{TITLE+}
{\edef\titleLabel{\LikeRef{TITLE+}}}
{\def\titleLabel{\jobname}}
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{The JavaHelp Search Directory (jobname-jhs)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\<url of jh serach dir\><<<
\jobname-jhs>>>
\def\JHINDEXER{java -jar
\JHDIR jh1.1.3/javahelp/bin/jhindexer.jar
-db \jobname-jhs \jobname*.html}
Use a command similar to `{\tt \JHINDEXER}'
to create a search directory \verb+JavaHelpSearch+ for JavaHelp from the HTML pages of the documentation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{The JavaHelp Keys to URLs Mapping (jobname.jhm)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\<url of jh keys file\><<<
\jobname.jhm>>>
The homeId tag provides the default entry to present when a HelpSet is
first shown.
\<home id\><<<
\jobname>>>
The default entry point can be overwritten in:
\<entry point\><<<
\jobname>>>
Assigns keys to locations within the HTML document.
\<jh at start\><<<
\Write:File
{|<url of jh keys file|>}
{|<map preamble|>}
>>>
\<map preamble\><<<
<?xml version="1.0" encoding="ISO-8859-1" ?>\Hnewline
|<map DTD|>
\Hnewline <!-- |<tex4ht note|> -->\Hnewline
<map version="\dotVersion">\Hnewline
<mapID target="|<entry point|>" url="\jobname.html"/>\Hnewline
>>>
\<jh defs\><<<
\HAssign\mapEntry=0
>>>
\<add index entry to map\><<<
\gHAdvance\mapEntry by 1
\Write:File
{|<url of jh keys file|>}%
{<mapID target="indexentry-\mapEntry"
url="\RefFileNumber\FileNumber
\#\title:chs {dx\last:haddr}{\cur:th\:currentlabel}%
" />\Hnewline}%
>>>
\<jh defs\><<<
\AtBeginDocument{%
\let\jh:toc=\auto:toc
\expandafter\append:defI\csname tableofcontents*\endcsname{%
\global\let\jh:toc=\auto:toc }%
}
>>>
\<load table of contents\><<<
\expandafter\ifx \csname jh:toc\endcsname\relax
\tableofcontents
\else
\expandafter\expandafter\expandafter\tableofcontents
\expandafter\expandafter\expandafter[\csname
jh:toc\endcsname]%
\fi
>>>
\<jh at end\><<<
\special{t4ht>|<url of jh keys file|>}%
\bgroup
|<jh map for toc|>
\bgroup \catcode`\:=12 \catcode`\@=12 \let\contentsname\empty
|<load table of contents|>%
\egroup
\HCode {</map>\Hnewline}
\egroup
\special{t4ht*>|<url of jh keys file|>}%
\special{t4ht*>}%
>>>
\<jh map for toc\><<<
\Configure{Link}{mapID}{target="\a:mapIdTarget" url=}{}{}
\Configure{TocLink}{\Link{#2}{}\EndLink}
\let\jh:doTocEntry\:doTocEntry
\def\:doTocEntry#1#2#3{%
\edef\sectioningKey{\expandafter\gob:IV\string#1}%
\edef\:temp{\noexpand\ConfigureToc{\sectioningKey}
{}{\relax}{}{}}\:temp
|<config toc target entry|>%
\jh:doTocEntry#1{#2}{#3}}
\def\gob:IV#1#2#3#4{}
\def\sectioningKey{NoToc}
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{The JavaHelp TOC (jobname-jht.xml)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\<url of jh toc file\><<<
\jobname-jht.xml>>>
\<jh toc\><<<
\bgroup
|<jh TOC config|>
|<start jh TOC|>
|<load table of contents|>%
|<end jh TOC|>
\egroup
>>>
\<start jh TOC\><<<
\IgnorePar\par\leavevmode\special{t4ht>|<url of jh toc file|>}%
\begin{dito}-\
<?xml version="1.0" encoding="ISO-8859-1" ?>
\end{dito}
|<toc DTD|>
\begin{dito}-\
<!-\relax- |<tex4ht note|> -\relax->
<toc version="\dotVersion">
<tocitem target="|<entry point|>" text="|<title label|>|<uni sp|>">
\end{dito}
\let\end:jhhook=\empty
\catcode`\:=12 \catcode`\@=12 \let\contentsname\empty
>>>
\<end jh TOC\><<<
\catcode`\:=11 \catcode`\@=11
\end:jhhook
\begin{dito}
</tocitem>
</toc>
\end{dito}
\special{t4ht<|<url of jh toc file|>}
>>>
\<jh TOC config\><<<
\Configure{TocLink}
{\HCode{<tocitem target="\a:mapIdTarget"\Hnewline\space
text="}#4\HCode{|<uni sp|>">\Hnewline}}
\let\jh:doTocEntry\:doTocEntry
\def\:doTocEntry#1#2#3{%
\edef\sectioningKey{\expandafter\gob:IV\string#1}%
\edef\:temp{\noexpand\ConfigureToc{\sectioningKey}
{}{\noexpand\set:endtocitem{\sectioningKey}}{}{}}\:temp
|<config toc target entry|>%
\jh:doTocEntry#1{#2}{#3}}
\def\gob:IV#1#2#3#4{}
\def\sectioningKey{NoToc}
>>>
\<jh util\><<<
\def\set:endtocitem#1{%
\csname catchAt:#1\endcsname
\expandafter\ifx\csname a:end#1\endcsname\relax
\HCode{</tocitem>}%
\else
\expandafter\ifx \csname jh:#1\endcsname\relax
|<end tocitem at end of toc|>%
\def\:tempc##1,{\if ,##1,%
\expandafter\gob:pardel
\else
|<end tocitem at toc entry of diff type|>%
\expandafter\:tempc
\fi}%
\expandafter\expandafter\expandafter
\:tempc\csname a:end#1\endcsname,,|<par del|>%
\fi
|<end tocitem at toc entry of same type|>%
\fi
}
\def\gob:pardel#1|<par del|>{}
>>>
\<end tocitem at toc entry of same type\><<<
\csname jh:#1\endcsname
\expandafter\gdef\csname jh:#1\endcsname{%
\expandafter\global\expandafter\let\csname jh:#1\endcsname=\empty
\HCode{</tocitem><!--/#1-->}}%
>>>
\<end tocitem at toc entry of diff type\><<<
\expandafter\ifx \csname catchAt:##1\endcsname \relax
\expandafter\gdef\csname
catchAt:##1\endcsname{\csname jh:#1\endcsname}%
\else
\expandafter\pend:def\csname
catchAt:##1\endcsname{\csname jh:#1\endcsname}%
\expandafter\global\expandafter\let\csname
catchAt:##1\expandafter\endcsname\csname catchAt:##1\endcsname
\fi
>>>
\<end tocitem at end of toc\><<<
\append:def\end:jhhook{%
\csname jh:#1\endcsname
\expandafter\global\expandafter
\let\csname jh:#1\endcsname\:UnDef}%
\global\let\end:jhhook\end:jhhook
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{The JavaHelp Index (jobname-jhi.xml)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\<url of the jh index\><<<
\jobname-jhi.xml>>>
\<jh index\><<<
\bgroup
|<jh IDX config|>
|<start jh IDX|>
|<load index entries|>%
|<end jh IDX|>
\egroup
>>>
\<start jh IDX\><<<
\IgnorePar\par\leavevmode\special{t4ht>|<url of the jh index|>}%
\begin{dito}-\
<?xml version="1.0" encoding="ISO-8859-1" ?>
\end{dito}
|<index DTD|>
\begin{dito}-\
<!-\relax- |<tex4ht note|> -\relax->
<index version="\dotVersion">
\end{dito}
>>>
\<end jh IDX\><<<
\begin{dito}
</index>
\end{dito}
\special{t4ht<|<url of the jh index|>}%
>>>
\<load index entries\><<<
\def\beforeindex#1||LNK#2#3{#1}%
\def\indexentry#1#2{\HCode{<indexitem target="indexentry-#2"
text="}\beforeindex#1\HCode{|<uni sp|>" />\Hnewline}}%
\immediate\openin15=\jobname.4dx
\ifeof15
\immediate\closein15
\else
\immediate\closein15
\input \jobname.4dx
\fi
>>>
\<jh defs\><<<
\HAssign\indexEntry=0
\append:defI\@wrindex{%
|<add index entry to map|>%
}
>>>
JavaHelp has problems with unicode values at the end of text fields in
the toc of within the jht file: it refuses `\verb+text="Menü"+'
(but accepts `\verb+text="Menü "+'). The following adds spaces at
the end of the text attribute values.
\<uni sp\><<<
>>>
A similar problem occurs when two unicode character codes follow each
other. In this case, the second one is not properly rendered.
%%%%%%%%%%%%%
\subsection{Configuring Link Targets}
%%%%%%%%%%%%%
\<config toc target entry\><<<
\expandafter\target:info#3//%
\b:mapIdTarget
>>>
\<jh defs\><<<
\def\target:info#1#2#3#4#5#6//{%
\let\sectionType=\sectioningKey
\let\sectionId\TocCount
\Advance:\sectionId 1
\def\sectionName{#5}%
}
\NewConfigure{mapIdTarget}{2}
\Configure{mapIdTarget}
{\sectionType-\sectionId}
{}
>>>
%%%%%%%%%%%%%
\subsection{Version Information}
%%%%%%%%%%%%%
\<helpset DTD\><<<
\begin{dito}-\
<!DOCTYPE helpset PUBLIC
"-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version \dotVersion//|<dtd lang|>"
"http://java.sun.com/products/javahelp/helpset_\subVersion.dtd">
\end{dito}
>>>
\<toc DTD\><<<
\begin{dito}-\
<!DOCTYPE toc PUBLIC
"-//Sun Microsystems Inc.//DTD JavaHelp TOC Version \dotVersion//|<dtd lang|>"
"http://java.sun.com/products/javahelp/toc_\subVersion.dtd">
\end{dito}
>>>
\<index DTD\><<<
\begin{dito}-\
<!DOCTYPE index PUBLIC
"-//Sun Microsystems Inc.//DTD JavaHelp Index Version \dotVersion//|<dtd lang|>"
"http://java.sun.com/products/javahelp/index_\subVersion.dtd">
\end{dito}
>>>
\<old index DTD\><<<
<!DOCTYPE index PUBLIC
"-//Sun Microsystems Inc.//DTD JavaHelp Index Version \dotVersion//|<dtd lang|>"
"http://java.sun.com/products/javahelp/index_\subVersion.dtd">
>>>
\<map DTD\><<<
<!DOCTYPE map PUBLIC\Hnewline
"-//Sun Microsystems Inc.//DTD
JavaHelp Map Version \dotVersion//|<dtd lang|>"\Hnewline
"http://java.sun.com/products/javahelp/map_\subVersion.dtd"> >>>
\<jh defs\><<<
\:CheckOption{jh1.0} \if:Option
\def\dotVersion{1.0}
\def\subVersion{1\string_0}
\else
\def\dotVersion{2.0}
\def\subVersion{2\string_0}
\fi
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Incorporate JavaHelp into a program}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Url of JavaHelp root file (jobname.jh)
\url{http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/javahelp/javahelp.html}
\<program\><<<
import java.net.URL;
import javax.help.*;
import javax.swing.*;
public class program {
//^^^^^^^
public static void main(String args[]) {
JHelp helpViewer=null;
try {
ClassLoader cl = program.class.getClassLoader();
//^^^^^^^
URL url = HelpSet.findHelpSet(cl,
"|<url of jh root file|>");
HelpSet hs = new HelpSet(cl, url);
helpViewer = new JHelp( hs );
/*
helpViewer.setCurrentID("|<entry point|>");
*/
} catch (Exception e) {
System.out.println("error"); System.exit(0);
}
JFrame frame = new JFrame();
frame.getContentPane().add(helpViewer);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(500,500);
frame.setVisible(true);
}
}
>>>
%%%%%%%%%%%%%%%%%%%%%
\subsection{Compiling}
%%%%%%%%%%%%%%%%%%%%%
\def\JAVAC{javac -classpath \JHDIR jh1.1.3/javahelp/lib/jh.jar program.java}
Add JavaHelp to your program, say `program.java', and compile the
program with the command `{\tt \JAVAC}'.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Running}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\RUN{java -classpath \JHDIR jh1.1.3/javahelp/lib/jh.jar;. program}
Use the a command similar to `{\tt \RUN}'.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Compressing (with JAR)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{verbatim}
javac -classpath c:\jh1.1.3\javahelp\lib\jhall.jar
-d c:\temp
JavaHelpTest.java
jar cvfm JavaHelpTest.jar manifest JavaHelpTest.class
java -jar jh1.3.1/demos/bin/UserGuide.jar
\end{verbatim}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Getting the JavaHelp Software}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Download JavaHelp from
\url{http://java.sun.com/products/javahelp/download_binary.html}
and unzip it into some directory (say {\tt \JHDIR}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Sample}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Help Set}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\verbatiminput{\jobname.hs}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Map Files}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\verbatiminput{\jobname.jhm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Table of Contents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\verbatiminput{\jobname-jht.xml}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Index}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\verbatiminput{\jobname-jhi.xml}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\OutputCodE\<javahelp.4ht\>
\OutputCodE\<javahelp-a.4ht\>
\ifOption{javahelp}
{
\Needs{"xhlatex \jobname\space \string\"html,3,javahelp\string\""}
\Needs{"xhlatex \jobname\space \string\"html,3,javahelp\string\""}
}
{}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|