1
0
Fork 0
docsearch/README.md
2020-09-02 09:57:55 +02:00

70 lines
2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div align="center">
[![DocSearch](.github/logo.svg)](https://docsearch.algolia.com)
The easiest way to add search to your documentation for free.
[![npm version](https://img.shields.io/npm/v/@docsearch/js.svg?style=flat-square)](https://npmjs.org/package/@docsearch/js@alpha) [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](./LICENSE)
</div>
---
DocSearch crawls your documentation, pushes the content to an Algolia index and provides a dropdown search experience on your website.
Check out our [website](https://docsearch.algolia.com) for a complete explanation and documentation.
## Preview
![Screencast](.github/screencast.gif)
| Light | Dark |
| --- | --- |
| ![Light preview](.github/preview-light.png) | ![Dark preview](.github/preview-dark.png) |
## Usage
> Don't have your Algolia credentials yet? [Apply to DocSearch](https://docsearch.algolia.com/apply)!
**1.** Import the library as an ECMAScript module:
```sh
npm install @docsearch/js@alpha
# or
yarn add @docsearch/js@alpha
```
```js
import docsearch from '@docsearch/js';
```
**1bis.** Or with a script tag (at the end of the `body`):
```html
<script src="https://cdn.jsdelivr.net/@docsearch/js@alpha"></script>
```
**2.** Use the library:
```js
docsearch({
container: '#docsearch',
indexName: 'YOUR_INDEX_NAME',
apiKey: 'YOUR_API_KEY',
});
```
**3.** [Customize the color scheme](https://docsearch.algolia.com/docs/styling/).
## Related projects
DocSearch is made of the following repositories:
- **[algolia/docsearch](https://github.com/algolia/docsearch)**: DocSearch source code.
- **[algolia/docsearch-website](https://github.com/algolia/docsearch-website)**: DocSearch website and documentation.
- **[algolia/docsearch-configs](https://github.com/algolia/docsearch-configs)**: DocSearch websites configurations that DocSearch powers.
- **[algolia/docsearch-scraper](https://github.com/algolia/docsearch-scraper)**: DocSearch crawler that extracts data from your documentation.
## License
[MIT](LICENSE)