Skip to content

Commit

Permalink
Merge pull request #8 from algolia/chore/scripts-docsearch.js-rename
Browse files Browse the repository at this point in the history
chore(dev workflow, readme): consistency commit
  • Loading branch information
pixelastic committed Dec 15, 2015
2 parents 125d1c7 + 0527688 commit f3e58b7
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist/
dist-es5-module/
npm-debug.log*
docs/_site
docs/.sass-cache/
51 changes: 37 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Documentation Search
# docsearch.js

Add a search autocomplete to your documentation.
Add a search autocomplete to any documentation.

Currently on-demand, send an email to [docsearch@algolia.com](mailto:docsearch@algolia.com)
if you want documentation search on your website.

# Usage

```html
<link rel="stylesheet" href="//cdn.jsdelivr.net/documentationsearch.js/0/documentationsearch.min.css" />
<script src="//cdn.jsdelivr.net/documentationsearch.js/0/documentationsearch.min.js"></script>
<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>
```

```javascript
```js
documentationSearch({
apiKey: apiKey, // Mandatory
indexName: indexName, // Mandatory
Expand All @@ -24,27 +27,47 @@ documentationSearch({
- https://reactjs.algolia.com/
- https://babeljs.algolia.com/

# How do I get my `apiKey` and `indexName`?
# How do I get an `apiKey` and `indexName`?

Just send us [an email](mailto:documentationsearch@algolia.com) with the url of
the documentation you would like to search, and we'll this info back to you.
Send us [an email](mailto:docsearch@algolia.com) 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](https://github.com/algolia/autocomplete.js) library, along
with default CSS styling of the dropdown.

The indexing of the data itself is currently done by an internal tool (we will
release it later), that runs every hour.
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:
- [Node.js](https://nodejs.org/en/)
- npm@2

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

## Documentation website

# Development
This is the [Jekyll](https://jekyllrb.com/) instance running at https://community.algolia.com/docsearch.js.

You need [ruby](https://www.ruby-lang.org/en/), [bundler](http://bundler.io/).
Requirements:
- [Ruby](https://www.ruby-lang.org/en/)
- [Bundler](http://bundler.io/)

```sh
bundle install
bundle exec guard
npm run dev:docs
# open http://localhost:4000/docsearch.js/
```

## MacOS
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Site settings
title: Documentation Search
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eum quod hic qui, possimus ab ratione illo reiciendis nostrum sit aperiam debitis enim illum sequi reprehenderit porro error, sint earum rem!
baseurl: "/documentation-search" # the subpath of your site, e.g. /blog/
baseurl: "/docsearch.js" # the subpath of your site, e.g. /blog/
twitter_username: algolia
github_username: algolia
host: 0.0.0.0
Expand Down
2 changes: 1 addition & 1 deletion docs/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ layout: default
%p Lorem ipsum dolor sit amet, consectetur adipisicing elit. In, sit, veritatis tempora ipsum, provident fugiat quas, eum dicta architecto


%p Here are some examples of what you could build with documentationsearch.js.
%p Here are some examples of what you could build with docsearch.js.
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "documentationsearch.js",
"name": "docsearch.js",
"version": "0.0.1",
"description": "Add an autocomplete dropdown to your documentation",
"main": "dist-es5-module/index.js",
"scripts": {
"dev": "./scripts/dev",
"dev:docs": "./scripts/dev-docs",
"shrinkwrap": "npm-shrinkwrap --dev",
"prepublish": "NODE_ENV=production npm run build",
"build": "./scripts/build",
Expand All @@ -18,7 +19,7 @@
},
"author": "Algolia <support@algolia.com> (https://github.com/algolia/)",
"license": "MIT",
"repository": "algolia/documentationsearch.js",
"repository": "algolia/docsearch.js",
"devDependencies": {
"autoprefixer": "^6.1.2",
"babel": "^5.8.29",
Expand All @@ -31,9 +32,10 @@
"eslint": "^1.6.0",
"eslint-config-airbnb": "^0.1.0",
"eslint-config-algolia": "^4.2.0",
"eslint-plugin-algolia": "^1.5.0",
"eslint-plugin-react": "^3.5.1",
"expect": "^1.13.0",
"gh-pages": "^0.5.0",
"gh-pages": "^0.8.0",
"jsdom": "^7.1.1",
"json": "^9.0.3",
"mocha": "^2.3.4",
Expand All @@ -51,8 +53,9 @@
"peerDependencies": {},
"dependencies": {
"algoliasearch": "^3.9.2",
"autocomplete.js": "^0.14.1",
"autocomplete.js": "^0.16.0",
"hogan.js": "^3.0.2",
"npm-zepto": "^1.1.7",
"to-factory": "^1.0.0"
}
}
4 changes: 2 additions & 2 deletions scripts/build-css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -e # exit when error

VERSION=$(json version < package.json)
NAME='docsearch'
LICENSE="/*! ${NAME} ${VERSION:-UNRELEASED} | © Algolia | github.com/algolia/docsearch */"
NAME='docsearch.js'
LICENSE="/*! ${NAME} ${VERSION:-UNRELEASED} | © Algolia | github.com/algolia/docsearch.js */"
DIST_DIR="dist/cdn"
DIST_FILE="$DIST_DIR/${NAME}.css"
DIST_FILE_MIN="$DIST_DIR/${NAME}.min.css"
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -e # exit when error

VERSION=$(json version < package.json)
NAME='docsearch'
LICENSE="/*! ${NAME} ${VERSION:-UNRELEASED} | © Algolia | github.com/algolia/docsearch */"
NAME='docsearch.js'
LICENSE="/*! ${NAME} ${VERSION:-UNRELEASED} | © Algolia | github.com/algolia/docsearch.js */"
DIST_DIR_CDN="dist/cdn"
DIST_DIR_NPM="dist/npm"
DIST_FILE="$DIST_DIR_CDN/${NAME}.js"
Expand Down
2 changes: 0 additions & 2 deletions scripts/dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ webpack-dev-server \
onchange './src/styles/*.scss' -- npm run build:css & \

wait


9 changes: 9 additions & 0 deletions scripts/dev-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -ev # exit when error

cd docs && \
bundle install && \
bundle exec guard -i & \
npm run dev & \
wait

0 comments on commit f3e58b7

Please sign in to comment.