The HTMLSearch plug-in for the DITA Open Toolkit builds a keyword-based search index and a default frame-based user interface for any collection of DITA topics referenced by a DITA map file.
Nadege Quaine (nquaine@hotmail.com), the contributor of the tocjsbis plug-in, has also contributed this plug-in. As of this writing, the most current version of the plug-in is dated April 8, 2008 and is distributed as htmlsearch1.04.zip.
The HTMLSearch plug-in first runs the XHTML transform that comes with the DITA-OT and then runs an indexing application against those XHTML output files. HTMLSearch deposits the keyword index and the supporting JavaScript worker libraries in a subdirectory named search.
Each of these JavaScript index files correlates discovered keywords to one or more numerals representing particular XHTML output topics.
The keyword "ant," for example, appears in three XHTML topics. These target topics are referenced numerically (1, 2, 5) and indexed separately in the file search\htmlFileList.js.
When you open the default HTMLSearch web page (frameset.html) in the output directory, it opens three frames containing a keyword input box, some default information about the plug-in, and a splash screen.
Results from a keyword search are displayed in the right-hand pane.
Clicking a hyperlink in the results list displays the target topic containing the keyword in the same right-hand pane.
The plug-in works fine in all versions of the DITA-OT because it is really interacting with XHTML output from the DITA-OT, not Open Toolkit resources per se. Beyond minor variations in the way the HTML displays in different browsers, HTMLSearch output works reliably in all modern browsers.
The HTMLSearch plug-in is a free download from the Yahoo DITA-OT site.
http://tech.groups.yahoo.com/group/dita-users/files/Demos/
After you have unzipped this archive to a local directory, you can browse the README.txt file to get a feel for what HTMLSearch offers and how you can install it in your DITA-OT demo directory.
Installing the plug-in presents no surprises.
ant -f integrator.xml
ant -f demo/htmlsearch/buildsample.xml xhtml2search
That is about all that is involved with installing and configuring the plug-in.
There are no DITA source-level authoring considerations for this plug-in; it works on XHTML output topics generated by the DITA-OT XHTML transform.
Integrating output from the HTMLSearch plug-in with tocjsbis output or with your local favorite HTML implementation is possible, but challenging. If you have some experience modifying (or hacking) HTML frames and JavaScript code, have at it. Otherwise, you might consider continuing to use HTMLSearch output as a stand-alone complement to your other output transformations.
Consider the following tips when planning your customization effort.
linkString = "<li><a href=\"../"+tempPath+"\">"+tempTitle+"</a>";
expressionInput=parent.frames['searchwin'].document.ditaSearch_Form.textToSearch.value
with (parent.frames['contentwin'].document) {
linkString = "<li><a href=\"../"+tempPath+"\">"+tempTitle+"</a>";
and the update ...
linkString = "<li><a href=\"../"+tempPath+"\" target='topicwin'>"+tempTitle+"</a>";
After this change, HTMLSearch builds hyperlinks in the keyword search results frame that specify a different target window for displaying target XHTML topics.
These are the most visible variables that you'll need to consider when customizing HTMLSearch output for your own help implementation.
Although the customization process can sound scary, it does produce some very nice results. Here is a prototype Help implementation for my current company. The goal here is to integrate the output from HTMLSearch with output from tocjsbis in a garden-variety three-tab, multi-frame HTML shell. Initially, the search UI is linked to a Search tab.
When the customer clicks the Search tab, a re-implementation of the HTMLSearch UI is displayed.
Search results appear in a lower frame in the left-hand navigation frame.
When the customer clicks one of the hyperlinks in the results list, that topic is displayed in the right-hand frame.
Customizing HTMLSearch to integrate it with tocjsbis or other XHTML output transformations from the Open Toolkit goes a long way toward making DITA-generated Help more usable and familiar to contemporary audiences.
Stan Doherty
Individual
OASIS DITA Technical Committee
OASIS DITA Help Subcommittee