From fc8c1f33bc3494f251bc2ef3ed53ee015a92429a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20Bl=C3=A4ttermann?=
Date: Mon, 21 Nov 2022 15:42:08 +0100
Subject: [PATCH] Use recent DocSearch component and adjust styling
---
website/package-lock.json | 367 ++++++++++++++++++++++++++
website/package.json | 1 +
website/pages/_app.tsx | 2 +
website/pages/_document.tsx | 2 +-
website/src/components/search.js | 41 +--
website/src/html.js | 43 ---
website/src/styles/search.module.sass | 28 --
website/src/styles/search.sass | 27 ++
website/src/templates/index.js | 2 +-
9 files changed, 405 insertions(+), 108 deletions(-)
delete mode 100644 website/src/html.js
delete mode 100644 website/src/styles/search.module.sass
create mode 100644 website/src/styles/search.sass
diff --git a/website/package-lock.json b/website/package-lock.json
index 9eb1e93d3..aec38e02a 100644
--- a/website/package-lock.json
+++ b/website/package-lock.json
@@ -9,6 +9,7 @@
"version": "0.1.0",
"dependencies": {
"@codemirror/lang-python": "^6.1.0",
+ "@docsearch/react": "^3.3.0",
"@jupyterlab/services": "^3.2.1",
"@lezer/highlight": "^1.1.3",
"@mapbox/rehype-prism": "^0.8.0",
@@ -55,6 +56,146 @@
"ws": "^8.11.0"
}
},
+ "node_modules/@algolia/autocomplete-core": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.7.2.tgz",
+ "integrity": "sha512-eclwUDC6qfApNnEfu1uWcL/rudQsn59tjEoUYZYE2JSXZrHLRjBUGMxiCoknobU2Pva8ejb0eRxpIYDtVVqdsw==",
+ "dependencies": {
+ "@algolia/autocomplete-shared": "1.7.2"
+ }
+ },
+ "node_modules/@algolia/autocomplete-preset-algolia": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.7.2.tgz",
+ "integrity": "sha512-+RYEG6B0QiGGfRb2G3MtPfyrl0dALF3cQNTWBzBX6p5o01vCCGTTinAm2UKG3tfc2CnOMAtnPLkzNZyJUpnVJw==",
+ "dependencies": {
+ "@algolia/autocomplete-shared": "1.7.2"
+ },
+ "peerDependencies": {
+ "@algolia/client-search": ">= 4.9.1 < 6",
+ "algoliasearch": ">= 4.9.1 < 6"
+ }
+ },
+ "node_modules/@algolia/autocomplete-shared": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.7.2.tgz",
+ "integrity": "sha512-QCckjiC7xXHIUaIL3ektBtjJ0w7tTA3iqKcAE/Hjn1lZ5omp7i3Y4e09rAr9ZybqirL7AbxCLLq0Ra5DDPKeug=="
+ },
+ "node_modules/@algolia/cache-browser-local-storage": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.14.2.tgz",
+ "integrity": "sha512-FRweBkK/ywO+GKYfAWbrepewQsPTIEirhi1BdykX9mxvBPtGNKccYAxvGdDCumU1jL4r3cayio4psfzKMejBlA==",
+ "dependencies": {
+ "@algolia/cache-common": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/cache-common": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.14.2.tgz",
+ "integrity": "sha512-SbvAlG9VqNanCErr44q6lEKD2qoK4XtFNx9Qn8FK26ePCI8I9yU7pYB+eM/cZdS9SzQCRJBbHUumVr4bsQ4uxg=="
+ },
+ "node_modules/@algolia/cache-in-memory": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.14.2.tgz",
+ "integrity": "sha512-HrOukWoop9XB/VFojPv1R5SVXowgI56T9pmezd/djh2JnVN/vXswhXV51RKy4nCpqxyHt/aGFSq2qkDvj6KiuQ==",
+ "dependencies": {
+ "@algolia/cache-common": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/client-account": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.14.2.tgz",
+ "integrity": "sha512-WHtriQqGyibbb/Rx71YY43T0cXqyelEU0lB2QMBRXvD2X0iyeGl4qMxocgEIcbHyK7uqE7hKgjT8aBrHqhgc1w==",
+ "dependencies": {
+ "@algolia/client-common": "4.14.2",
+ "@algolia/client-search": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/client-analytics": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.14.2.tgz",
+ "integrity": "sha512-yBvBv2mw+HX5a+aeR0dkvUbFZsiC4FKSnfqk9rrfX+QrlNOKEhCG0tJzjiOggRW4EcNqRmaTULIYvIzQVL2KYQ==",
+ "dependencies": {
+ "@algolia/client-common": "4.14.2",
+ "@algolia/client-search": "4.14.2",
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/client-common": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.14.2.tgz",
+ "integrity": "sha512-43o4fslNLcktgtDMVaT5XwlzsDPzlqvqesRi4MjQz2x4/Sxm7zYg5LRYFol1BIhG6EwxKvSUq8HcC/KxJu3J0Q==",
+ "dependencies": {
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/client-personalization": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.14.2.tgz",
+ "integrity": "sha512-ACCoLi0cL8CBZ1W/2juehSltrw2iqsQBnfiu/Rbl9W2yE6o2ZUb97+sqN/jBqYNQBS+o0ekTMKNkQjHHAcEXNw==",
+ "dependencies": {
+ "@algolia/client-common": "4.14.2",
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/client-search": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.14.2.tgz",
+ "integrity": "sha512-L5zScdOmcZ6NGiVbLKTvP02UbxZ0njd5Vq9nJAmPFtjffUSOGEp11BmD2oMJ5QvARgx2XbX4KzTTNS5ECYIMWw==",
+ "dependencies": {
+ "@algolia/client-common": "4.14.2",
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/logger-common": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.14.2.tgz",
+ "integrity": "sha512-/JGlYvdV++IcMHBnVFsqEisTiOeEr6cUJtpjz8zc0A9c31JrtLm318Njc72p14Pnkw3A/5lHHh+QxpJ6WFTmsA=="
+ },
+ "node_modules/@algolia/logger-console": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.14.2.tgz",
+ "integrity": "sha512-8S2PlpdshbkwlLCSAB5f8c91xyc84VM9Ar9EdfE9UmX+NrKNYnWR1maXXVDQQoto07G1Ol/tYFnFVhUZq0xV/g==",
+ "dependencies": {
+ "@algolia/logger-common": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/requester-browser-xhr": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.14.2.tgz",
+ "integrity": "sha512-CEh//xYz/WfxHFh7pcMjQNWgpl4wFB85lUMRyVwaDPibNzQRVcV33YS+63fShFWc2+42YEipFGH2iPzlpszmDw==",
+ "dependencies": {
+ "@algolia/requester-common": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/requester-common": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.14.2.tgz",
+ "integrity": "sha512-73YQsBOKa5fvVV3My7iZHu1sUqmjjfs9TteFWwPwDmnad7T0VTCopttcsM3OjLxZFtBnX61Xxl2T2gmG2O4ehg=="
+ },
+ "node_modules/@algolia/requester-node-http": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.14.2.tgz",
+ "integrity": "sha512-oDbb02kd1o5GTEld4pETlPZLY0e+gOSWjWMJHWTgDXbv9rm/o2cF7japO6Vj1ENnrqWvLBmW1OzV9g6FUFhFXg==",
+ "dependencies": {
+ "@algolia/requester-common": "4.14.2"
+ }
+ },
+ "node_modules/@algolia/transporter": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.14.2.tgz",
+ "integrity": "sha512-t89dfQb2T9MFQHidjHcfhh6iGMNwvuKUvojAj+JsrHAGbuSy7yE4BylhLX6R0Q1xYRoC4Vvv+O5qIw/LdnQfsQ==",
+ "dependencies": {
+ "@algolia/cache-common": "4.14.2",
+ "@algolia/logger-common": "4.14.2",
+ "@algolia/requester-common": "4.14.2"
+ }
+ },
"node_modules/@ampproject/remapping": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
@@ -1784,6 +1925,38 @@
"resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.29.tgz",
"integrity": "sha512-q/yVUnqckA8Do+EvAfpy7RLdumnBy9ZsducMUtZTvpdbJC7azEf1hGtnYYxm0QfphYxjwggv6XtH64prvS1W+A=="
},
+ "node_modules/@docsearch/css": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.3.0.tgz",
+ "integrity": "sha512-rODCdDtGyudLj+Va8b6w6Y85KE85bXRsps/R4Yjwt5vueXKXZQKYw0aA9knxLBT6a/bI/GMrAcmCR75KYOM6hg=="
+ },
+ "node_modules/@docsearch/react": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.3.0.tgz",
+ "integrity": "sha512-fhS5adZkae2SSdMYEMVg6pxI5a/cE+tW16ki1V0/ur4Fdok3hBRkmN/H8VvlXnxzggkQIIRIVvYPn00JPjen3A==",
+ "dependencies": {
+ "@algolia/autocomplete-core": "1.7.2",
+ "@algolia/autocomplete-preset-algolia": "1.7.2",
+ "@docsearch/css": "3.3.0",
+ "algoliasearch": "^4.0.0"
+ },
+ "peerDependencies": {
+ "@types/react": ">= 16.8.0 < 19.0.0",
+ "react": ">= 16.8.0 < 19.0.0",
+ "react-dom": ">= 16.8.0 < 19.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "react": {
+ "optional": true
+ },
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@eslint/eslintrc": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz",
@@ -2915,6 +3088,27 @@
"ajv": "^6.9.1"
}
},
+ "node_modules/algoliasearch": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.14.2.tgz",
+ "integrity": "sha512-ngbEQonGEmf8dyEh5f+uOIihv4176dgbuOZspiuhmTTBRBuzWu3KCGHre6uHj5YyuC7pNvQGzB6ZNJyZi0z+Sg==",
+ "dependencies": {
+ "@algolia/cache-browser-local-storage": "4.14.2",
+ "@algolia/cache-common": "4.14.2",
+ "@algolia/cache-in-memory": "4.14.2",
+ "@algolia/client-account": "4.14.2",
+ "@algolia/client-analytics": "4.14.2",
+ "@algolia/client-common": "4.14.2",
+ "@algolia/client-personalization": "4.14.2",
+ "@algolia/client-search": "4.14.2",
+ "@algolia/logger-common": "4.14.2",
+ "@algolia/logger-console": "4.14.2",
+ "@algolia/requester-browser-xhr": "4.14.2",
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/requester-node-http": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
"node_modules/ansi-align": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz",
@@ -12047,6 +12241,142 @@
}
},
"dependencies": {
+ "@algolia/autocomplete-core": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.7.2.tgz",
+ "integrity": "sha512-eclwUDC6qfApNnEfu1uWcL/rudQsn59tjEoUYZYE2JSXZrHLRjBUGMxiCoknobU2Pva8ejb0eRxpIYDtVVqdsw==",
+ "requires": {
+ "@algolia/autocomplete-shared": "1.7.2"
+ }
+ },
+ "@algolia/autocomplete-preset-algolia": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.7.2.tgz",
+ "integrity": "sha512-+RYEG6B0QiGGfRb2G3MtPfyrl0dALF3cQNTWBzBX6p5o01vCCGTTinAm2UKG3tfc2CnOMAtnPLkzNZyJUpnVJw==",
+ "requires": {
+ "@algolia/autocomplete-shared": "1.7.2"
+ }
+ },
+ "@algolia/autocomplete-shared": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.7.2.tgz",
+ "integrity": "sha512-QCckjiC7xXHIUaIL3ektBtjJ0w7tTA3iqKcAE/Hjn1lZ5omp7i3Y4e09rAr9ZybqirL7AbxCLLq0Ra5DDPKeug=="
+ },
+ "@algolia/cache-browser-local-storage": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.14.2.tgz",
+ "integrity": "sha512-FRweBkK/ywO+GKYfAWbrepewQsPTIEirhi1BdykX9mxvBPtGNKccYAxvGdDCumU1jL4r3cayio4psfzKMejBlA==",
+ "requires": {
+ "@algolia/cache-common": "4.14.2"
+ }
+ },
+ "@algolia/cache-common": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.14.2.tgz",
+ "integrity": "sha512-SbvAlG9VqNanCErr44q6lEKD2qoK4XtFNx9Qn8FK26ePCI8I9yU7pYB+eM/cZdS9SzQCRJBbHUumVr4bsQ4uxg=="
+ },
+ "@algolia/cache-in-memory": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.14.2.tgz",
+ "integrity": "sha512-HrOukWoop9XB/VFojPv1R5SVXowgI56T9pmezd/djh2JnVN/vXswhXV51RKy4nCpqxyHt/aGFSq2qkDvj6KiuQ==",
+ "requires": {
+ "@algolia/cache-common": "4.14.2"
+ }
+ },
+ "@algolia/client-account": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.14.2.tgz",
+ "integrity": "sha512-WHtriQqGyibbb/Rx71YY43T0cXqyelEU0lB2QMBRXvD2X0iyeGl4qMxocgEIcbHyK7uqE7hKgjT8aBrHqhgc1w==",
+ "requires": {
+ "@algolia/client-common": "4.14.2",
+ "@algolia/client-search": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "@algolia/client-analytics": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.14.2.tgz",
+ "integrity": "sha512-yBvBv2mw+HX5a+aeR0dkvUbFZsiC4FKSnfqk9rrfX+QrlNOKEhCG0tJzjiOggRW4EcNqRmaTULIYvIzQVL2KYQ==",
+ "requires": {
+ "@algolia/client-common": "4.14.2",
+ "@algolia/client-search": "4.14.2",
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "@algolia/client-common": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.14.2.tgz",
+ "integrity": "sha512-43o4fslNLcktgtDMVaT5XwlzsDPzlqvqesRi4MjQz2x4/Sxm7zYg5LRYFol1BIhG6EwxKvSUq8HcC/KxJu3J0Q==",
+ "requires": {
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "@algolia/client-personalization": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.14.2.tgz",
+ "integrity": "sha512-ACCoLi0cL8CBZ1W/2juehSltrw2iqsQBnfiu/Rbl9W2yE6o2ZUb97+sqN/jBqYNQBS+o0ekTMKNkQjHHAcEXNw==",
+ "requires": {
+ "@algolia/client-common": "4.14.2",
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "@algolia/client-search": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.14.2.tgz",
+ "integrity": "sha512-L5zScdOmcZ6NGiVbLKTvP02UbxZ0njd5Vq9nJAmPFtjffUSOGEp11BmD2oMJ5QvARgx2XbX4KzTTNS5ECYIMWw==",
+ "requires": {
+ "@algolia/client-common": "4.14.2",
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
+ "@algolia/logger-common": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.14.2.tgz",
+ "integrity": "sha512-/JGlYvdV++IcMHBnVFsqEisTiOeEr6cUJtpjz8zc0A9c31JrtLm318Njc72p14Pnkw3A/5lHHh+QxpJ6WFTmsA=="
+ },
+ "@algolia/logger-console": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.14.2.tgz",
+ "integrity": "sha512-8S2PlpdshbkwlLCSAB5f8c91xyc84VM9Ar9EdfE9UmX+NrKNYnWR1maXXVDQQoto07G1Ol/tYFnFVhUZq0xV/g==",
+ "requires": {
+ "@algolia/logger-common": "4.14.2"
+ }
+ },
+ "@algolia/requester-browser-xhr": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.14.2.tgz",
+ "integrity": "sha512-CEh//xYz/WfxHFh7pcMjQNWgpl4wFB85lUMRyVwaDPibNzQRVcV33YS+63fShFWc2+42YEipFGH2iPzlpszmDw==",
+ "requires": {
+ "@algolia/requester-common": "4.14.2"
+ }
+ },
+ "@algolia/requester-common": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.14.2.tgz",
+ "integrity": "sha512-73YQsBOKa5fvVV3My7iZHu1sUqmjjfs9TteFWwPwDmnad7T0VTCopttcsM3OjLxZFtBnX61Xxl2T2gmG2O4ehg=="
+ },
+ "@algolia/requester-node-http": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.14.2.tgz",
+ "integrity": "sha512-oDbb02kd1o5GTEld4pETlPZLY0e+gOSWjWMJHWTgDXbv9rm/o2cF7japO6Vj1ENnrqWvLBmW1OzV9g6FUFhFXg==",
+ "requires": {
+ "@algolia/requester-common": "4.14.2"
+ }
+ },
+ "@algolia/transporter": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.14.2.tgz",
+ "integrity": "sha512-t89dfQb2T9MFQHidjHcfhh6iGMNwvuKUvojAj+JsrHAGbuSy7yE4BylhLX6R0Q1xYRoC4Vvv+O5qIw/LdnQfsQ==",
+ "requires": {
+ "@algolia/cache-common": "4.14.2",
+ "@algolia/logger-common": "4.14.2",
+ "@algolia/requester-common": "4.14.2"
+ }
+ },
"@ampproject/remapping": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
@@ -13254,6 +13584,22 @@
"resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.29.tgz",
"integrity": "sha512-q/yVUnqckA8Do+EvAfpy7RLdumnBy9ZsducMUtZTvpdbJC7azEf1hGtnYYxm0QfphYxjwggv6XtH64prvS1W+A=="
},
+ "@docsearch/css": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.3.0.tgz",
+ "integrity": "sha512-rODCdDtGyudLj+Va8b6w6Y85KE85bXRsps/R4Yjwt5vueXKXZQKYw0aA9knxLBT6a/bI/GMrAcmCR75KYOM6hg=="
+ },
+ "@docsearch/react": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.3.0.tgz",
+ "integrity": "sha512-fhS5adZkae2SSdMYEMVg6pxI5a/cE+tW16ki1V0/ur4Fdok3hBRkmN/H8VvlXnxzggkQIIRIVvYPn00JPjen3A==",
+ "requires": {
+ "@algolia/autocomplete-core": "1.7.2",
+ "@algolia/autocomplete-preset-algolia": "1.7.2",
+ "@docsearch/css": "3.3.0",
+ "algoliasearch": "^4.0.0"
+ }
+ },
"@eslint/eslintrc": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz",
@@ -14182,6 +14528,27 @@
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"requires": {}
},
+ "algoliasearch": {
+ "version": "4.14.2",
+ "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.14.2.tgz",
+ "integrity": "sha512-ngbEQonGEmf8dyEh5f+uOIihv4176dgbuOZspiuhmTTBRBuzWu3KCGHre6uHj5YyuC7pNvQGzB6ZNJyZi0z+Sg==",
+ "requires": {
+ "@algolia/cache-browser-local-storage": "4.14.2",
+ "@algolia/cache-common": "4.14.2",
+ "@algolia/cache-in-memory": "4.14.2",
+ "@algolia/client-account": "4.14.2",
+ "@algolia/client-analytics": "4.14.2",
+ "@algolia/client-common": "4.14.2",
+ "@algolia/client-personalization": "4.14.2",
+ "@algolia/client-search": "4.14.2",
+ "@algolia/logger-common": "4.14.2",
+ "@algolia/logger-console": "4.14.2",
+ "@algolia/requester-browser-xhr": "4.14.2",
+ "@algolia/requester-common": "4.14.2",
+ "@algolia/requester-node-http": "4.14.2",
+ "@algolia/transporter": "4.14.2"
+ }
+ },
"ansi-align": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz",
diff --git a/website/package.json b/website/package.json
index d2a2f8231..a2441e788 100644
--- a/website/package.json
+++ b/website/package.json
@@ -13,6 +13,7 @@
},
"dependencies": {
"@codemirror/lang-python": "^6.1.0",
+ "@docsearch/react": "^3.3.0",
"@jupyterlab/services": "^3.2.1",
"@lezer/highlight": "^1.1.3",
"@mapbox/rehype-prism": "^0.8.0",
diff --git a/website/pages/_app.tsx b/website/pages/_app.tsx
index c0cf383ed..8db80a672 100644
--- a/website/pages/_app.tsx
+++ b/website/pages/_app.tsx
@@ -1,4 +1,6 @@
import '../src/styles/layout.sass'
+import '../src/styles/search.sass'
+
import type { AppProps } from 'next/app'
import Head from 'next/head'
import PlausibleProvider from 'next-plausible'
diff --git a/website/pages/_document.tsx b/website/pages/_document.tsx
index 138cd8d10..718fb43a5 100644
--- a/website/pages/_document.tsx
+++ b/website/pages/_document.tsx
@@ -4,7 +4,7 @@ export default function Document() {
return (
-
+
diff --git a/website/src/components/search.js b/website/src/components/search.js
index 65d6f235a..f80d9cd9f 100644
--- a/website/src/components/search.js
+++ b/website/src/components/search.js
@@ -1,47 +1,18 @@
import React, { useEffect, useState } from 'react'
import PropTypes from 'prop-types'
-import { window } from 'browser-monads'
+import { DocSearch } from '@docsearch/react'
+import '@docsearch/css'
-import Icon from './icon'
-import classes from '../styles/search.module.sass'
+import siteMetadata from '../../meta/site.json'
-export default function Search({ id = 'docsearch', placeholder = 'Search docs', settings = {} }) {
- const { apiKey, indexName, appId } = settings
- if (!apiKey && !indexName) return null
- const [initialized, setInitialized] = useState(false)
- useEffect(() => {
- if (!initialized) {
- setInitialized(true)
- window.docsearch({
- appId,
- apiKey,
- indexName,
- inputSelector: `#${id}`,
- debug: false,
- })
- }
- }, [initialized, apiKey, indexName, id])
+export default function Search({ placeholder = 'Search docs' }) {
+ const { apiKey, indexName, appId } = siteMetadata.docSearch
return (
-
+
)
}
Search.propTypes = {
- settings: PropTypes.shape({
- apiKey: PropTypes.string.isRequired,
- indexName: PropTypes.string.isRequired,
- }).isRequired,
id: PropTypes.string,
placeholder: PropTypes.string,
}
diff --git a/website/src/html.js b/website/src/html.js
deleted file mode 100644
index 17d0b6cbe..000000000
--- a/website/src/html.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-
-export default function HTML(props) {
- return (
-
-
-
-
-
-
- {props.headComponents}
-
-
- {props.preBodyComponents}
-
-
- {props.postBodyComponents}
-
-
-
- )
-}
-
-HTML.propTypes = {
- htmlAttributes: PropTypes.object,
- headComponents: PropTypes.array,
- bodyAttributes: PropTypes.object,
- preBodyComponents: PropTypes.array,
- body: PropTypes.string,
- postBodyComponents: PropTypes.array,
-}
diff --git a/website/src/styles/search.module.sass b/website/src/styles/search.module.sass
deleted file mode 100644
index 8ac4d0b0e..000000000
--- a/website/src/styles/search.module.sass
+++ /dev/null
@@ -1,28 +0,0 @@
-@import base
-
-.root
- font: var(--font-size-sm)/var(--line-height-md) var(--font-primary)
- border: 1px solid var(--color-subtle)
- border-radius: 2em
- max-width: 100%
- display: flex
- flex-flow: row nowrap
-
- &:focus-within
- border-color: var(--color-theme)
- box-shadow: 0 0 0 1px var(--color-theme)
-
-.input
- width: 100%
- max-width: 100%
- font: inherit
- padding: 0.5rem 1rem 0.5rem 0.5rem
-
-.icon
- display: inline-block
- color: var(--color-subtle-dark)
- padding-left: 0.5rem
- position: relative
- top: 0.25rem
- left: 0.15rem
- cursor: pointer
diff --git a/website/src/styles/search.sass b/website/src/styles/search.sass
new file mode 100644
index 000000000..5e81bd963
--- /dev/null
+++ b/website/src/styles/search.sass
@@ -0,0 +1,27 @@
+@import base
+
+.DocSearch-Modal
+ --docsearch-primary-color: var(--color-theme)
+ --docsearch-searchbox-background: var(--color-back)
+ --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color)
+ --docsearch-highlight-color: var(--docsearch-primary-color)
+ --docsearch-logo-color: var(--docsearch-primary-color)
+
+ box-shadow: inset 0 0 0 1px var(--color-subtle)
+
+.DocSearch, .DocSearch-Modal, .DocSearch-Help, .DocSearch-Input, .DocSearch-Hit-title, .DocSearch-Hit-path
+ font-family: var(--font-primary)
+ font-size: var(--font-size-md) !important
+ font-weight: 400
+
+.DocSearch-Hits mark
+ background: var(--docsearch-highlight-color) !important
+ color: var(--color-back) !important
+
+.DocSearch-Hit-source
+ font-size: var(--font-size-lg) !important
+ font-family: var(--font-secondary)
+ text-transform: uppercase
+
+.cls-1, .cls-2
+ fill: var(--docsearch-primary-color) !important
diff --git a/website/src/templates/index.js b/website/src/templates/index.js
index 0b04f3cb5..aa7595ddc 100644
--- a/website/src/templates/index.js
+++ b/website/src/templates/index.js
@@ -115,7 +115,7 @@ class Layout extends React.Component {
title={siteMetadata.title}
items={siteMetadata.navigation}
section={section}
- search={}
+ search={}
alert={nightly ? null : navAlert}
>