chore(docs): updated README
This commit is contained in:
parent
698ee1b603
commit
fab0e5b7ac
1 changed files with 39 additions and 43 deletions
82
README.md
82
README.md
|
|
@ -1,12 +1,17 @@
|
||||||
|
# DocSearch
|
||||||
|
|
||||||
|
[](http://travis-ci.org/algolia/docsearch)
|
||||||
|
[](http://badge.fury.io/js/docsearch.js)
|
||||||
|
|
||||||
|
We've created the fastest, easiest way to search within documentation. Check out our [website](https://community.algolia.com/docsearch/) to add an outstanding search to your documentation.
|
||||||
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
## Table of Contents
|
||||||
|
|
||||||
- [docsearch](#docsearch)
|
- [Introduction](#introduction)
|
||||||
- [Usage](#usage)
|
- [Setup](#setup)
|
||||||
- [Examples](#examples)
|
- [Customization](#customization)
|
||||||
- [How do I get an `apiKey` and `indexName`?](#how-do-i-get-an-apikey-and-indexname)
|
|
||||||
- [How does it work?](#how-does-it-work)
|
|
||||||
- [Development workflow](#development-workflow)
|
- [Development workflow](#development-workflow)
|
||||||
- [Local example](#local-example)
|
- [Local example](#local-example)
|
||||||
- [Documentation website](#documentation-website)
|
- [Documentation website](#documentation-website)
|
||||||
|
|
@ -14,66 +19,57 @@
|
||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
|
||||||
# docsearch
|
## Introduction
|
||||||
|
|
||||||
Add a search autocomplete to any documentation.
|
We're scratching our own itch here. As developers, we spend a lot of time reading documentation, and it isn’t always easy to find the information we need.
|
||||||
|
|
||||||
Currently on-demand, send an email to [docsearch@algolia.com](mailto:docsearch@algolia.com)
|
Not blaming anyone here. Building a good search for a documentation is a complex challenge. We happen to have a lot of experience doing that, and we want to share it with the world. For free.
|
||||||
if you want documentation search on your website.
|
|
||||||
|
|
||||||
# Usage
|
Just submit the form on the [community.algolia.com/docsearch/](https://community.algolia.com/docsearch/) website and we'll get back to you with what you need to integrate your new search into your website.
|
||||||
|
|
||||||
|
1. We'll crawl your documentation pages,
|
||||||
|
2. We'll configure your search experience,
|
||||||
|
3. and you'll need to add the a small JS/CSS code snippet to your website.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
Once we've crawled your documentation website we'll send you the credentials you need to add the following code snippet to your website:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/docsearch.js/0/docsearch.min.css" />
|
<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>
|
<script type="text/javascript" src="//cdn.jsdelivr.net/docsearch.js/0/docsearch.min.js"></script>
|
||||||
```
|
<script type="text/javascript">
|
||||||
|
docSearch({
|
||||||
```js
|
apiKey: '<API_KEY>',
|
||||||
documentationSearch({
|
indexName: '<INDEX_NAME>',
|
||||||
apiKey: apiKey, // Mandatory
|
inputSelector: '<YOUR_INPUT_DOM_SELECTOR>'
|
||||||
indexName: indexName, // Mandatory
|
|
||||||
inputSelector: '#search-input' // Mandatory
|
|
||||||
});
|
});
|
||||||
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
# Examples
|
## Customization
|
||||||
|
|
||||||
- http://eslint.org/
|
To customize the look & feel of the dropdown menu, you can either:
|
||||||
- https://bootstrap.algolia.com/
|
|
||||||
- https://reactjs.algolia.com/
|
|
||||||
- https://babeljs.algolia.com/
|
|
||||||
|
|
||||||
# How do I get an `apiKey` and `indexName`?
|
* edit the color [variables](https://github.com/algolia/docsearch/blob/master/src/styles/_variables.scss) and rebuild this project CSS,
|
||||||
|
* or override the colors like we did in [dev/docsearch-styling.css](https://github.com/algolia/docsearch/blob/master/dev/docsearch-styling.css).
|
||||||
|
|
||||||
Send us [an email](mailto:docsearch@algolia.com) with the url of
|
## Development workflow
|
||||||
the documentation website you would like to add search to.
|
|
||||||
|
|
||||||
# How does it work?
|
### Local example
|
||||||
|
|
||||||
The JavaScript library is a wrapper on top of our
|
|
||||||
[autocomplete.js](https://github.com/algolia/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 websites using docsearch takes places every day.
|
|
||||||
|
|
||||||
# Development workflow
|
|
||||||
|
|
||||||
## Local example
|
|
||||||
|
|
||||||
We use a simple documentation example website as a way to develop the docsearch.js library.
|
We use a simple documentation example website as a way to develop the docsearch.js library.
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
- [Node.js](https://nodejs.org/en/)
|
- [Node.js](https://nodejs.org/en/)
|
||||||
- npm@2
|
- npm@2
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run dev
|
npm run dev
|
||||||
# open http://localhost:8080
|
# open http://localhost:8080
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation website
|
### Documentation website
|
||||||
|
|
||||||
This is the [Jekyll](https://jekyllrb.com/) instance running at https://community.algolia.com/docsearch.
|
This is the [Jekyll](https://jekyllrb.com/) instance running at https://community.algolia.com/docsearch.
|
||||||
|
|
||||||
|
|
@ -86,7 +82,7 @@ npm run dev:docs
|
||||||
# open http://localhost:4000/docsearch/
|
# open http://localhost:4000/docsearch/
|
||||||
```
|
```
|
||||||
|
|
||||||
## MacOS
|
### MacOS
|
||||||
|
|
||||||
If you are using `brew` and you had `brew install openssl`, you may need to configure the build path of eventmachine with
|
If you are using `brew` and you had `brew install openssl`, you may need to configure the build path of eventmachine with
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue