1
0
Fork 0

chore(dev workflow, readme): consistency commit

add npm run dev:docs
consistent readme with instantsearch.js
move to docsearch.js

What do you think?
This commit is contained in:
vvo 2015-12-14 19:17:21 +01:00
parent 125d1c7b4e
commit 0527688ab6
9 changed files with 60 additions and 26 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@ dist/
dist-es5-module/
npm-debug.log*
docs/_site
docs/.sass-cache/

View file

@ -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
@ -24,10 +27,10 @@ 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?
@ -35,16 +38,36 @@ 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).
# Development
Indexing of docsearch.js linked websites takes places every day.
You need [ruby](https://www.ruby-lang.org/en/), [bundler](http://bundler.io/).
# 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
This is the [Jekyll](https://jekyllrb.com/) instance running at https://community.algolia.com/docsearch.js.
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

View file

@ -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

View file

@ -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.

View file

@ -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",
@ -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",
@ -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",
@ -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"
}
}

View file

@ -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"

View file

@ -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"

View file

@ -12,5 +12,3 @@ webpack-dev-server \
onchange './src/styles/*.scss' -- npm run build:css & \
wait

9
scripts/dev-docs Executable file
View file

@ -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