Search Box
Add a full-text search function to your menu bar by installing another plug-in.
Adding a search function
Search boxes are not included by default. You must first install another plug-in which indexes the full DITA text. Since multiple search engines exist, search is always initialised by a separate dependent DITA-OT plug-in.
The DITA Bootstrap Lunr Search is a DITA-OT plug-in which has been created using the Lunr.js library. It may be used directly or as a template for extending search to other search engines.
Installing the DITA Bootstrap Lunr Search plug-in
Use the dita command to add the DITA Bootstrap Lunr Search plug-in to your DITA Open Toolkit installation:
dita install org.dita-bootstrap.lunr
Installing Node.js
The DITA Bootstrap Lunr Search plug-in uses the Node.js JavaScript runtime to generate the Lunr.js search index. Node.js must therefore be present for the index to be generated successfully.
To download and install a copy, follow the instructions for your operating system on the download page.
Using
To run, use the html5-bootstrap transformation and pass the --args.hdr parameter to the dita command:
dita \
--format=html5-bootstrap \
--input=path/to/your.ditamap \
--args.hdr=path/to/your-header.xml