The com.taylortext.ditasearch plugin for the DITA Open Toolkit generates a help index and search box in your HTML5 output. Unique features include:
<indexterm>
and <shortdesc>
automatically increase the weight of terms in those elements.<searchtitle>
and @search
markup.Install the plugin like any other DITA-OT plugin:
dita -install https://github.com/shaneataylor/ditasearch/archive/1.1.zip
The DITASearch plugin does not create a new transformation type. Instead, it adds processing to the HTML5 transformation type. This is intended to make it easier to implement with either default HTML5 transformations or custom plugins based on HTML5.
NOTE This plugin does not support XHTML-based transformations.
When you build your topics, you will see three changes in your output files:
<div class="ditasearch"/>
.<script src="https://github.com/shaneataylor/ditasearch/raw/main/{path}/ditasearch.js"></script>
.ditasearch.js
file will be included in the root of your output directory.For simplicity, the search index and all needed code is included in the
Javascript file. When you display the help topics, the script adds the search box inside
of <div class="ditasearch"/>
.
As documented in the plugin itself, two build parameters are available:
Specifies an optional search configuration file containing stopwords, stemming exceptions, and synonyms. This file can be merged with or replace the default configuration.
Omit adding the search HTML to topics if you are including it yourself, for example, in a frameset or custom header and footer. The following values are supported:
true
– Don't add the search HTML to topics.false
(default) – The build adds <div class='ditasearch'>
to the header
and <script src='{path}/ditasearch.js'>
to the footer.