1
0
Fork 0
📘 The easiest way to add search to your documentation.
Find a file
Tim Carry f3e58b777f Merge pull request #8 from algolia/chore/scripts-docsearch.js-rename
chore(dev workflow, readme): consistency commit
2015-12-15 12:30:20 +01:00
dev Add styling up to small screen 2015-12-14 16:42:48 +01:00
docs chore(dev workflow, readme): consistency commit 2015-12-15 11:10:12 +01:00
scripts chore(dev workflow, readme): consistency commit 2015-12-15 11:10:12 +01:00
src fix(colors): Reduce number of colors 2015-12-14 17:30:38 +01:00
test Adding first stripe example 2015-12-10 10:34:00 +01:00
.babelrc chore(skeleton): Provide basic library skeleton 2015-11-26 12:03:01 +01:00
.eslintignore chore(skeleton): Provide basic library skeleton 2015-11-26 12:03:01 +01:00
.eslintrc chore(skeleton): Provide basic library skeleton 2015-11-26 12:03:01 +01:00
.gitignore chore(dev workflow, readme): consistency commit 2015-12-15 11:10:12 +01:00
.npmignore chore(skeleton): Provide basic library skeleton 2015-11-26 12:03:01 +01:00
.travis.yml chore(skeleton): Provide basic library skeleton 2015-11-26 12:03:01 +01:00
index.js feat(main): Add main wrapper 2015-11-26 16:10:06 +01:00
package.json chore(dev workflow, readme): consistency commit 2015-12-15 11:10:12 +01:00
README.md chore(dev workflow, readme): consistency commit 2015-12-15 11:10:12 +01:00
webpack.config.jsdelivr.babel.js Update build and serve scripts and renamed to docsearch 2015-12-10 18:44:57 +01:00
webpack.dev.config.babel.js chore(skeleton): Provide basic library skeleton 2015-11-26 12:03:01 +01:00

docsearch.js

Add a search autocomplete to any documentation.

Currently on-demand, send an email to docsearch@algolia.com if you want documentation search on your website.

Usage

<link rel="stylesheet" href="//cdn.jsdelivr.net/docsearch.js/0/docsearch.min.css" />
<script src="//cdn.jsdelivr.net/docsearch.js/0/docsearch.min.js"></script>
documentationSearch({
  apiKey: apiKey, // Mandatory
  indexName: indexName, // Mandatory
  inputSelector: '#search-input' // Mandatory
});

Examples

How do I get an apiKey and indexName?

Send us an email with the url of the documentation website you would like to add search to.

How does it work?

The JavaScript library is a wrapper on top of our autocomplete.js library, along with default CSS styling of the dropdown.

The indexing of the website data itself is currently done by an internal tool (to be released).

Indexing of docsearch.js linked websites takes places every day.

Development workflow

Local example

We use a simple documentation example website as a way to develop the docsearch.js library.

Requirements:

npm run dev
# open http://localhost:8080

Documentation website

This is the Jekyll instance running at https://community.algolia.com/docsearch.js.

Requirements:

npm run dev:docs
# open http://localhost:4000/docsearch.js/

MacOS

If you are using brew and you had brew install openssl, you may need to configure the build path of eventmachine with

bundle config build.eventmachine --with-cppflags=-I$(brew --prefix openssl)/include