Skip to content

Commit

Permalink
chore(naming): use docsearch everywhere
Browse files Browse the repository at this point in the history
Fix #40
  • Loading branch information
redox committed Dec 23, 2015
1 parent 3f0600e commit 957defc
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Once we've crawled your documentation website we'll send you the credentials you
<link rel="stylesheet" href="//cdn.jsdelivr.net/docsearch.js/0/docsearch.min.css" />
<script type="text/javascript" src="//cdn.jsdelivr.net/docsearch.js/0/docsearch.min.js"></script>
<script type="text/javascript">
docSearch({
docsearch({
apiKey: '<API_KEY>',
indexName: '<INDEX_NAME>',
inputSelector: '<YOUR_INPUT_DOM_SELECTOR>'
Expand Down
4 changes: 2 additions & 2 deletions dev/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import docSearch from '../index.js';
import docsearch from '../index.js';

docSearch({
docsearch({
apiKey: '52a6d7ab710fcef44537c3cff5290e55',
indexName: 'tim_stripe',
inputSelector: '#search-input'
Expand Down
60 changes: 53 additions & 7 deletions docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ permalink: /documentation/

## Introduction

We're scratching our own itch here. As developers, we spend a lot of time reading documentation, and it isnt always easy to find the information we need.
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.

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.

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.
Just submit the form on the [website][12] 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.
3. You'll need to add a bit of JavaScript and CSS code to your website.

## Setup

Expand All @@ -24,7 +24,7 @@ Once we've crawled your documentation website we'll send you the credentials you
<link rel="stylesheet" href="//cdn.jsdelivr.net/docsearch.js/0/docsearch.min.css" />
<script type="text/javascript" src="//cdn.jsdelivr.net/docsearch.js/0/docsearch.min.js"></script>
<script type="text/javascript">
docSearch({
docsearch({
apiKey: '<API_KEY>',
indexName: '<INDEX_NAME>',
inputSelector: '<YOUR_INPUT_DOM_SELECTOR>'
Expand All @@ -34,8 +34,54 @@ docSearch({

## Customization

To customize the look & feel of the dropdown menu, you can either:
The default colorscheme is blue and gray:

* 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).
![Default colorscheme][13]

To update the colors to suit your website, you just need to override a few
colors. Here is an example of a CSS file that you can use as a basis and that
sets white and purples colors.

```css
/* Bottom border of each suggestion */
.algolia-docsearch-suggestion {
border-bottom-color: #3A3DD1;
}
/* Main category headers */
.algolia-docsearch-suggestion--category-header {
background-color: #4B54DE;
}
/* Highlighted search terms */
.algolia-docsearch-suggestion--highlight {
color: #3A33D1;
}
/* Highligted search terms in the main category headers */
.algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--highlight {
background-color: #4D47D5;
}
/* Currently selected suggestion */
.aa-cursor .algolia-docsearch-suggestion--content {
color: #272296;
}
.aa-cursor .algolia-docsearch-suggestion {
background: #EBEBFB;
}

/* For bigger screens, when displaying results in two columns */
@media (min-width: 768px) {
/* Bottom border of each suggestion */
.algolia-docsearch-suggestion {
border-bottom-color: #7671df;
}
/* Left column, with secondary category header */
.algolia-docsearch-suggestion--subcategory-column {
border-right-color: #7671df;
background-color: #F2F2FF;
color: #4E4726;
}
}
```

Advanced users can also clone the repository, edit the [_variables.scss][14]
file and re-build the CSS file using `npm run build:css`.

6 changes: 3 additions & 3 deletions src/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import toFactory from 'to-factory';
import DocSearch from './DocSearch';
import version from './version.js';

let docSearch = toFactory(DocSearch);
docSearch.version = version;
let docsearch = toFactory(DocSearch);
docsearch.version = version;

export default docSearch;
export default docsearch;

0 comments on commit 957defc

Please sign in to comment.