Code Monkey home page Code Monkey logo

ditasearch's Introduction

DITASearch plugin

The com.taylortext.ditasearch plugin for the DITA Open Toolkit generates a help index and search box in your HTML5 output. Unique features include:

  • DITA-aware indexing, so semantic markup like <indexterm> and <shortdesc> automatically increase the weight of terms in those elements.
  • Uses a modified Porter2 stemming alorithm so variant forms of English words (running and ran, for example) are considered equivalent.
  • Respects DITA <searchtitle> and @search markup.
  • Includes a default synonym library that can be extended.
  • Automatically adds the search box and calls the search Javascript from your HTML5 topics (you can turn this off with a parameter).
  • Search results are listed immediately below the search box, with intuitive keyboard navigation (you don't need to leave the current topic to view a page of search results).

Install

Install the plugin like any other DITA-OT plugin:

dita -install https://github.com/shaneataylor/ditasearch/archive/1.1.zip

Use

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:

  1. The running header will include <div class="ditasearch"/>.
  2. The running footer will include <script src="{path}/ditasearch.js"></script>.
  3. A new 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"/>.

Build parameters

As documented in the plugin itself, two build parameters are available:

args.ditasearch.configs

Specifies an optional search configuration file containing stopwords, stemming exceptions, and synonyms. This file can be merged with or replace the default configuration.

args.ditasearch.nohtml

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.

Release history

1.1 - Bugfix release

  • Fixed: The search index was built even for non-HTML builds.
  • Fixed: Search results did not scroll to the top after the query changed.

R1 - Initial release

ditasearch's People

Contributors

shaneataylor avatar tboenig avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.