Skip to content

Commit b81114e

Browse files
committed
feat(website): new documentation
1 parent 430cbf2 commit b81114e

116 files changed

Lines changed: 8173 additions & 21541 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 66 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The easiest way to add search to your documentation – for free.
66

77
[![npm version](https://img.shields.io/npm/v/@docsearch/js/alpha.svg?style=flat-square)](https://www.npmjs.com/package/@docsearch/js/v/alpha) [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](./LICENSE)
8-
8+
99
<p align="center">
1010
<strong>
1111
<a href="https://docsearch.algolia.com">Documentation</a> •
@@ -32,42 +32,95 @@ DocSearch crawls your documentation, pushes the content to an Algolia index and
3232

3333
> Don't have your Algolia credentials yet? [Apply to DocSearch](https://docsearch.algolia.com/apply)!
3434
35-
**1.** Import the library as an ECMAScript module:
35+
### JavaScript
36+
37+
#### Installation
3638

3739
```sh
38-
npm install @docsearch/js@alpha
39-
# or
4040
yarn add @docsearch/js@alpha
41+
# or
42+
npm install @docsearch/js@alpha
4143
```
4244

43-
```js
44-
import docsearch from '@docsearch/js';
45+
If you don’t want to use a package manager, you can use a standalone endpoint:
46+
47+
```html
48+
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"></script>
4549
```
4650

47-
**1–bis.** Or with a script tag (at the end of the `body`):
51+
#### Get started
52+
53+
To get started, you need a [`container`](https://docsearch.algolia.com/docs/api#container) for your DocSearch component to go in. If you don’t have one already, you can insert one into your markup:
4854

4955
```html
50-
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"></script>
56+
<div id="docsearch"></div>
5157
```
5258

53-
**2.** Use the library:
59+
Then, insert DocSearch into it by calling the [`docsearch`](https://docsearch.algolia.com/docs/api) function and providing the container. It can be a [CSS selector](https://developer.mozilla.org/en-us/docs/web/css/css_selectors) or an [Element](https://developer.mozilla.org/en-us/docs/web/api/htmlelement).
60+
61+
Make sure to provide a [`container`](https://docsearch.algolia.com/docs/api#container) (for example, a `div`), not an `input`. DocSearch generates a fully accessible search box for you.
62+
63+
```js app.js
64+
import docsearch from '@docsearch/js';
65+
66+
import '@docsearch/css';
5467

55-
```js
5668
docsearch({
5769
container: '#docsearch',
70+
appId: 'YOUR_APP_ID',
5871
indexName: 'YOUR_INDEX_NAME',
59-
apiKey: 'YOUR_API_KEY',
72+
apiKey: 'YOUR_SEARCH_API_KEY',
6073
});
6174
```
6275

63-
**3.** [Customize the color scheme](https://docsearch.algolia.com/docs/styling/).
76+
### React
77+
78+
#### Installation
79+
80+
```bash
81+
yarn add @docsearch/react@alpha
82+
# or
83+
npm install @docsearch/react@alpha
84+
```
85+
86+
If you don’t want to use a package manager, you can use a standalone endpoint:
87+
88+
```html
89+
<script src="https://cdn.jsdelivr.net/npm/@docsearch/react@alpha"></script>
90+
```
91+
92+
#### Get started
93+
94+
DocSearch generates a fully accessible search box for you.
95+
96+
```jsx App.js
97+
import { DocSearch } from '@docsearch/react';
98+
99+
import '@docsearch/css';
100+
101+
function App() {
102+
return (
103+
<DocSearch
104+
appId="YOUR_APP_ID"
105+
indexName="YOUR_INDEX_NAME"
106+
apiKey="YOUR_SEARCH_API_KEY"
107+
/>
108+
);
109+
}
110+
111+
export default App;
112+
```
113+
114+
## Styling
115+
116+
[Read documentation →](https://docsearch.algolia.com/docs/styling)
64117

65118
## Related projects
66119

67120
DocSearch is made of the following repositories:
68121

69122
- **[algolia/docsearch](https://github.com/algolia/docsearch)**: DocSearch source code.
70-
- **[algolia/docsearch-website](https://github.com/algolia/docsearch-website)**: DocSearch website and documentation.
123+
- **[algolia/docsearch-website](https://github.com/algolia/docsearch/tree/next/packages/website)**: DocSearch website and documentation.
71124
- **[algolia/docsearch-configs](https://github.com/algolia/docsearch-configs)**: DocSearch websites configurations that DocSearch powers.
72125
- **[algolia/docsearch-scraper](https://github.com/algolia/docsearch-scraper)**: DocSearch crawler that extracts data from your documentation.
73126

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"build:types": "lerna run build:types --scope @docsearch/*",
1717
"build:umd": "lerna run build:umd --scope @docsearch/*",
1818
"build": "lerna run build --scope @docsearch/*",
19-
"cy:clean": "rimraf cypress/screenshots",
19+
"cy:clean": "rm -rf cypress/screenshots",
2020
"cy:info": "cypress info",
2121
"cy:record": "percy exec -- cypress run --spec 'cypress/integration/**/*' --headless --record",
2222
"cy:run:chrome": "yarn run cy:run --browser chrome",
@@ -84,7 +84,6 @@
8484
"prettier": "2.1.1",
8585
"react": "17.0.2",
8686
"react-dom": "17.0.2",
87-
"rimraf": "3.0.2",
8887
"rollup": "1.31.0",
8988
"rollup-plugin-babel": "4.4.0",
9089
"rollup-plugin-commonjs": "10.1.0",

packages/docsearch-css/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ Style package for [DocSearch](http://docsearch.algolia.com/), the best search ex
44

55
## Installation
66

7-
In a JavaScript environment:
8-
9-
```sh
7+
```bash
108
yarn add @docsearch/css@alpha
119
# or
1210
npm install @docsearch/css@alpha
1311
```
1412

13+
If you don’t want to use a package manager, you can use a standalone endpoint:
14+
15+
```html
16+
<script src="https://cdn.jsdelivr.net/npm/@docsearch/css@alpha"></script>
17+
```
18+
19+
## Get started
20+
21+
```js
22+
import '@docsearch/css';
23+
```
24+
1525
## Documentation
1626

17-
[Read documentation →](https://autocomplete-experimental.netlify.app/docs/docsearch-css)
27+
[Read documentation →](https://docsearch.algolia.com/docs/styling)

packages/docsearch-css/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"unpkg": "dist/style.css",
1717
"jsdelivr": "dist/style.css",
1818
"scripts": {
19-
"build:clean": "rimraf ./dist",
19+
"build:clean": "rm -rf ./dist",
2020
"build:css": "node build-css.js",
2121
"build": "yarn build:clean && mkdir dist && yarn build:css",
2222
"prepare": "yarn build",

packages/docsearch-js/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,37 @@ yarn add @docsearch/js@alpha
1010
npm install @docsearch/js@alpha
1111
```
1212

13+
## Get started
14+
15+
If you don’t want to use a package manager, you can use a standalone endpoint:
16+
17+
```html
18+
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"></script>
19+
```
20+
21+
To get started, you need a [`container`](https://docsearch.algolia.com/docs/api#container) for your DocSearch component to go in. If you don’t have one already, you can insert one into your markup:
22+
23+
```html
24+
<div id="docsearch"></div>
25+
```
26+
27+
Then, insert DocSearch into it by calling the [`docsearch`](https://docsearch.algolia.com/docs/api) function and providing the container. It can be a [CSS selector](https://developer.mozilla.org/en-us/docs/web/css/css_selectors) or an [Element](https://developer.mozilla.org/en-us/docs/web/api/htmlelement).
28+
29+
Make sure to provide a [`container`](https://docsearch.algolia.com/docs/api#container) (for example, a `div`), not an `input`. DocSearch generates a fully accessible search box for you.
30+
31+
```js app.js
32+
import docsearch from '@docsearch/js';
33+
34+
import '@docsearch/css';
35+
36+
docsearch({
37+
container: '#docsearch',
38+
appId: 'YOUR_APP_ID',
39+
indexName: 'YOUR_INDEX_NAME',
40+
apiKey: 'YOUR_SEARCH_API_KEY',
41+
});
42+
```
43+
1344
## Documentation
1445

15-
[Read documentation →](https://autocomplete-experimental.netlify.app/docs/docsearch-js)
46+
[Read documentation →](https://docsearch.algolia.com/docs/DocSearch-v3)

packages/docsearch-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"unpkg": "dist/umd/index.js",
2222
"jsdelivr": "dist/umd/index.js",
2323
"scripts": {
24-
"build:clean": "rimraf ./dist",
24+
"build:clean": "rm -rf ./dist",
2525
"build:esm": "cross-env BUILD=esm rollup --config",
2626
"build:types": "tsc -p ./tsconfig.declaration.json --outFile ./dist/esm/index.d.ts",
2727
"build:umd": "cross-env BUILD=umd rollup --config",

packages/docsearch-react/README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,42 @@
22

33
React package for [DocSearch](http://docsearch.algolia.com/), the best search experience for docs.
44

5-
[![Percy](https://percy.io/static/images/percy-badge.svg)](https://percy.io/DX/DocSearch)
6-
75
## Installation
86

9-
```sh
7+
```bash
108
yarn add @docsearch/react@alpha
119
# or
1210
npm install @docsearch/react@alpha
1311
```
1412

13+
If you don’t want to use a package manager, you can use a standalone endpoint:
14+
15+
```html
16+
<script src="https://cdn.jsdelivr.net/npm/@docsearch/react@alpha"></script>
17+
```
18+
19+
## Get started
20+
21+
DocSearch generates a fully accessible search box for you.
22+
23+
```jsx App.js
24+
import { DocSearch } from '@docsearch/react';
25+
26+
import '@docsearch/css';
27+
28+
function App() {
29+
return (
30+
<DocSearch
31+
appId="YOUR_APP_ID"
32+
indexName="YOUR_INDEX_NAME"
33+
apiKey="YOUR_SEARCH_API_KEY"
34+
/>
35+
);
36+
}
37+
38+
export default App;
39+
```
40+
1541
## Documentation
1642

17-
[Read documentation →](https://autocomplete-experimental.netlify.app/docs/DocSearch)
43+
[Read documentation →](https://docsearch.algolia.com/docs/DocSearch-v3)

packages/website/.gitignore

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# dependencies
2-
node_modules/
1+
# Dependencies
2+
/node_modules
33

4-
# production
5-
build/
4+
# Production
5+
/build
66

7-
# generated files
7+
# Generated files
88
.docusaurus
99
.cache-loader
1010

11-
# misc
11+
# Misc
1212
.DS_Store
1313
.env.local
1414
.env.development.local
@@ -18,13 +18,3 @@ build/
1818
npm-debug.log*
1919
yarn-debug.log*
2020
yarn-error.log*
21-
22-
# legacy
23-
coverage/
24-
dist/
25-
.idea/
26-
.vscode/
27-
dist-es5-module/
28-
tmp
29-
docs/.textlintcache
30-
.netlify

0 commit comments

Comments
 (0)