mirror of https://github.com/apache/druid.git
Docs: fix doc search (#13164)
* fix doc search * upgrade website node to 16 * change website travis script * move spellcheck notification * explicit path to npm bin * cd to the correct place
This commit is contained in:
parent
f0cef36abf
commit
d1ec609ea2
23
.travis.yml
23
.travis.yml
|
@ -394,21 +394,14 @@ jobs:
|
||||||
|
|
||||||
- name: "docs"
|
- name: "docs"
|
||||||
stage: Tests - phase 1
|
stage: Tests - phase 1
|
||||||
install: ./check_test_suite.py && travis_terminate 0 || (cd website && nvm install 12.22.12 && npm install)
|
before_script:
|
||||||
script: |-
|
- ./check_test_suite.py && travis_terminate 0 || echo 'Starting nvm install...'
|
||||||
(cd website && npm run lint && npm run spellcheck) || { echo "
|
- nvm install 16.17.0
|
||||||
|
- (cd website && npm install)
|
||||||
If there are spell check errors:
|
script:
|
||||||
|
- cd website
|
||||||
1) Suppressing False Positives: Edit website/.spelling to add suppressions. Instructions
|
- npm run link-lint
|
||||||
are at the top of the file and explain how to suppress false positives either globally or
|
- npm run spellcheck
|
||||||
within a particular file.
|
|
||||||
|
|
||||||
2) Running Spell Check Locally: cd website && npm install && npm run spellcheck
|
|
||||||
|
|
||||||
For more information, refer to: https://www.npmjs.com/package/markdown-spellcheck
|
|
||||||
|
|
||||||
" && false; }
|
|
||||||
|
|
||||||
- name: "Build and test on ARM64 CPU architecture (1)"
|
- name: "Build and test on ARM64 CPU architecture (1)"
|
||||||
stage: Tests - phase 2
|
stage: Tests - phase 2
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,24 +3,24 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"examples": "docusaurus-examples",
|
"examples": "docusaurus-examples",
|
||||||
"start": "docusaurus-start",
|
"start": "docusaurus-start",
|
||||||
"build": "docusaurus-build && node script/do-redirects.js",
|
"build": "npm run compile-scss && docusaurus-build && node script/do-redirects.js && node script/fix-docsearch.js",
|
||||||
"publish-gh-pages": "docusaurus-publish",
|
"publish-gh-pages": "docusaurus-publish",
|
||||||
"write-translations": "docusaurus-write-translations",
|
"write-translations": "docusaurus-write-translations",
|
||||||
"version": "docusaurus-version",
|
"version": "docusaurus-version",
|
||||||
"rename-version": "docusaurus-rename-version",
|
"rename-version": "docusaurus-rename-version",
|
||||||
"compile-scss": "node-sass scss/custom.scss > static/css/custom.css",
|
"compile-scss": "node-sass scss/custom.scss > static/css/custom.css",
|
||||||
"link-lint": "docusaurus-build && node script/link-lint.js",
|
"link-lint": "npm run build && node script/link-lint.js",
|
||||||
"lint": "npm run link-lint",
|
"spellcheck": "mdspell --en-us --ignore-numbers --report '../docs/**/*.md' || (./script/notify-spellcheck-issues && false)"
|
||||||
"spellcheck": "mdspell --en-us --ignore-numbers --report '../docs/**/*.md'"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=16"
|
||||||
},
|
},
|
||||||
"volta": {
|
"volta": {
|
||||||
"node": "12.22.12"
|
"node": "16.17.0",
|
||||||
|
"npm": "8.15.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"docusaurus": "^1.14.4",
|
"docusaurus": "^1.14.7",
|
||||||
"markdown-spellcheck": "^1.3.1",
|
"markdown-spellcheck": "^1.3.1",
|
||||||
"node-sass": "^7.0.0"
|
"node-sass": "^7.0.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
const replace = require('replace-in-file');
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Force upgrade to docusearch 2 as 1 appers to have stopped being supported
|
||||||
|
replace.sync({
|
||||||
|
files: './build/ApacheDruid/docs/**/*.html',
|
||||||
|
from: 'https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js',
|
||||||
|
to: 'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js',
|
||||||
|
});
|
||||||
|
replace.sync({
|
||||||
|
files: './build/ApacheDruid/docs/**/*.html',
|
||||||
|
from: 'https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css',
|
||||||
|
to: 'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css',
|
||||||
|
});
|
||||||
|
replace.sync({
|
||||||
|
files: './build/ApacheDruid/css/main.css',
|
||||||
|
from: 'ul li a',
|
||||||
|
to: 'ul li > a',
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Fixed docsearch`);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error occurred:', error);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
echo "
|
||||||
|
If there are spell check errors:
|
||||||
|
|
||||||
|
1) Suppressing False Positives: Edit website/.spelling to add suppressions. Instructions
|
||||||
|
are at the top of the file and explain how to suppress false positives either globally or
|
||||||
|
within a particular file.
|
||||||
|
|
||||||
|
2) Running Spell Check Locally: cd website && npm install && npm run spellcheck
|
||||||
|
|
||||||
|
For more information, refer to: https://www.npmjs.com/package/markdown-spellcheck
|
||||||
|
"
|
|
@ -31,29 +31,20 @@ $link: #4460de;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navigationSlider .slidingNav ul li a {
|
.navigationSlider .slidingNav ul li > a {
|
||||||
color: #9caeff;
|
color: #9caeff;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navigationSlider .slidingNav ul li:last-child a {
|
|
||||||
display: inline-block;
|
|
||||||
height: 32px;
|
|
||||||
line-height: 32px;
|
|
||||||
background: #9caeff;
|
|
||||||
border-radius: 2px;
|
|
||||||
padding: 0 10px;
|
|
||||||
color: #1C1C26;
|
|
||||||
font-weight: 600;
|
|
||||||
min-width: 106px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc .toggleNav .navGroup .navGroupSubcategoryTitle {
|
.toc .toggleNav .navGroup .navGroupSubcategoryTitle {
|
||||||
color: #717171;
|
color: #717171;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.algolia-autocomplete .algolia-docsearch-footer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
pre code {
|
pre code {
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,8 @@ const siteConfig = {
|
||||||
editUrl: 'https://github.com/apache/druid/edit/master/docs/',
|
editUrl: 'https://github.com/apache/druid/edit/master/docs/',
|
||||||
|
|
||||||
algolia: {
|
algolia: {
|
||||||
apiKey: '2de99082a9f38e49dfaa059bbe4c901d',
|
appId: 'CPK9PMSCEY',
|
||||||
|
apiKey: 'd4ef4ffe3a2f0c7d1e34b062fd98736b',
|
||||||
indexName: 'apache_druid',
|
indexName: 'apache_druid',
|
||||||
algoliaOptions: {
|
algoliaOptions: {
|
||||||
facetFilters: [
|
facetFilters: [
|
||||||
|
|
|
@ -25,26 +25,17 @@
|
||||||
height: 42px;
|
height: 42px;
|
||||||
margin: 0; }
|
margin: 0; }
|
||||||
|
|
||||||
.navigationSlider .slidingNav ul li a {
|
.navigationSlider .slidingNav ul li > a {
|
||||||
color: #9caeff;
|
color: #9caeff;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 15px; }
|
font-size: 15px; }
|
||||||
|
|
||||||
.navigationSlider .slidingNav ul li:last-child a {
|
|
||||||
display: inline-block;
|
|
||||||
height: 32px;
|
|
||||||
line-height: 32px;
|
|
||||||
background: #9caeff;
|
|
||||||
border-radius: 2px;
|
|
||||||
padding: 0 10px;
|
|
||||||
color: #1C1C26;
|
|
||||||
font-weight: 600;
|
|
||||||
min-width: 106px;
|
|
||||||
text-align: center; }
|
|
||||||
|
|
||||||
.toc .toggleNav .navGroup .navGroupSubcategoryTitle {
|
.toc .toggleNav .navGroup .navGroupSubcategoryTitle {
|
||||||
color: #717171; }
|
color: #717171; }
|
||||||
|
|
||||||
|
.algolia-autocomplete .algolia-docsearch-footer {
|
||||||
|
display: none; }
|
||||||
|
|
||||||
pre code {
|
pre code {
|
||||||
max-height: 500px; }
|
max-height: 500px; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue