Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,23 @@ For that, all you need to do is follow the instructions below:
3. Finally to bypass CORS you will want to get this Chrome [extension](https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc)

When you are done, just deploy your `openapi.yml` as you normally would. And don't forget to update your client sdk [here](https://github.com/epilot-dev/sdk-js).

## Search

The site search is a local plugin in [`src/plugins/search`](src/plugins/search):

- `indexer.js` runs after `npm run build` and writes `build/search-index.json`. It indexes every section of the rendered docs and changelog pages, and every operation of the OpenAPI specs listed in `redoc.config.js`.
- `engine.js` ranks results in the browser (BM25F with field weights, stemming, prefix and typo matching, title and phrase boosts).
- `theme/SearchBar` is the search dialog (`Ctrl/⌘ K` or `/`).

The dev server (`npm start`) has no index of its own: it serves the one from the last `npm run build`.

After changing the ranking, verify it against the built index:

```bash
npm run build
npm run test:search # relevance checks
npm run test:search -- "webhook signature" # print the results of a query
```

To keep an element out of the index, add a `data-search-ignore` attribute to it.
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const DOCS_URL = process.env.DOCS_URL || 'https://docs.epilot.io'
},
}
},
require.resolve('@cmfcmf/docusaurus-search-local'),
[require.resolve('./src/plugins/search/index.js'), { specs }],
[
'@docusaurus/plugin-client-redirects',
{
Expand Down
6 changes: 0 additions & 6 deletions i18n/en/code.json

This file was deleted.

120 changes: 10 additions & 110 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc",
"test:search": "node scripts/check-search-relevance.js",
"lint": "eslint src --ext js,jsx,ts,tsx,json",
"lint:fix": "eslint src --ext js,jsx,ts,tsx,json --fix",
"pdf": "./scripts/build-pdf.sh",
Expand All @@ -27,7 +28,6 @@
"update-pricing-playground": "./scripts/update-pricing-playground.sh"
},
"dependencies": {
"@cmfcmf/docusaurus-search-local": "^0.10.0",
"@docusaurus/core": "2.0.0-beta.15",
"@docusaurus/plugin-client-redirects": "^2.0.0-beta.15",
"@docusaurus/plugin-content-docs": "2.0.0-beta.15",
Expand All @@ -41,16 +41,19 @@
"@stoplight/markdown-viewer": "^5.7.1",
"@stoplight/mosaic": "^1.53.5",
"@svgr/webpack": "^5.5.0",
"cheerio": "1.0.0-rc.12",
"clsx": "^1.1.1",
"file-loader": "^6.2.0",
"fs-extra": "^10.1.0",
"lottie-web": "^5.13.0",
"mdx-mermaid": "^1.3.2",
"mermaid": "^11.12.2",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"redocusaurus": "^0.6.0",
"url-loader": "^4.1.1"
"url-loader": "^4.1.1",
"yaml": "^1.10.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
Expand Down
Loading
Loading